-
Notifications
You must be signed in to change notification settings - Fork 0
Stages
The workflow repository contains all the tools necessary to build a workflow for ground motion model simulations. We build and maintain a Cybershake workflow, but researchers may wish to build their own. For this reason, the workflow is build out of composable parts we intend for anyone to reuse to build their own workflow based on the Cybershake workflow. Below you will find documentation for all the workflow stages, their inputs, outputs and environments.
flowchart LR
A[NSHM To Realisation] --> B[SRF Generation]
A --> C[Domain Generation]
B --> D[Stoch Generation]
C --> E[Velocity Model Generation]
C --> F[Station Selection]
C --> G[Write Model Coordinates]
B --> H[Create EMOD3D Parameters]
E --> H
F --> H
G --> H
H --> I[EMOD3D]
D --> J[High Frequency Simulation]
I -->|Optionally| K[Merge Timeslices]
K --> L[Create Simulation Video]
Many of the stages will run in a container. A container is a self-contained execution environment with all the system and Python libraries required to execute workflow stages. It is also isolated from the host system and may not be able to access certain directories. We maintain a cybershake container that has a copy of the latest validated workflow, and environment. Use this container as much as possible in your own scripts to run your code.
Construct a realisation from a rupture in the NSHM 2022.
- A copy of the NSHM 2022 database.
- A rupture id to simulate. You can find a rupture id from the rupture explorer. Alternatively, you can use the visualisation tools to find one.
- The version of the scientific defaults to use. If you don't know what version to use, choose the latest version. Versions are specified as
YY.M.D.R, whereRis the resolution of the simulation (1 = 100m). For example24.2.2.1. The specialdevelopversion is for testing workflow iterations and not to be used for accurate scientific simulation.
A realisation file containing:
- The definition of all the faults in the the rupture,
- A rupture propagation plan (i.e. how the rupture jumps between faults, and where),
- The estimated rupture magnitude and apportionment to the involved faults.
- The definition of the rakes.
Can be run in the cybershake container. Can also be run from your own computer using the nshm2022-to-realisation command which is installed after running pip install workflow@git+https://github.com/ucgmsim/workflow.
nshm2022-to-realisation [OPTIONS] NSHM_DB_FILE RUPTURE_ID REALISATION_FFP DEFAULTS_VERSION
See the output of nshm2022-to-realisation --help or nshm2022_to_realisation.py.
Produce an SRF from a realisation.
A realisation file containing:
- A source configuration,
- A rupture propagation configuration,
- A metadata configuration.
Typically, this information comes from a stage like NSHM To Realisation.
- An SRF file containing the source slip definition for the realisation,
- An updated realisation file containing the parameters used for SRF generation copied from the scientific defaults.
Can be run in the cybershake container. Can also be run from your own computer using the realisation-to-srf command which is installed after running pip install workflow@git+https://github.com/ucgmsim/workflow. If you are executing on your own computer you also need to specify the work directory (with the --work-directory flag), a 1D velocity model (--velocity-model-ffp), and the path to a genslip binary (--genslip-path).
realisation-to-srf [OPTIONS] REALISATION_FFP OUTPUT_SRF_FILEPATH
See the output of realisation-to-srf --help or realisation_to_srf.py
You can visualise the output of this stage using the SRF plotting tools in the source modelling repository. Many of the tools take realisations as optional arguments to enhance the plot output.
Generate Stoch file for HF simulation. This file is just a down-sampled version of the SRF.
A realisation file containing a metadata configuration, and a generated SRF file.
A Stoch file containing a down-sampled version of the SRF.
generate-stoch [OPTIONS] REALISATION_FFP SRF_FFP STOCH_FFP
Can be run in the cybershake container. Can also be run from your own computer using the generate-stoch command which is installed after running pip install workflow@git+https://github.com/ucgmsim/workflow. If you are executing on your own computer you also need to specify the srf2stoch path (--srf2stoch-path).
See the output of generate-stoch --help or generate_stoch.py.
Find a suitable simulation domain, estimating a rupture radius that captures significant ground motion, and the time the simulation should run for to capture this ground motion.
A realisation file containing a metadata configuration, source definitions and rupture propagation information.
A realisation file containing velocity model and domain extent parameters.
Can be run in the cybershake container. Can also be run from your own computer using the generate-velocity-model-parameters command which is installed after running pip install workflow@git+https://github.com/ucgmsim/workflow.
generate-velocity-model-parameters [OPTIONS] REALISATION_FFP
See the output of generate-velocity-model-parameters --help or generate_velocity_model_parameters.py.
Generate a velocity model for a domain.
A realisation file containing:
- Domain parameters,
- Velocity model parameters.
A directory consisting of velocity model files.
Can be run in the cybershake container. Can also be run from your own computer using the generate-velocity-model command which is installed after running pip install workflow@git+https://github.com/ucgmsim/workflow. If you are executing on your own computer you also need to specify the NZVM path (--velocity-model-bin-path) and the work directory (--work-directory).
generate-velocity-model [OPTIONS] REALISATION_FFP VELOCITY_MODEL_OUTPUT
See the output of generate-velocity-model --help or generate_velocity_model.py
Filter a station list for in-domain stations to simulate high frequency and broadband output for.
- A station list and,
- A realisation file containing domain parameters.
- A station list containing only stations in-domain and with unique discretised coordinate positions in two formats:
- Stations in the format "longitude latitude name" format in "stations.ll",
- Stations in the format "x y name" format in "stations.statcord". The x and y are the discretised positions of each station in the domain.
Can be run in the cybershake container. Can also be run from your own computer using the generate-station-coordinates command which is installed after running pip install workflow@git+https://github.com/ucgmsim/workflow. If you do run this on your own computer, you need a version of ll2gp installed.
generate-station-coordinates [OPTIONS] REALISATIONS_FFP OUTPUT_PATH
See the output of generate-station-coordinates --help or generate_station_coordinates.py for more help.
Write out model parameters for EMOD3D.
- A realisation file containing domain parameters.
- A model parameters file describing the location of the domain in latitude, longitude,
- A grid parameters file describing the discretisation of the domain.
Can be run in the cybershake container. Can also be run from your own computer using the generate-model-coordinates command which is installed after running pip install workflow@git+https://github.com/ucgmsim/workflow.
generate-station-coordinates [OPTIONS] REALISATIONS_FFP OUTPUT_PATH
See the output of generate-model-coordinates --help or generate_model_coordinates.py for more help.
Run a low frequency ground motion simulation using EMOD3D.
- A parameter file in "key=value" format,
- An SRF file,
- A station file list (latitude, longitude, and x, y), see .
- Ground acceleration timeslice files, one per core.
- Seismograms, one per station.
This stage must be run on a system with MPI installed. Typically, we run this stage in Maui on NeSI HPCs or Kisti. Due to high computational requirements, this stage usually cannot be run locally.
On an HPC with slurm enabled srun emod3d-mpi_v3.0.8 -args "par=$CYLC_WORKFLOW_SHARE_DIR/LF/e3d.par" will run EMOD3D. Depending on the number of cores rerequested, this may invoke multiple proesses on different compute nodes (for Maui, this will occur when the number of cores exceeds 40). EMOD3D has support for checkpointing, so repeat invocations will continue from their previous checkpointed stage.
See Graves, 1996[^1] for a description of the mathematical and technical details of EMOD3D's implementation.
[^1]: Graves, Robert W. "Simulating seismic wave propagation in 3D elastic media using staggered-grid finite differences." Bulletin of the seismological society of America 86.4 (1996): 1091-1106.
Generate stochastic high frequency ground acceleration data for a number of stations.
- A station list (in the "latitude longitude name" format),
- A 1D velocity model,
- A stoch file,
- A realisation with domain parameters and metadata.
- A combined HF simulation output containing ground acceleration data for each station.
Can be run in the cybershake container. Can also be run from your own computer using the hf-sim command which is installed after running pip install workflow@git+https://github.com/ucgmsim/workflow. If you do run this on your own computer, you need a version of hb_high_binmod installed.
Note
The high-frequency code is very brittle. It is recommended you have both versions 6.0.3 and 5.4.5 built to run with. Sometimes it is necessary to switch between versions if one does not work.
hf-sim [OPTIONS] REALISATION_FFP STOCH_FFP STATION_FILE OUT_FILE
See the output of hf-sim --help or hf_sim.py.
Write parameters for EMOD3D simulation.
- A realisation file containing domain parameters, velocity model parameters, and realisation metadata,
- An SRF file,
- A generated velocity model,
- Station coordinates.
An EMOD3D parameter file containing a mixture of simulations parameters. Parameters source values from the defaults specified the realisation defaults version. The emod3d section of the realisation file overrides default values.
Can be run in the cybershake container. Can also be run from your own computer using the create-e3d-par command which is installed after running pip install workflow@git+https://github.com/ucgmsim/workflow.
create-e3d-par [OPTIONS] REALISATION_FFP SRF_FILE_FFP VELOCITY_MODEL_FFP STATIONS_FFP GRID_FFP OUTPUT_FFP
See the output of create-e3d-par --help or create_e3d_par.py.
See our description of the EMOD3D Parameters for documentation on the EMOD3D parameter file format.
Merge the output timeslice files of EMOD3D.
- A directory containing EMOD3D timeslice files.
- A merged output timeslice file.
Can be run in the cybershake container. Can also be run from your own computer using the merge-ts command which is installed after running pip install workflow@git+https://github.com/ucgmsim/workflow.
merge_ts XYTS_DIRECTORY XYTS_DIRECTORY/output.e3d
See the output of merge-ts --help or merge_ts.py.
Create a simulation video from the low frequency simulation output.
- A merged timeslice file.
- An animation of the low frequency simulation output. See youtube for an example of these videos.
Can be run in the cybershake container. Can also be run from your own computer using the plot-ts command which is installed after running pip install workflow@git+https://github.com/ucgmsim/workflow. If running on your own computer, you need to install gmt and ffmpeg. This stage does not run well on Windows, and is very dependent on the gmt version installed. Hypocentre is already setup to run plot_ts.py without installing anything.
plot-ts [OPTIONS] SRF_FFP XYTS_INPUT_DIRECTORY OUTPUT_FFP
See the output of plot-ts --help or plot_ts.py
Combine high-frequency and low-frequency simulation waveforms for each station into a broadband simulation file.
- A realisation file containing:
- Realisation metadata,
- Domain parameters.
- Station list (latitude, longitude, name),
- Stations VS30 reference values,
- Low frequency waveform directory,
- High frequency output file,
- Velocity model directory.
An output broadband file.
Can be run in the cybershake container. Can also be run from your own computer using the bb-sim command which is installed after running pip install workflow@git+https://github.com/ucgmsim/workflow. If running on your own computer, you need to configure a work directory (--work-directory).
bb-sim REALISATION_FFP STATION_FFP STATION_VS30_FFP LOW_FREQUENCY_WAVEFORM_DIRECTORY HIGH_FREQUENCY_WAVEFORM_FILE VELOCITY_MODEL_DIRECTORY OUTPUT_FFP
See the output of bb-sim --help or bb_sim.py for more help.