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
6b1031cd
Commit
6b1031cd
authored
3 years ago
by
Clayton, Brandon Scott
Browse files
Options
Downloads
Plain Diff
Merge branch 'usage' into 'main'
Match dynamic usage See merge request
!100
parents
658512a4
173d586f
No related branches found
No related tags found
2 merge requests
!101
Production Release | nshmp-ws-static
,
!100
Match dynamic usage
Pipeline
#116275
passed
3 years ago
Stage: build
Stage: trigger
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfService.java
+29
-22
29 additions, 22 deletions
...a/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfService.java
with
29 additions
and
22 deletions
src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfService.java
+
29
−
22
View file @
6b1031cd
...
...
@@ -126,39 +126,24 @@ public abstract class NetcdfService {
class
Metadata
{
final
String
description
;
final
String
[]
syntax
;
final
String
netcdfFile
;
final
Parameters
model
;
final
ScienceBaseMetadata
scienceBaseMetadata
;
final
SourceModel
model
;
final
DoubleParameter
longitude
;
final
DoubleParameter
latitude
;
final
DoubleParameter
vs30
;
final
NetcdfMetadata
netcdfMetadata
;
Metadata
(
HttpRequest
<?>
request
,
String
description
)
{
var
url
=
request
.
getUri
().
toString
();
url
=
url
.
endsWith
(
"/"
)
?
url
.
substring
(
0
,
url
.
length
()
-
1
)
:
url
;
this
.
description
=
description
;
scienceBaseMetadata
=
netcdf
().
netcdfData
().
scienceBaseMetadata
();
var
fileName
=
netcdf
.
netcdfPath
().
getFileName
();
netcdfFile
=
fileName
==
null
?
netcdf
().
netcdfPath
().
toString
()
:
fileName
.
toString
();
syntax
=
new
String
[]
{
url
+
"/{longitude:number}/{latitude:number}"
,
url
+
"?longitude={number}&latitude={number}"
,
url
+
"/{longitude:number}/{latitude:number}/{siteClass:NehrpSiteClass}"
,
url
+
"?longitude={number}&latitude={number}&siteClass={NehrpSiteClass}"
,
};
model
=
new
Parameters
();
}
}
class
Parameters
{
final
String
name
;
final
DoubleParameter
longitude
;
final
DoubleParameter
latitude
;
final
Map
<
NehrpSiteClass
,
Double
>
siteClasses
;
final
DoubleParameter
vs30
;
Parameters
()
{
var
netcdfData
=
netcdf
().
netcdfData
();
var
bounds
=
netcdfData
.
bounds
();
name
=
netcdfData
.
scienceBaseMetadata
().
label
;
var
bounds
=
netcdf
().
netcdfData
().
bounds
();
longitude
=
new
DoubleParameter
(
"Longitude"
,
"°"
,
...
...
@@ -169,12 +154,34 @@ public abstract class NetcdfService {
"°"
,
Maths
.
round
(
bounds
.
min
.
latitude
,
3
),
Maths
.
round
(
bounds
.
max
.
latitude
,
3
));
siteClasses
=
netcdfData
.
vs30Map
();
model
=
new
SourceModel
();
vs30
=
new
DoubleParameter
(
"Vs30"
,
"m/s"
,
150
,
1500
);
netcdfMetadata
=
new
NetcdfMetadata
();
}
}
class
NetcdfMetadata
{
final
String
netcdfFile
;
final
ScienceBaseMetadata
scienceBaseMetadata
;
NetcdfMetadata
()
{
var
fileName
=
netcdf
.
netcdfPath
().
getFileName
();
netcdfFile
=
fileName
==
null
?
netcdf
().
netcdfPath
().
toString
()
:
fileName
.
toString
();
scienceBaseMetadata
=
netcdf
().
netcdfData
().
scienceBaseMetadata
();
}
}
class
SourceModel
{
final
String
name
;
final
Map
<
NehrpSiteClass
,
Double
>
siteClasses
;
SourceModel
()
{
name
=
netcdf
().
netcdfData
().
scienceBaseMetadata
().
label
;
siteClasses
=
netcdf
().
netcdfData
().
vs30Map
();
}
}
...
...
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