From 870d9d8c65c31397bde017d7b52e31d79a8723ad Mon Sep 17 00:00:00 2001 From: Peter Powers <pmpowers@usgs.gov> Date: Thu, 7 Sep 2017 13:07:38 -0600 Subject: [PATCH 1/3] mb to gb in aliases --- etc/examples/5-complex-model/README.md | 2 +- etc/examples/7-deaggregation/README.md | 2 +- etc/examples/8-probabilities/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/etc/examples/5-complex-model/README.md b/etc/examples/5-complex-model/README.md index 0fc76a5a3..850a208ec 100644 --- a/etc/examples/5-complex-model/README.md +++ b/etc/examples/5-complex-model/README.md @@ -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. diff --git a/etc/examples/7-deaggregation/README.md b/etc/examples/7-deaggregation/README.md index 67003f740..c62446530 100644 --- a/etc/examples/7-deaggregation/README.md +++ b/etc/examples/7-deaggregation/README.md @@ -6,7 +6,7 @@ __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: diff --git a/etc/examples/8-probabilities/README.md b/etc/examples/8-probabilities/README.md index d53838f87..d9df13574 100644 --- a/etc/examples/8-probabilities/README.md +++ b/etc/examples/8-probabilities/README.md @@ -8,7 +8,7 @@ __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: -- GitLab From 08b4d9b39471012912566e178028e3660941a4dc Mon Sep 17 00:00:00 2001 From: Peter Powers <pmpowers@usgs.gov> Date: Mon, 18 Sep 2017 11:26:23 -0600 Subject: [PATCH 2/3] example readme edits --- etc/examples/1-hazard-curve/README.md | 4 ++-- etc/examples/2-custom-config/README.md | 2 +- etc/examples/3-sites-file/README.md | 2 +- etc/examples/4-hazard-map/README.md | 2 +- etc/examples/6-enhanced-output/README.md | 6 +++--- etc/examples/7-deaggregation/README.md | 4 ++-- etc/examples/8-probabilities/README.md | 4 ++-- etc/matlab/README.md | 4 +++- src/gov/usgs/earthquake/nshmp/etc/HazMat.java | 4 ++-- 9 files changed, 17 insertions(+), 15 deletions(-) diff --git a/etc/examples/1-hazard-curve/README.md b/etc/examples/1-hazard-curve/README.md index b4a39bc3c..9226bf0b3 100644 --- a/etc/examples/1-hazard-curve/README.md +++ b/etc/examples/1-hazard-curve/README.md @@ -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. diff --git a/etc/examples/2-custom-config/README.md b/etc/examples/2-custom-config/README.md index 2f04de3a6..e508d0b33 100644 --- a/etc/examples/2-custom-config/README.md +++ b/etc/examples/2-custom-config/README.md @@ -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) diff --git a/etc/examples/3-sites-file/README.md b/etc/examples/3-sites-file/README.md index 4e3ee65d1..3b99f5fce 100644 --- a/etc/examples/3-sites-file/README.md +++ b/etc/examples/3-sites-file/README.md @@ -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. diff --git a/etc/examples/4-hazard-map/README.md b/etc/examples/4-hazard-map/README.md index 4a300ff98..c2ce5fb67 100644 --- a/etc/examples/4-hazard-map/README.md +++ b/etc/examples/4-hazard-map/README.md @@ -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 diff --git a/etc/examples/6-enhanced-output/README.md b/etc/examples/6-enhanced-output/README.md index 273713e92..040ccb1c2 100644 --- a/etc/examples/6-enhanced-output/README.md +++ b/etc/examples/6-enhanced-output/README.md @@ -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) diff --git a/etc/examples/7-deaggregation/README.md b/etc/examples/7-deaggregation/README.md index c62446530..554b13c9d 100644 --- a/etc/examples/7-deaggregation/README.md +++ b/etc/examples/7-deaggregation/README.md @@ -12,12 +12,12 @@ alias deagg='java -Xms1g -Xmx4g -cp /path/to/nshmp-haz/build/libs/nshmp-haz.jar `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). #### Next: [Example 8 – Earthquake probabilities and rates](../8-probabilities) diff --git a/etc/examples/8-probabilities/README.md b/etc/examples/8-probabilities/README.md index d9df13574..5ba695c87 100644 --- a/etc/examples/8-probabilities/README.md +++ b/etc/examples/8-probabilities/README.md @@ -14,13 +14,13 @@ alias rate='java -Xms1g -Xmx4g -cp /path/to/nshmp-haz/build/libs/nshmp-haz.jar g 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). diff --git a/etc/matlab/README.md b/etc/matlab/README.md index 56059f480..29abfc54b 100644 --- a/etc/matlab/README.md +++ b/etc/matlab/README.md @@ -1,9 +1,11 @@ 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. diff --git a/src/gov/usgs/earthquake/nshmp/etc/HazMat.java b/src/gov/usgs/earthquake/nshmp/etc/HazMat.java index fd90e2a05..05bdc38fc 100644 --- a/src/gov/usgs/earthquake/nshmp/etc/HazMat.java +++ b/src/gov/usgs/earthquake/nshmp/etc/HazMat.java @@ -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. -- GitLab From af8bed95ba655fe0e666b5a77632f55b61b54841 Mon Sep 17 00:00:00 2001 From: Peter Powers <pmpowers@usgs.gov> Date: Mon, 18 Sep 2017 11:32:04 -0600 Subject: [PATCH 3/3] link fix --- etc/examples/7-deaggregation/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/examples/7-deaggregation/README.md b/etc/examples/7-deaggregation/README.md index 554b13c9d..c2139daf4 100644 --- a/etc/examples/7-deaggregation/README.md +++ b/etc/examples/7-deaggregation/README.md @@ -17,7 +17,7 @@ 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 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). +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) -- GitLab