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
4aa64cd2
Commit
4aa64cd2
authored
3 years ago
by
Powers, Peter M.
Browse files
Options
Downloads
Patches
Plain Diff
removed unnecessary methods from export classes
parent
47d4cdc9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!251
Export updates
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/gov/usgs/earthquake/nshmp/calc/EqRateExport.java
+0
-35
0 additions, 35 deletions
...ain/java/gov/usgs/earthquake/nshmp/calc/EqRateExport.java
src/main/java/gov/usgs/earthquake/nshmp/calc/HazardExport.java
+0
-41
0 additions, 41 deletions
...ain/java/gov/usgs/earthquake/nshmp/calc/HazardExport.java
with
0 additions
and
76 deletions
src/main/java/gov/usgs/earthquake/nshmp/calc/EqRateExport.java
+
0
−
35
View file @
4aa64cd2
package
gov.usgs.earthquake.nshmp.calc
;
import
static
com
.
google
.
common
.
base
.
Preconditions
.
checkState
;
import
static
java
.
nio
.
file
.
StandardOpenOption
.
APPEND
;
import
java.io.IOException
;
...
...
@@ -41,11 +40,8 @@ public final class EqRateExport {
private
final
HazardModel
model
;
private
final
boolean
exportSource
;
private
int
resultCount
=
0
;
private
final
boolean
namedSites
;
private
boolean
firstRecord
=
true
;
private
boolean
used
=
false
;
private
EqRateExport
(
HazardModel
model
,
...
...
@@ -90,37 +86,6 @@ public final class EqRateExport {
* @param rate data container to add
*/
public
void
write
(
EqRate
rate
)
throws
IOException
{
checkState
(!
used
,
"This result handler is expired"
);
writeRate
(
rate
);
resultCount
++;
}
/**
* Flushes any remaining results, stops all timers and sets the state of this
* exporter to 'used'; no more results may be added.
*/
public
void
expire
()
{
used
=
true
;
}
/**
* The number of rate results passed to this handler thus far.
*/
public
int
resultCount
()
{
return
resultCount
;
}
/**
* The target output directory established by this handler.
*/
public
Path
outputDir
()
{
return
out
;
}
/*
* Write the current list of {@code EqRate}s to file.
*/
private
void
writeRate
(
EqRate
rate
)
throws
IOException
{
Iterable
<
Double
>
emptyValues
=
Doubles
.
asList
(
new
double
[
rate
.
totalMfd
.
size
()]);
Function
<
Double
,
String
>
formatter
=
Parsing
.
formatDoubleFunction
(
valueFormat
);
...
...
This diff is collapsed.
Click to expand it.
src/main/java/gov/usgs/earthquake/nshmp/calc/HazardExport.java
+
0
−
41
View file @
4aa64cd2
package
gov.usgs.earthquake.nshmp.calc
;
import
static
com
.
google
.
common
.
base
.
Preconditions
.
checkState
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
calc
.
ValueFormat
.
POISSON_PROBABILITY
;
import
static
gov
.
usgs
.
earthquake
.
nshmp
.
data
.
MutableXySequence
.
emptyCopyOf
;
import
static
java
.
nio
.
charset
.
StandardCharsets
.
UTF_8
;
...
...
@@ -51,14 +50,6 @@ import gov.usgs.earthquake.nshmp.model.SourceType;
*/
public
final
class
HazardExport
{
/*
* Developer notes
*
* Export of gmm and source type is unreliable for results where multiple
* models may have been run (e.g. Hazard2018) because the model.types() and
* model.gmms() methods will only reflect a single model.
*/
private
static
final
String
GMM_DIR
=
"gmm"
;
static
final
String
TYPE_DIR
=
"source"
;
private
static
final
String
CURVE_FILE_ASCII
=
"curves.csv"
;
...
...
@@ -73,10 +64,7 @@ public final class HazardExport {
private
final
Function
<
Double
,
String
>
valueFormatter
;
private
int
resultCount
=
0
;
private
final
boolean
namedSites
;
private
boolean
used
=
false
;
private
HazardExport
(
HazardModel
model
,
...
...
@@ -189,35 +177,6 @@ public final class HazardExport {
* @param hazard to write
*/
public
void
write
(
Hazard
hazard
)
throws
IOException
{
checkState
(!
used
,
"This result handler is expired"
);
writeHazard
(
hazard
);
resultCount
++;
}
/**
* Stops all timers and sets the state of this {@code Results} instance to
* 'used'; no more results may be added.
*/
public
void
expire
()
{
used
=
true
;
}
/**
* The number of hazard results passed to this handler thus far.
*/
public
int
resultCount
()
{
return
resultCount
;
}
/**
* The target output directory established by this handler.
*/
public
Path
outputDir
()
{
return
out
;
}
/* Write the supplied hazard results to file(s). */
private
void
writeHazard
(
Hazard
hazard
)
throws
IOException
{
Set
<
Gmm
>
gmms
=
hazard
.
model
.
gmms
();
Set
<
SourceType
>
types
=
hazard
.
model
.
types
();
...
...
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