Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-ws-static
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-ws-static
Commits
0573110f
Commit
0573110f
authored
2 years ago
by
Clayton, Brandon Scott
Browse files
Options
Downloads
Patches
Plain Diff
switch to netcdf data files
parent
ed3ea868
No related branches found
No related tags found
2 merge requests
!128
Production Release | nshmp-ws-static
,
!127
Resolves - Handle Multiple NetCDF Files for AASHTO Service
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/aashto/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfServiceGroundMotions.java
+10
-12
10 additions, 12 deletions
...rthquake/nshmp/netcdf/www/NetcdfServiceGroundMotions.java
with
10 additions
and
12 deletions
src/aashto/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfServiceGroundMotions.java
+
10
−
12
View file @
0573110f
...
@@ -5,6 +5,7 @@ import java.util.stream.Collectors;
...
@@ -5,6 +5,7 @@ import java.util.stream.Collectors;
import
gov.usgs.earthquake.nshmp.data.XySequence
;
import
gov.usgs.earthquake.nshmp.data.XySequence
;
import
gov.usgs.earthquake.nshmp.geo.Location
;
import
gov.usgs.earthquake.nshmp.geo.Location
;
import
gov.usgs.earthquake.nshmp.netcdf.NetcdfDataFilesGroundMotions
;
import
gov.usgs.earthquake.nshmp.netcdf.NetcdfGroundMotions
;
import
gov.usgs.earthquake.nshmp.netcdf.NetcdfGroundMotions
;
import
gov.usgs.earthquake.nshmp.netcdf.NetcdfVersion
;
import
gov.usgs.earthquake.nshmp.netcdf.NetcdfVersion
;
import
gov.usgs.earthquake.nshmp.netcdf.data.StaticData
;
import
gov.usgs.earthquake.nshmp.netcdf.data.StaticData
;
...
@@ -32,8 +33,8 @@ public class NetcdfServiceGroundMotions extends NetcdfService<Query> {
...
@@ -32,8 +33,8 @@ public class NetcdfServiceGroundMotions extends NetcdfService<Query> {
static
final
String
X_LABEL
=
"Period (s)"
;
static
final
String
X_LABEL
=
"Period (s)"
;
static
final
String
Y_LABEL
=
"Spectral Acceleration (g)"
;
static
final
String
Y_LABEL
=
"Spectral Acceleration (g)"
;
public
NetcdfServiceGroundMotions
(
NetcdfGroundMotions
netcdf
)
{
public
NetcdfServiceGroundMotions
(
Netcdf
DataFiles
GroundMotions
netcdf
DataFiles
)
{
super
(
netcdf
);
super
(
netcdf
DataFiles
);
}
}
@Override
@Override
...
@@ -51,17 +52,16 @@ public class NetcdfServiceGroundMotions extends NetcdfService<Query> {
...
@@ -51,17 +52,16 @@ public class NetcdfServiceGroundMotions extends NetcdfService<Query> {
@Override
@Override
String
getServiceName
()
{
String
getServiceName
()
{
return
getSourceModel
().
name
;
return
String
.
format
(
"AASHTO-%d Web Services"
,
netcdfDataFiles
().
aashtoYear
())
;
}
}
@Override
NetcdfGroundMotions
netcdf
(
Location
location
)
{
SourceModel
getSourceModel
()
{
return
netcdfDataFiles
().
netcdf
(
location
);
return
new
SourceModel
(
netcdf
());
}
}
@Override
@Override
NetcdfGroundMotions
netcdf
()
{
Netcdf
DataFiles
GroundMotions
netcdf
DataFiles
()
{
return
(
NetcdfGroundMotions
)
netcdf
;
return
(
Netcdf
DataFiles
GroundMotions
)
netcdf
DataFiles
;
}
}
@Override
@Override
...
@@ -82,14 +82,13 @@ public class NetcdfServiceGroundMotions extends NetcdfService<Query> {
...
@@ -82,14 +82,13 @@ public class NetcdfServiceGroundMotions extends NetcdfService<Query> {
}
}
}
}
@Override
ResponseBody
<
RequestDataSiteClass
,
ResponseData
<
ServiceResponseMetadata
>>
processCurvesSiteClass
(
ResponseBody
<
RequestDataSiteClass
,
ResponseData
<
ServiceResponseMetadata
>>
processCurvesSiteClass
(
RequestDataSiteClass
request
,
RequestDataSiteClass
request
,
String
url
)
{
String
url
)
{
WsUtils
.
checkValue
(
Key
.
LATITUDE
,
request
.
latitude
);
WsUtils
.
checkValue
(
Key
.
LATITUDE
,
request
.
latitude
);
WsUtils
.
checkValue
(
Key
.
LONGITUDE
,
request
.
longitude
);
WsUtils
.
checkValue
(
Key
.
LONGITUDE
,
request
.
longitude
);
WsUtils
.
checkValue
(
Key
.
SITE_CLASS
,
request
.
siteClass
);
WsUtils
.
checkValue
(
Key
.
SITE_CLASS
,
request
.
siteClass
);
var
curves
=
netcdf
().
staticData
(
request
.
site
,
request
.
siteClass
);
var
curves
=
netcdf
(
request
.
site
).
staticData
(
request
.
site
,
request
.
siteClass
);
var
responseData
=
toResponseData
(
request
,
curves
);
var
responseData
=
toResponseData
(
request
,
curves
);
return
ResponseBody
.<
RequestDataSiteClass
,
ResponseData
<
ServiceResponseMetadata
>>
success
()
return
ResponseBody
.<
RequestDataSiteClass
,
ResponseData
<
ServiceResponseMetadata
>>
success
()
...
@@ -101,13 +100,12 @@ public class NetcdfServiceGroundMotions extends NetcdfService<Query> {
...
@@ -101,13 +100,12 @@ public class NetcdfServiceGroundMotions extends NetcdfService<Query> {
.
build
();
.
build
();
}
}
@Override
ResponseBody
<
RequestData
,
List
<
ResponseData
<
ServiceResponseMetadata
>>>
processCurves
(
ResponseBody
<
RequestData
,
List
<
ResponseData
<
ServiceResponseMetadata
>>>
processCurves
(
RequestData
request
,
RequestData
request
,
String
url
)
{
String
url
)
{
WsUtils
.
checkValue
(
Key
.
LATITUDE
,
request
.
latitude
);
WsUtils
.
checkValue
(
Key
.
LATITUDE
,
request
.
latitude
);
WsUtils
.
checkValue
(
Key
.
LONGITUDE
,
request
.
longitude
);
WsUtils
.
checkValue
(
Key
.
LONGITUDE
,
request
.
longitude
);
var
curves
=
netcdf
().
staticData
(
request
.
site
);
var
curves
=
netcdf
(
request
.
site
).
staticData
(
request
.
site
);
var
responseData
=
toList
(
request
,
curves
);
var
responseData
=
toList
(
request
,
curves
);
return
ResponseBody
.<
RequestData
,
List
<
ResponseData
<
ServiceResponseMetadata
>>>
success
()
return
ResponseBody
.<
RequestData
,
List
<
ResponseData
<
ServiceResponseMetadata
>>>
success
()
...
...
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