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

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

gradle doc updates
parents 875847e9 dfd93097
No related branches found
No related tags found
No related merge requests found
......@@ -3,4 +3,6 @@ nshmp-haz
U.S. Geological Survey ([USGS](https://www.usgs.gov)) National Seismic Hazard Mapping Project ([NSHMP](https://earthquake.usgs.gov/hazards/)) code for performing probabilistic seismic hazard (PSHA) and related analyses. These codes are intended for use with models developed by the NSHMP.
**Note:** This project recently adopted the [Gradle](https://gradle.org) build system and underwent a major refactoring. We recommend that previous users of the source code check out a fresh copy and migrate any modifications.
Please see the [wiki](https://github.com/usgs/nshmp-haz/wiki/) for more information.
......@@ -52,6 +52,7 @@ ext {
'(<a href="https://earthquake.usgs.gov/hazards/" target="_top">NSHMP</a>) ' +
'– <a href="https://github.com/usgs/nshmp-haz/blob/master/LICENSE.md" ' +
'target="_top">License</a> | <b>' + gitLink + '</b></div>'
docOut = findProperty('javadoc_loc')
}
test {
......@@ -90,6 +91,19 @@ javadoc {
exclude 'gov/usgs/earthquake/nshmp/etc/**'
exclude 'gov/usgs/earthquake/nshmp/gcim/**'
exclude 'gov/usgs/earthquake/nshmp/internal/**'
doLast {
if (docOut) {
delete docOut
copy {
from 'build/docs/javadoc'
into docOut
}
copy {
from 'etc/resources/docs'
into docOut + '/resources'
}
}
}
}
/*
......
......@@ -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/dist/nshmp-haz.jar gov.usgs.earthquake.nshmp.HazardCalc'
alias hazard='java -Xms1024m -Xmx4096m -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.
......@@ -14,13 +14,13 @@ This will increase the minimum amount of memory Java requires to 1GB and will al
First, clone the 2008 USGS NSHM. Assuming you are in the current working directory (above), the following will create a copy of the model adjacent to nshmp-haz:
```Shell
git clone https://github.com/usgs/nshmp-model-cous-2008.git ../../../../nshmp-model-cous-2008
git clone https://github.com/usgs/nshm-cous-2008.git ../../../../nshmp-model-cous-2008
```
The 2008 NSHM repository contains two source models: one for the western U.S. and a one for the central and eastern U.S. To compute hazard for a few sites in the Western U.S. at 1.0s and 2.0s spectral periods, execute:
```Shell
hazard ../../../../nshmp-model-cous-2008/Western\ US sites.geojson config-sites.json
hazard ../../../../nshm-cous-2008/Western\ US sites.geojson config-sites.json
```
Note that more complex models take longer to initialize, although this only occurs once per calculation, and make for longer, per-site calculations. However, `HazardCalc` will automatically use all cores available by default and therefore performs better on multi-core systems.
......@@ -28,7 +28,7 @@ Note that more complex models take longer to initialize, although this only occu
To compute a small, low-resolution map for the central San Francisco bay area, execute:
```Shell
hazard ../../../../nshmp-model-cous-2008/Western\ US map.geojson config-map.json
hazard ../../../../nshm-cous-2008/Western\ US map.geojson config-map.json
```
This computes 121 curves over a 2° by 2° area and will give you a sense of how long a larger map might take. Note that in the above two examples we specified different output directories in the config files for each calculation.
......
......@@ -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/dist/nshmp-haz.jar gov.usgs.earthquake.nshmp.DeaggCalc'
alias deagg='java -Xms1024m -Xmx4096m -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:
......
......@@ -4,7 +4,7 @@ Examples
These examples are designed to be executed locally while following the READMEs on GitHub. All examples avoid a lengthy call to Java and the `HazardCalc` program by using the following system alias:
```Shell
alias hazard='java -cp /path/to/nshmp-haz/dist/nshmp-haz.jar gov.usgs.earthquake.nshmp.HazardCalc'
alias hazard='java -cp /path/to/nshmp-haz/build/libs/nshmp-haz.jar gov.usgs.earthquake.nshmp.HazardCalc'
```
Because each example builds on prior concepts, it is best step through all the examples, however quickly.
......
......@@ -31,7 +31,7 @@ import gov.usgs.earthquake.nshmp.util.Maths;
*
* <p>For computational convenience, latitude and longitude values are converted
* and stored internally in radians. Special {@code get***Rad()} methods are
* provided to access this native format.
* provided to access this native format.
*
* @author Peter Powers
*/
......
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