Skip to content

Commit

Permalink
gradle doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pmpowers-usgs committed Sep 6, 2017
1 parent 875847e commit dfd9309
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
14 changes: 14 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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'
}
}
}
}

/*
Expand Down
8 changes: 4 additions & 4 deletions etc/examples/5-complex-model/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ __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.

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.

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.
Expand Down
2 changes: 1 addition & 1 deletion etc/examples/7-deaggregation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion etc/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/gov/usgs/earthquake/nshmp/geo/Location.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*
* <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
*/
Expand Down

0 comments on commit dfd9309

Please sign in to comment.