Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-haz
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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-haz
Commits
db19afd0
Commit
db19afd0
authored
4 months ago
by
Powers, Peter M.
Browse files
Options
Downloads
Patches
Plain Diff
lib update with config ret period --> double
parent
d6a4e7a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!801
lib update with config ret period --> double
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gradle.properties
+1
-1
1 addition, 1 deletion
gradle.properties
src/main/java/gov/usgs/earthquake/nshmp/HazardMaps.java
+10
-11
10 additions, 11 deletions
src/main/java/gov/usgs/earthquake/nshmp/HazardMaps.java
with
11 additions
and
12 deletions
gradle.properties
+
1
−
1
View file @
db19afd0
...
...
@@ -12,7 +12,7 @@ micronautVersion = 3.2.3
micronautRxVersion
=
2.1.1
nodePluginVersion
=
3.0.1
nodeVersion
=
16.3.0
nshmpLibVersion
=
1.5.
1
nshmpLibVersion
=
1.5.
2
nshmpUtilsJavaVersion
=
0.4.0
openApiVersion
=
4.0.0
shadowVersion
=
7.1.2
...
...
This diff is collapsed.
Click to expand it.
src/main/java/gov/usgs/earthquake/nshmp/HazardMaps.java
+
10
−
11
View file @
db19afd0
...
...
@@ -27,7 +27,7 @@ public class HazardMaps {
private
static
final
String
COMMA
=
","
;
private
static
final
String
CURVES_FILE
=
"curves.csv"
;
private
static
final
List
<
Integer
>
DEFAULT_RETURN_PERIODS
=
List
.
of
(
475
,
975
,
2475
);
private
static
final
List
<
Double
>
DEFAULT_RETURN_PERIODS
=
List
.
of
(
475
.0
,
975
.0
,
2475
.0
);
private
static
final
Interpolator
INTERPOLATOR
=
Interpolator
.
builder
()
.
logx
()
.
logy
()
...
...
@@ -61,14 +61,13 @@ public class HazardMaps {
}
Path
curvesPath
=
Path
.
of
(
args
[
0
]);
List
<
Integer
>
returnPeriods
=
DEFAULT_RETURN_PERIODS
;
List
<
Double
>
returnPeriods
=
DEFAULT_RETURN_PERIODS
;
Logger
log
=
Logger
.
getLogger
(
HazardMaps
.
class
.
getName
());
if
(
args
.
length
>
1
)
{
returnPeriods
=
Arrays
.
stream
(
args
)
.
skip
(
1
)
.
mapToInt
(
Integer:
:
valueOf
)
.
boxed
()
.
map
(
Double:
:
valueOf
)
.
collect
(
Collectors
.
toList
());
}
...
...
@@ -83,7 +82,7 @@ public class HazardMaps {
static
void
createDataSets
(
Path
curvesPath
,
List
<
Integer
>
returnPeriods
,
List
<
Double
>
returnPeriods
,
Logger
log
)
throws
IOException
{
log
.
info
(
PROGRAM
+
": Creating hazard map datasets..."
);
log
.
info
(
" Return periods: "
+
returnPeriods
.
toString
());
...
...
@@ -97,7 +96,7 @@ public class HazardMaps {
}
}
private
static
List
<
String
>
create
(
List
<
String
>
lines
,
List
<
Integer
>
returnPeriods
)
{
private
static
List
<
String
>
create
(
List
<
String
>
lines
,
List
<
Double
>
returnPeriods
)
{
int
headerCount
=
lines
.
get
(
0
).
startsWith
(
"name"
)
?
3
:
2
;
List
<
String
>
header
=
Arrays
.
asList
(
lines
.
get
(
0
).
split
(
COMMA
));
...
...
@@ -126,7 +125,7 @@ public class HazardMaps {
return
linesOut
;
}
private
static
void
processCurveFile
(
Path
curves
,
List
<
Integer
>
returnPeriods
)
{
private
static
void
processCurveFile
(
Path
curves
,
List
<
Double
>
returnPeriods
)
{
try
(
Stream
<
String
>
stream
=
Files
.
lines
(
curves
))
{
List
<
String
>
linesIn
=
stream
.
collect
(
Collectors
.
toList
());
List
<
String
>
linesOut
=
create
(
linesIn
,
returnPeriods
);
...
...
@@ -138,9 +137,9 @@ public class HazardMaps {
}
private
static
class
CurvesVisitor
extends
SimpleFileVisitor
<
Path
>
{
List
<
Integer
>
returnPeriods
;
List
<
Double
>
returnPeriods
;
public
CurvesVisitor
(
List
<
Integer
>
returnPeriods
)
{
public
CurvesVisitor
(
List
<
Double
>
returnPeriods
)
{
this
.
returnPeriods
=
returnPeriods
;
}
...
...
@@ -155,11 +154,11 @@ public class HazardMaps {
}
private
static
class
Slicer
{
private
final
List
<
Integer
>
returnPeriods
;
private
final
List
<
Double
>
returnPeriods
;
private
final
double
[]
imls
;
private
final
int
headerCount
;
private
Slicer
(
List
<
Integer
>
returnPeriods
,
double
imls
[],
int
headerCount
)
{
private
Slicer
(
List
<
Double
>
returnPeriods
,
double
imls
[],
int
headerCount
)
{
this
.
returnPeriods
=
returnPeriods
;
this
.
imls
=
imls
;
this
.
headerCount
=
headerCount
;
...
...
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