Skip to content
Snippets Groups Projects
Commit 28015742 authored by Powers, Peter M.'s avatar Powers, Peter M. Committed by GitHub
Browse files

Merge pull request #246 from pmpowers-usgs/gradle-doc-update

Gradle doc update
parents 2444defd af8bed95
No related branches found
No related tags found
No related merge requests found
......@@ -11,11 +11,11 @@ hazard ../../peer/models/Set1-Case1 "Test Site, -122.0, 38.0"
The PEER models, such as that designated above, consist of simple cases for different source types commonly encountered in a PSHA and are included in the nshmp-haz repository to support testing. See the [PEER directory](../../peer/) for more information.
The result of this calculation should be available as a single comma-delimited file containing several total mean hazard curves for PGA in a newly created 'curves' directory. In this example, the calculation configuration was derived from the model directory and the site was specified as a comma-delimited string. The string must have the form: `name,lon,lat[,vs30,vsInf[,z1p0,z2p5]]`, where `vs30`, `vsInf`, `z1p0`, and `z2p5` are optional. See the [site specification](https://github.com/usgs/nshmp-haz/wiki/Sites) page for more details.
The result of this calculation should be available as a single comma-delimited file containing several total mean hazard curves for PGA in a newly created 'curves' directory. In this example, the calculation configuration was derived from the model directory and the site was specified as a comma-delimited string. The string must have the form: `name,lon,lat[,vs30,vsInf[,z1p0,z2p5]]`, where `vs30`, `vsInf`, `z1p0`, and `z2p5` are optional. See the [site specification](https://github.com/usgs/nshmp-haz/wiki/sites) page for more details.
Note that not all [calculation configuration](https://github.com/usgs/nshmp-haz/wiki/Configuration) parameters need be supplied; see the [configuration file](../../peer/models/Set1-Case1/config.json) for this example model.
Also note that all output is written to a `curves` directory by default, but the ouput destination can be specified via the [`outputDir`](https://github.com/usgs/nshmp-haz/wiki/Configuration) parameter. In addition to hazard curves, the calculation configuration and a log of the calculation are also saved.
Also note that all output is written to a `curves` directory by default, but the output destination can be specified via the [`output.directory`](https://github.com/usgs/nshmp-haz/wiki/configuration#config-output) parameter. In addition to hazard curves, the calculation configuration and a log of the calculation are also saved.
In the next example, we'll override the model supplied configuration with a custom file.
......
......@@ -16,6 +16,6 @@ In this example we've overridden the configuration supplied by the model. Specif
* Hazard curves have been calculated for 3 `imts` ([intensity measures](http://usgs.github.io/nshmp-haz/javadoc/index.html?gov/usgs/earthquake/nshmp/gmm/Imt.html), or spectral periods).
* The `imls` (intensity measure levels or x-values) of the resultant curves have been explicitely defined for each `imt`.
See the [configuration specification](https://github.com/usgs/nshmp-haz/wiki/Configuration) for details on default values and supported options and formats.
See the [configuration specification](https://github.com/usgs/nshmp-haz/wiki/configuration) for details on default values and supported options and formats.
#### Next: [Example 3 – Using a custom sites file](../3-sites-file)
......@@ -15,7 +15,7 @@ or
hazard ../../peer/models/Set1-Case1 sites.geojson config.json
```
The [site specification](https://github.com/usgs/nshmp-haz/wiki/Sites) wiki page provides details on the two file formats. Note that with either format, if the name of a site is supplied, it will be included in the first column of any output curve files.
The [site specification](https://github.com/usgs/nshmp-haz/wiki/sites) wiki page provides details on the two file formats. Note that with either format, if the name of a site is supplied, it will be included in the first column of any output curve files.
Note that both formats ([CSV](sites.csv) and [GeoJSON](sites.geojson)) are elegantly rendered by GitHub.
......
......@@ -3,7 +3,7 @@ Example 4: A simple hazard map
__Working directory:__ `/path/to/nshmp-haz/etc/examples/4-hazard-map`
A hazard map is just a collection of values plucked from a lot of hazard curves. To compute curves at reqularly spaced intervals in latitude and longitude over a region, a [GeoJSON site file](https://github.com/usgs/nshmp-haz/wiki/Sites) may instead specify a polygon and a site spacing.
A hazard map is just a collection of values plucked from a lot of hazard curves. To compute curves at reqularly spaced intervals in latitude and longitude over a region, a [GeoJSON site file](https://github.com/usgs/nshmp-haz/wiki/sites#geojson-format-geojson) may instead specify a polygon and a site spacing.
```Shell
hazard ../../peer/models/Set1-Case1 map.geojson config.json
......
......@@ -6,7 +6,7 @@ __Working directory:__ `/path/to/nshmp-haz/etc/examples/5-complex-model`
Most PSHAs involve the use of more complex source models, the components of which might use different ground motion models. For this and ensuing examples, we'll use the 2008 USGS National Seismic Hazard Model (NSHM) for the western U.S. `nshmp-haz` uses an in-memory source model. The USGS NSHMs are quite large, so it's helpful to increase the amount memory available to Java when calling `HazardCalc`. For example, set your alias to:
```Shell
alias hazard='java -Xms1024m -Xmx4096m -cp /path/to/nshmp-haz/build/libs/nshmp-haz.jar gov.usgs.earthquake.nshmp.HazardCalc'
alias hazard='java -Xms1g -Xmx4g -cp /path/to/nshmp-haz/build/libs/nshmp-haz.jar gov.usgs.earthquake.nshmp.HazardCalc'
```
This will increase the minimum amount of memory Java requires to 1GB and will allow it to claim up to 4GB, assuming that much is available.
......
......@@ -6,12 +6,12 @@ __Working directory:__ `/path/to/nshmp-haz/etc/examples/6-enhanced-output`
While mean hazard is of broad interest, it can be useful to preserve individual components of a total curve, particularly with more complex models. Execute the following to write curves for each source type and ground motion model (GMM) used in the 2008 NSHM:
```Shell
hazard ../../../../nshmp-model-cous-2008/Western\ US sites.geojson config.json
hazard ../../../../nshm-cous-2008/Western\ US sites.geojson config.json
```
The [config](https://github.com/usgs/nshmp-haz/blob/master/etc/examples/6-enhanced-output/config.json) file for this example specified `GMM` and `SOURCE` as [output curve types](https://github.com/usgs/nshmp-haz/wiki/Configuration#calculation-configuration-parameters). Note that the output curves directory now contains additional directories of curves by source type and GMM. We also specified an [output flush limit](https://github.com/usgs/nshmp-haz/wiki/Configuration#calculation-configuration-parameters) of `1`. Doing so gives feedback on how long it takes each site calculation to run on a particular system.
The [config](https://github.com/usgs/nshmp-haz/blob/master/etc/examples/6-enhanced-output/config.json) file for this example specified `GMM` and `SOURCE` as [output curve types](https://github.com/usgs/nshmp-haz/wiki/configuration#calculation-configuration-parameters). Note that the output curves directory now contains additional directories of curves by source type and GMM. We also specified an [output flush limit](https://github.com/usgs/nshmp-haz/wiki/configuration#calculation-configuration-parameters) of `1`. Doing so gives feedback on how long it takes each site calculation to run on a particular system.
See the `nshmp-haz` wiki and JavDocs for more information on source types ([Wiki](https://github.com/usgs/nshmp-haz/wiki/Source-Types), [JavaDoc](http://usgs.github.io/nshmp-haz/javadoc/index.html?gov/usgs/earthquake/nshmp/eq/model/SourceType.html)) and GMMs ([Wiki](https://github.com/usgs/nshmp-haz/wiki/Ground-Motion-Models), [JavaDoc](http://usgs.github.io/nshmp-haz/javadoc/index.html?gov/usgs/earthquake/nshmp/gmm/Gmm.html)).
See the `nshmp-haz` wiki and JavDocs for more information on source types ([Wiki](https://github.com/usgs/nshmp-haz/wiki/source-types), [JavaDoc](http://usgs.github.io/nshmp-haz/javadoc/index.html?gov/usgs/earthquake/nshmp/eq/model/SourceType.html)) and GMMs ([Wiki](https://github.com/usgs/nshmp-haz/wiki/ground-motion-models), [JavaDoc](http://usgs.github.io/nshmp-haz/javadoc/index.html?gov/usgs/earthquake/nshmp/gmm/Gmm.html)).
#### Next: [Example 7 – Deaggregation](../7-deaggregation)
......@@ -6,18 +6,18 @@ __Working directory:__ `/path/to/nshmp-haz/etc/examples/7-deaggregation`
To perform a deaggregation of hazard, one must use the program `DeaggCalc`. Internally, `DeaggCalc` calls `HazardCalc` and then reprocesses the data to generate a comma-delimited file of distance, magnitude, and epsilon bins, and a text file of summary statistics and primary contributing sources. For this, it can be helpful to create a second system alias:
```Shell
alias deagg='java -Xms1024m -Xmx4096m -cp /path/to/nshmp-haz/build/libs/nshmp-haz.jar gov.usgs.earthquake.nshmp.DeaggCalc'
alias deagg='java -Xms1g -Xmx4g -cp /path/to/nshmp-haz/build/libs/nshmp-haz.jar gov.usgs.earthquake.nshmp.DeaggCalc'
```
`DeaggCalc` is similar to `HazardCalc` in every way except that the return-period of interest must be specified. For example, execute:
```Shell
deagg ../../../../nshmp-model-cous-2008/Western\ US sites.geojson 2475 config.json
deagg ../../../../nshm-cous-2008/Western\ US sites.geojson 2475 config.json
```
The results of the deaggregation are saved to a `deagg` directory along with hazard curves. As with `HazardCalc`, if `GMM` has been specified (as it has in the [config](https://github.com/usgs/nshmp-haz/blob/master/etc/examples/7-deaggregation/config.json) file for this example) additional deaggregation results for each GMM are generated as well.
See the USGS website for more information on [deaggregation](http://geohazards.usgs.gov/deaggint/2008/documentation.php) and the meaning of [epsilon](http://geohazards.usgs.gov/deaggint/2002/documentation/epsilon.php).
See the following pages for more information on [deaggregation](https://github.com/usgs/nshmp-haz/wiki/about-deaggregation) and the meaning of [epsilon](https://github.com/usgs/nshmp-haz/wiki/what-is-epsilon%3F).
#### Next: [Example 8 – Earthquake probabilities and rates](../8-probabilities)
......@@ -8,19 +8,19 @@ __Working directory:__ `/path/to/nshmp-haz/etc/examples/8-probabilities`
For this example, the following system alias is helpful:
```Shell
alias rate='java -Xms1024m -Xmx4096m -cp /path/to/nshmp-haz/build/libs/nshmp-haz.jar gov.usgs.earthquake.nshmp.RateCalc'
alias rate='java -Xms1g -Xmx4g -cp /path/to/nshmp-haz/build/libs/nshmp-haz.jar gov.usgs.earthquake.nshmp.RateCalc'
```
Assuming a copy of the 2008 USGS NSHM is available (see [Example 5](../5-complex-model)), execute:
```Shell
rate ../../../../nshmp-model-cous-2008/Western\ US sites.csv config-sites.json
rate ../../../../nshm-cous-2008/Western\ US sites.csv config-sites.json
```
to generate incremental, annual-rate output for a list of sites, or
```Shell
rate ../../../../nshmp-model-cous-2008/Western\ US map.geojson config-map.json
rate ../../../../nshm-cous-2008/Western\ US map.geojson config-map.json
```
to generate a map of cumulative Poisson probabilities (i.e. P ≥ M).
......
Using nshmp-haz with Matlab
---------------------------
>**NOTE:** *nshmp-haz* was recently upgraded to Java 8, which supercedes and is incompatable with the Java 7 JVM that ships with Matlab. Users will need to set the `MATLAB_JAVA` environment variable to point to a Java 8 runtime.
All recent versions of Matlab include a Java runtime environment and it is therefore relatively straightforward to use the nshmp-haz library.
#### Requirements
1. Matlab R2013B or higher (nshmp-haz targets Java 7; prior versions of Matlab use Java 6).
2. A [build](https://github.com/usgs/nshmp-haz/wiki/Building-&-Running) of nshmp-haz.
2. A [build](https://github.com/usgs/nshmp-haz/wiki/building-&-running) of nshmp-haz.
......@@ -20,9 +20,9 @@ public class HazMat {
* nshmp-haz is the inclusion of v.15 of Google Guava (this, one can only
* determine by unpacking the included google-collections.jar as they haven't
* bothered to update the name of the dependency) whereas the current Guava
* release is v.20. The aggressive deprecation and removal of bad, unused, or
* release is v.23. The aggressive deprecation and removal of bad, unused, or
* superceeded code by Google has resulted in significant class and method
* variations within Guava over 5 update cycles. Nshmp-haz will not remove
* variations within Guava over 8 update cycles. nshmp-haz will not remove
* it's dependency on Guava, but putting nshmp-haz early on the Matlab
* classpath causes Matlab to crash as it can't find (now missing) methods in
* Guava.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment