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

example readme update

parent 8796402a
No related branches found
No related tags found
1 merge request!63Improve outputs 54
##### Hazard Curves
The simplest way to run the HazardCalc program via the command-line is to supply it with a source model; all model initialization and calculation configuration data will be read from the model itself. Navigate to the `/etc` in the repository and run:
```
java -cp ../dist/nshmp-haz.jar org.opensha2.programs.HazardCalc peer/models/Set1-Case1
```
The result of this calculation should be available as a single file containing several hazard curves for PGA in a newly created 'results' directory. 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.
One can override calculation configuration parameters by supplying an alternate configuration file. For example:
```
java -cp ../dist/nshmp-haz.jar org.opensha2.programs.HazardCalc peer/models/Set1-Case1 examples/config-sites.json
```
In this case:
* a truncation will be applied at 3 standard deviations.
* the list of `imts` (intensity measure types, or periods) for which curves will be calculated has been expanded to 3.
* the `imls` (the intensity measure levels or x-values) of the resultant curves, have been explicitely defined for each `imt`.
* two sites have been specified
The 'results' directory should now include 3 files, one for each `imt`.
Examples
--------
1. **Note:** 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/repo/nshmp-haz/dist/nshmp-haz.jar org.opensha2.programs.HazardCalc'
```
2. **Note:** All HazardCalc output is written to the current directory from which the program was called.
One can also supply a comma-delimited site data file, which may be easier to work with in some applications.
```
java -cp ../dist/nshmp-haz.jar org.opensha2.programs.HazardCalc peer/models/Set1-Case1 examples/config-sites.json examples/sites-sf.csv
```
See the site file itself for details on the expected file structure. Under all use cases, if the name of a site is supplied, it will be included in the first column of any result files.
##### Hazard Maps
#### Calculating hazard maps
Hazard maps are generated from numerous uniformely spaced hazard curves. To compute such a curve set, the same program is used, but sites are instead specified as a region.
```
java -cp ../dist/nshmp-haz.jar org.opensha2.programs.HazardCalc peer/models/Set1-Case1 examples/config-region-sf.json
......
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