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
2feae43e
Commit
2feae43e
authored
5 months ago
by
Powers, Peter M.
Browse files
Options
Downloads
Patches
Plain Diff
added interface system handler to loader
parent
03a82e0d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!427
Interface system
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/gov/usgs/earthquake/nshmp/model/ModelLoader.java
+56
-8
56 additions, 8 deletions
...ain/java/gov/usgs/earthquake/nshmp/model/ModelLoader.java
with
56 additions
and
8 deletions
src/main/java/gov/usgs/earthquake/nshmp/model/ModelLoader.java
+
56
−
8
View file @
2feae43e
...
...
@@ -9,6 +9,7 @@ import static gov.usgs.earthquake.nshmp.model.ModelFiles.TREE_INFO;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
checkGridDataDirectory
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
checkSourceTree
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readCalcConfig
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readCrustalSystemRuptureSet
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readDecollementConfig
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readFaultClusterSet
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readFaultConfig
;
...
...
@@ -23,6 +24,7 @@ import static gov.usgs.earthquake.nshmp.model.ModelFiles.readInterfaceClusterSet
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readInterfaceConfig
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readInterfaceFeatures
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readInterfaceRuptureSet
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readInterfaceSystemRuptureSet
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readMfdConfig
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readMfdMap
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readModelInfo
;
...
...
@@ -33,7 +35,6 @@ import static gov.usgs.earthquake.nshmp.model.ModelFiles.readSiteData;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readSlabConfig
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readSlabRuptureSets
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readSourceTree
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readSystemRuptureSet
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readTreeInfo
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
ModelFiles
.
readZoneConfig
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
model
.
SourceType
.
DECOLLEMENT
;
...
...
@@ -103,7 +104,8 @@ abstract class ModelLoader {
public
static
void
main
(
String
[]
args
)
throws
IOException
{
Path
testModel
=
Paths
.
get
(
"../nshm-conus-2018-5.2.x-maint"
);
Path
testModel
=
Paths
.
get
(
"../nshm-prvi"
);
// Path testModel = Paths.get("../nshm-conus-2018-5.2.x-maint");
// Path testModel = Paths.get("../nshm-conus");
// Path testModel = Paths.get("../nshm-alaska");
// Path testModel = Paths.get("../nshm-alaska-2007-2.2.x-maint");
...
...
@@ -728,7 +730,7 @@ abstract class ModelLoader {
processSystemBranch
(
child
,
treeBuilder
,
data
);
}
}
else
{
SystemRuptureSet
srs
=
readSystemRuptureSet
(
dir
,
data
).
orElseThrow
();
SystemRuptureSet
srs
=
read
Crustal
SystemRuptureSet
(
dir
,
data
).
orElseThrow
();
treeBuilder
.
addLeaf
(
branch
,
srs
);
// add features to 'data'
// TODO: revisit, do we want parent sections??
...
...
@@ -913,10 +915,15 @@ abstract class ModelLoader {
System
.
out
.
println
(
" tree: ["
+
info
.
id
+
"] "
+
root
.
relativize
(
dir
));
data
.
interfaceFeatureMap
(
readInterfaceFeatures
(
dir
).
orElseThrow
());
/* Load features if 'classic' subduction model */
var
interfaceSections
=
readInterfaceFeatures
(
dir
);
interfaceSections
.
ifPresent
(
data:
:
interfaceFeatureMap
);
List
<
Feature
>
features
=
ModelData
.
featureMapToList
(
data
.
interfaceFeatureMap
().
orElseThrow
().
values
());
/* Set flag to process a logic-tree of fault-system solutions. */
boolean
interfaceSystemTree
=
interfaceSections
.
isEmpty
();
// List<Feature> features = ModelData.featureMapToList(
// data.interfaceFeatureMap().orElseThrow().values());
SourceTree
.
Builder
treeBuilder
=
SourceTree
.
builder
()
.
path
(
dir
)
...
...
@@ -925,11 +932,23 @@ abstract class ModelLoader {
.
setting
(
data
.
tectonicSetting
())
.
type
(
INTERFACE
)
.
gmms
(
data
.
gmms
())
.
features
(
features
)
//
.features(features)
.
root
(
tree
);
for
(
Branch
<
Path
>
branch
:
tree
)
{
processBranch
(
branch
,
treeBuilder
,
ModelData
.
copyOf
(
data
));
if
(
interfaceSystemTree
)
{
processSystemBranch
(
branch
,
treeBuilder
,
data
);
}
else
{
processBranch
(
branch
,
treeBuilder
,
data
);
}
}
if
(
data
.
systemFeatureMap
().
isPresent
())
{
treeBuilder
.
features
(
ModelData
.
featureMapToList
(
data
.
systemFeatureMap
().
orElseThrow
().
values
()));
}
else
{
treeBuilder
.
features
(
ModelData
.
featureMapToList
(
data
.
interfaceFeatureMap
().
orElseThrow
().
values
()));
}
return
treeBuilder
.
build
();
...
...
@@ -1036,6 +1055,35 @@ abstract class ModelLoader {
treeBuilder
.
addLeaf
(
pathTree
.
get
(
i
),
crsList
.
get
(
i
));
}
}
/* Process fault system source tree branches. */
private
void
processSystemBranch
(
Branch
<
Path
>
branch
,
SourceTree
.
Builder
treeBuilder
,
ModelData
data
)
{
/*
* No configuration overrides are currently expected for
* fault-system-solutions so this is simpler than above.
*/
Path
dir
=
branch
.
value
();
System
.
out
.
println
(
" branch: "
+
root
.
relativize
(
dir
));
Optional
<
LogicTree
<
Path
>>
tree
=
readSourceTree
(
dir
);
if
(
tree
.
isPresent
())
{
LogicTree
<
Path
>
children
=
tree
.
orElseThrow
();
treeBuilder
.
addBranches
(
branch
,
children
);
for
(
Branch
<
Path
>
child
:
children
)
{
processSystemBranch
(
child
,
treeBuilder
,
data
);
}
}
else
{
SystemRuptureSet
srs
=
readInterfaceSystemRuptureSet
(
dir
,
data
).
orElseThrow
();
treeBuilder
.
addLeaf
(
branch
,
srs
);
// add features to 'data'
// TODO: revisit, do we want parent sections??
data
.
systemFeatureMap
(
srs
.
sectionMap
);
}
}
}
static
List
<
SourceTree
>
gridSources
(
...
...
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