Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-lib
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Seismic Hazard Model Project
nshmp-lib
Commits
77a30ab7
Commit
77a30ab7
authored
3 years ago
by
Powers, Peter M.
Browse files
Options
Downloads
Patches
Plain Diff
named sites flag
parent
c0a6cde3
No related branches found
No related tags found
1 merge request
!252
Conditional spectrum (interim updates)
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/gov/usgs/earthquake/nshmp/calc/HazardExport.java
+8
-9
8 additions, 9 deletions
...ain/java/gov/usgs/earthquake/nshmp/calc/HazardExport.java
src/test/java/gov/usgs/earthquake/nshmp/model/LoaderTests.java
+2
-1
2 additions, 1 deletion
...est/java/gov/usgs/earthquake/nshmp/model/LoaderTests.java
with
10 additions
and
10 deletions
src/main/java/gov/usgs/earthquake/nshmp/calc/HazardExport.java
+
8
−
9
View file @
77a30ab7
...
...
@@ -69,7 +69,7 @@ public final class HazardExport {
private
HazardExport
(
HazardModel
model
,
CalcConfig
config
,
List
<
Site
>
s
ites
,
boolean
namedS
ites
,
Path
out
)
throws
IOException
{
this
.
out
=
out
;
...
...
@@ -83,10 +83,8 @@ public final class HazardExport {
?
Maths
.
annualRateToProbabilityConverter
().
andThen
(
formatter
)
:
formatter
;
Site
demoSite
=
sites
.
get
(
0
);
this
.
namedSites
=
demoSite
.
name
()
!=
Site
.
NO_NAME
;
init
(
sites
);
this
.
namedSites
=
namedSites
;
init
();
}
/**
...
...
@@ -94,21 +92,22 @@ public final class HazardExport {
*
* @param model being run
* @param config that specifies output options and formats
* @param sites reference to the sites to be processed (not retained)
* @param namedSites whether the sites being processed contain a 'name' column
* that should be preserved in output files
* @param out results directory; this may have been been modified from
* {@code config.output.directory} by calling program
*/
public
static
HazardExport
create
(
HazardModel
model
,
CalcConfig
config
,
List
<
Site
>
s
ites
,
boolean
namedS
ites
,
Path
out
)
throws
IOException
{
return
new
HazardExport
(
model
,
config
,
s
ites
,
out
);
return
new
HazardExport
(
model
,
config
,
namedS
ites
,
out
);
}
/* Initialize output directories. */
private
void
init
(
List
<
Site
>
sites
)
throws
IOException
{
private
void
init
()
throws
IOException
{
for
(
Imt
imt
:
config
.
hazard
.
imts
)
{
...
...
This diff is collapsed.
Click to expand it.
src/test/java/gov/usgs/earthquake/nshmp/model/LoaderTests.java
+
2
−
1
View file @
77a30ab7
...
...
@@ -214,7 +214,8 @@ class LoaderTests {
List
<
Site
>
sites
)
throws
IOException
{
ExecutorService
exec
=
initExecutor
(
config
.
performance
.
threadCount
);
HazardExport
handler
=
HazardExport
.
create
(
model
,
config
,
sites
,
config
.
output
.
directory
);
boolean
namedSites
=
sites
.
get
(
0
).
name
()
!=
Site
.
NO_NAME
;
HazardExport
handler
=
HazardExport
.
create
(
model
,
config
,
namedSites
,
config
.
output
.
directory
);
for
(
Site
site
:
sites
)
{
Hazard
hazard
=
HazardCalcs
.
hazard
(
model
,
config
,
site
,
exec
);
handler
.
write
(
hazard
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment