CyberShake Hazard Calculation

From SCECpedia
Revision as of 22:37, 7 March 2016 by Kmilner (talk | contribs)
Jump to navigationJump to search

CyberShake Hazard Curve/Disaggregation Calculation

Common Setup

The tools mentioned below are part of the OpenSHA platform (http://www.opensha.org). The easiest way to obtain the code needed for these tools is to download the complete OpenSHA jar file nightly build from here:

OpenSHA_complete.jar nightly build

You can also obtain the source code directly and compile it yourself, either via an ant build script or via eclipse. For details on this approach, see http://opensha.usc.edu/trac/wiki/SettingUpEclipse

Examples here will assume that you are using the jar file approach.

Running OpenSHA on the command line

Assuming that OpenSHA_complete.jar is in the current directory, the following command can be used to run the fictional java class org.opensha.Test:

java -cp OpenSHA_complete.jar org.opensha.Test

If you would like to specify an alternative CyberShake database host and/or table name, specify the cybershake.db.host and or cybershake.db.name property. For example:

java -Dcybershake.db.host="my.server.come" -Dcybershake.db.name="CyberShake" -cp OpenSHA_complete.jar org.opensha.Test

Hazard Curve Calculation

Hazard curve calculation/plotting is done via the org.opensha.sha.cybershake.plot.HazardCurvePlotter OpenSHA class. Here is the usage:

kevin@steel:/tmp$ java -cp OpenSHA_complete.jar org.opensha.sha.cybershake.plot.HazardCurvePlotter --help
usage: HazardCurvePlotter [-?] [-af <arg>] [-benchmark] [-c] [-cmp <arg>]
       [-comp <arg>] [-cvmvs] [-e <arg>] [-ef <arg>] [-f] [-fvs <arg>] [-h
       <arg>] [-imid <arg>] [-imt <arg>] [-n] [-novm] [-o <arg>] [-p
       <arg>] [-pf <arg>] [-pl <arg>] [-R <arg>] [-r <arg>] [-s <arg>]
       [-sgt <arg>] [-sgtsym] [-t <arg>] [-v <arg>] [-vel <arg>] [-w
       <arg>]
 -?,--help                            Display this message
 -af,--atten-rel-file <arg>           XML Attenuation Relationship description file(s) for comparison. Multiple files should be comma separated
 -benchmark,--benchmark-test-recalc   Forces recalculation of hazard curves to test calculation speed. Newly recalculated curves are not kept and the original curves are plotted.
 -c,--calc-only                       Only calculate and insert the CyberShake curves, don't make plots. If a curve already exists, it will be skipped.
 -cmp,--component <arg>               Intensity measure component. Options: GEOM,X,Y,RotD100,RotD50, Default: GEOM
 -comp,--compare-to <arg>             Compare to  aspecific Run ID (or multiple IDs, comma separated)
 -cvmvs,--cvm-vs30                    Option to use Vs30 value from the velocity model itself in GMPE calculations rather than, for example, the Wills 2006 value.
 -e,--erf-id <arg>                    ERF ID
 -ef,--erf-file <arg>                 XML ERF description file for comparison
 -f,--force-add                       Flag to add curves to db without prompt
 -fvs,--force-vs30 <arg>              Option to force the given Vs30 value to be used in GMPE calculations.
 -h,--height <arg>                    Plot height (default = 500)
 -imid,--im-type-id <arg>             Intensity measure type ID. If not supplied, will be detected from im type/component/period parameters
 -imt,--im-type <arg>                 Intensity measure type. Options: SA, Default: SA
 -n,--no-add                          Flag to not automatically calculate curves not in the database
 -novm,--no-vm-colors                 Disables Velocity Model coloring
 -o,--output-dir <arg>                Output directory
 -p,--period <arg>                    Period(s) to calculate. Multiple periods should be comma separated (default: 3)
 -pf,--password-file <arg>            Path to a file that contains the username and password for inserting curves into the database. Format should be "user:pass"
 -pl,--plot-chars-file <arg>          Specify the path to a plot characteristics XML file
 -R,--run-id <arg>                    Run ID
 -r,--rv-id <arg>                     Rupture Variation ID
 -s,--site <arg>                      Site short name
 -sgt,--sgt-var-id <arg>              STG Variation ID
 -sgtsym,--sgt-colors                 Enables SGT specific symbols
 -t,--type <arg>                      Plot save type. Options are png, pdf, jpg, and txt. Multiple types can be comma separated (default is pdf)
 -v,--vs30 <arg>                      Specify default Vs30 for sites with no Vs30 data, or leave blank for default value. Otherwise, you will be prompted to enter vs30 interactively if needed.
 -vel,--vel-model-id <arg>            Velocity Model ID
 -w,--width <arg>                     Plot width (default = 600)

Many arguments are optional but the important ones are as follows:

  • --run-id: This argument supplies the CyberShake Run_ID, identifying a unique run of the CyberShake platform. This is the best way to specify a CyberShake dataset of interest, but you can also supply a combination of the --site, --sgt-var-id, --rv-id, and --vel-model-id options to dynamically search for
--run-id 4498
--erf-file /home/kevin/workspace/OpenSHA/src/org/opensha/sha/cybershake/conf/MeanUCERF.xml
--atten-rel-file /home/kevin/workspace/OpenSHA/src/org/opensha/sha/cybershake/conf/cb2008.xml,/home/kevin/workspace/OpenSHA/src/org/opensha/sha/cybershake/conf/ba2008.xml,/home/kevin/workspace/OpenSHA/src/org/opensha/sha/cybershake/conf/cy2008.xml,/home/kevin/workspace/OpenSHA/src/org/opensha/sha/cybershake/conf/as2008.xml
--period 2,3,4,5,7.5,10,1,0.5,0.2,0.1
--output-dir /tmp/test_curves
--type pdf,png
--no-add
--benchmark-test-recalc
--cmp RotD50