To maintain compatibility with current workflows while adding additional functionality to the workflow, we intend to change the way perturbed source parameters are passed to the components of the slurm ground motion workflow.

Proposed workflow change

It has been proposed that srf generation will be split into two steps: perturbation and srf generation.

This will split the current two workflow steps (gcmt2srf, nhm2srf) to generate srfs into three (gcmt_to_realisation, nhm_to_realisation, realisation_to_srf).

There will be an intermediary file containing all the parameters to generate the srf, allowing users to manually modify these files if they choose to do so.

This will be able to be integrated into the automated workflow by making each step work on a single realisation, with a multi process wrapper to allow it to also be used as a stand alone step. Unless configured to not progress past file creation the automated workflow step would not allow time for the user to modify the intermediary file.

For each fault with perturbations a mean file is created in that faults Data directory, this can be used to create the Velocity model (Eventually).

Script usage

Currently 4 scripts are available for the new source perturbation workflow. They are:

Brief usage information is available below, more help is available by calling "<script> --help".

If Pre-processing is installed using pip these scripts will be available from the terminal.

gcmt_to_realisation:

Usage: gcmt_to_realisation.py event_name realisation_count gcmt_file type [--version <version>] [--output_dir <directory path>] [--aggregate_file <file path>] [--source_parameter <name> <file path>] [–common_source_parameter <name> <value>] [--vel_mod_1d <file path>] [--vel_mod_1d_out <directory path>]

Arguments:

generate_realisations_from_gcmt:

Usage: generate_realisations_from_gcmt.py fault_selection_file gcmt_file type [--version <version>] [--cybershake_root <directory path>] [--n_processes <int>] [--aggregate_file <file path>] [--source_parameter <name> <filepath>] [–common_source_parameter <name> <value>] [--vel_mod_1d <file path>]

Arguments:

realisation_to_srf:

Usage: realisation_to_srf.py realisation_file

Arguments

generate_srf_from_realisations:

Usage: generate_srf_from_realisations.py [--n_processes <n>] [–cybershake_root <path>]

Arguments:

Creating perturbations

For a given set of perturbations the user will create a perturbation file, the template for which can be found in Pre-processing/srf_generation/source_parameter_generation/uncertainties, and must be placed in the versions folder in that directory.

The version of the perturbation file is the name of the file (without the .py extension).

There are a number of distributions and transformations available in the files common, distribution and mag_scaling.

Currently available distributions

Distribution nameDistribution variableNotes
uniformhalf_rangemean is the median (middle) value, and half_range half the difference between the highest and lowest value.
uniform_relativescale_factorA normal distribution where the highest and lowest possible value are mean* (1+scale_factor) and mean* (1-scale_factor) respectively. Scale factor to be given as a decimal.
weibullk, scale_factor

Does not take a mean value. Equivalent to scale_factor*(-ln((U))1/a where U is the uniform distribution over [0, 1).

truncated_weibulltruncation_threshold, k, scale_factorSame as above, except if the value is greater than the truncation threshold then it is resampled. With default values for dhypo calculation this will occur in 0.005% of cases
truncated_normalstd_dev, std_dev_limitSimilar to normal distribution, except all values fall within [std_dev_limit] standard deviations of the mean. std_dev_limit has a default value of 2.
truncated_log_normalstd_dev, std_dev_limitSimilar to log normal distribution, except all values of the underlying normal distribution fall within [std_dev_limit] standard deviations of the mean. std_dev_limit has a default value of 2. Mean must be given as a string of the form "log(x)" where x is the unmodified value of the mean.

Internal changes

In order to simplify the implementation of this, we have chosen to have every parameter added to the slurm script and passed as an argument to the simulation script, which will then discard any parameters it does not recognize.

Parameters for srf generation

These parameters are available for srf generation. The parameter and its value must be placed in a dictionary mapped to the "params" key of the results dictionary to be used.

This table only shows values that are currently available, as other values become available they will be added

Key:


ParameterType 1Type 2Type 3Type 4
typeR
nameR (Automatically set)
latitudeRR
Obtained from the Type3 subfaults
longitudeRR
Obtained from the Type3 subfaults
depthRR

magnitude

R

mom

O (calculated from mag using mag2mom)




strike

R

R

RObtained from the Type3 subfaults

rake

R

R

R

R

dip

R

R

R

R

vs

O (3.2)




rho

O (2.44)




risetime

O (0.5)




target_area_km

O1




target_slip_cm

O1




stype

O ("cos")2




inittime

O (0.0)




rvfac


O


O

rough


O



slip_cov


O



flen


R

RObtained from the Type3 subfaults

dlen


R



fwid


R

RObtained from the Type3 subfaults

dwid


R



dtop


R

RR

shypo


R

RR

dhypo


R

RR

v_mod_1d_name

Automatically set (From input value or default)
dbottom

RR
tect_type


R
plane_count


R

1) target_area_km and target_slip_cm are used to calculate the area of the fault plane and slip of the fault. target_area_km takes precedence over target_clip_cm, but if neither are given the area and slip are calculated from the moment.

2) Available options are: brune, urs, ucsb, ucsb-T, ucsb2, ucsb-varT1, esg2006, cos, seki, delta.

Parameters for each component

The parameters for each component are as follows:


hfbb
flo
fmin
fmidbot
lfvsref
sim_bin
t-sec
sdrop
rayset
seed
duration
dt
fmax
kappa
qfexp
rvfac
rvfac_shallow
rvfac_deep
czero
calpha
mom
rupv
velocity-model
site-vm-dir
vs-moho
fa_sig1
fa_sig2
rv_sig1
hf_path_dur
dpath_pert