From dfd93097e1e8b3b49abc4cef795ca35a2da8ff79 Mon Sep 17 00:00:00 2001 From: Peter Powers <pmpowers@usgs.gov> Date: Wed, 6 Sep 2017 10:01:00 -0600 Subject: [PATCH] gradle doc updates --- README.md | 2 ++ build.gradle | 14 ++++++++++++++ etc/examples/5-complex-model/README.md | 8 ++++---- etc/examples/7-deaggregation/README.md | 2 +- etc/examples/README.md | 2 +- src/gov/usgs/earthquake/nshmp/geo/Location.java | 2 +- 6 files changed, 23 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0048db9d8..47a5ea802 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/build.gradle b/build.gradle index c4726a0f5..7f9232683 100644 --- a/build.gradle +++ b/build.gradle @@ -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' + } + } + } } /* diff --git a/etc/examples/5-complex-model/README.md b/etc/examples/5-complex-model/README.md index 4e7831411..cbe504b32 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/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. diff --git a/etc/examples/7-deaggregation/README.md b/etc/examples/7-deaggregation/README.md index 8f17cab63..67003f740 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/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: diff --git a/etc/examples/README.md b/etc/examples/README.md index 891a52de8..cc02cf895 100644 --- a/etc/examples/README.md +++ b/etc/examples/README.md @@ -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. diff --git a/src/gov/usgs/earthquake/nshmp/geo/Location.java b/src/gov/usgs/earthquake/nshmp/geo/Location.java index 1ef0a8519..296227b81 100644 --- a/src/gov/usgs/earthquake/nshmp/geo/Location.java +++ b/src/gov/usgs/earthquake/nshmp/geo/Location.java @@ -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 */ -- GitLab