Skip to content
Snippets Groups Projects
README.md 3.1 KiB
Newer Older
# Example 7: Disaggregation
__Working directory:__ `/path/to/nshmp-haz/etc/examples/7-disaggregation`
To perform a disaggregation of hazard, one must use the program `DisaggCalc`. Internally,
Powers, Peter M.'s avatar
Powers, Peter M. committed
`DisaggCalc` calls `HazardCalc` and then reprocesses the data to generate output files of
disaggregation summary statistics and primary contributing sources. For this, it can be helpful
to create a second system alias:
alias disagg='java -Xms4g -Xmx8g -cp /path/to/nshmp-haz/build/libs/nshmp-haz.jar gov.usgs.earthquake.nshmp.DisaggCalc'
Note for Windows users: running `nshmp-haz` in command prompt, Power Shell, or GitBash may
result in errors caused by the unicode characters in the disaggregation configuration parameters.
For example: `java.lang.IllegalArgumentException: Invalid ? [0.0]`. To avoid this, try adding
'`-Dfile.encoding="UTF-8"`' before `-cp` in the disagg alias shown above. This error does not
seem to occur if `nshmp-haz` is built and run in the Windows Subsystem for Linux (WSL).

Powers, Peter M.'s avatar
Powers, Peter M. committed
The command line arguments for `DisaggCalc` are the same as those for `HazardCalc`. The target
return period for a disaggregation is specified in the config
[`disagg.returnPeriod`](../../../docs/pages/Calculation-Configuration.md#calculation-configuration-parameters)
field. To compute the disaggregation in this example (use NSHM CONUS v5.2.0), execute:
Powers, Peter M.'s avatar
Powers, Peter M. committed
disagg ../../../../nshm-conus sites.csv config.json
Powers, Peter M.'s avatar
Powers, Peter M. committed
The results of the disaggregation are saved alongside hazard curves in a `disagg` directory.
Disaggregation results are stored in JSON format with one file for each site. The results for
each IMT are stored within that file as well. As with `HazardCalc`, if the `GMM` data type has
been specified (as it has in the
[config](../../../docs/pages/Calculation-Configuration.md#calculation-configuration)
file for this example) additional disaggregation results for each GMM are generated as well.
Disaggregations by individual `SOURCE` type are also possible.
Powers, Peter M.'s avatar
Powers, Peter M. committed
Note that `DisaggCalc` will only process a CSV file of sites (not GeoJSON).

__Results directory structure:__
Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed

```text
Powers, Peter M.'s avatar
Powers, Peter M. committed
      ├─ calc-config.json
Powers, Peter M.'s avatar
Powers, Peter M. committed
      ├─ disagg/Los Angeles CA.json
      │   ├─ Los Angeles CA.json
      │   ├─ Salt Lake City UT.json
      │   ├─ San Francisco CA.json
      │   └─ Seattle WA.json
      │   ├─ curves-truncated.csv
      │   ├─ curves.csv
      │   └─ gmm/
      │       ├─ AM_09_INTERFACE_BASIN/
Powers, Peter M.'s avatar
Powers, Peter M. committed
      │       │   └─ curves.csv
Powers, Peter M.'s avatar
Powers, Peter M. committed
      │       └─ ZHAO_06_SLAB_BASIN/
      │           └─ curves.csv
Note that in the output above, there are only disaggregation results for subduction GMMs
(e.g. `AM_09_INTERFACE_BASIN`) for sites closer to the Cascadia subduction zone; empty results
will not be saved.
Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed

<!-- markdownlint-disable MD001 -->
<!--  #### Next: [Example 8 – Earthquake probabilities and rates](../8-probabilities/README.md) -->
Clayton, Brandon Scott's avatar
Clayton, Brandon Scott committed
* [__Documentation Index__](../../../docs/README.md)