kuehn_et_al_fdm package
Submodules
kuehn_et_al_fdm.calc_displ_avg module
This module calculates the median predicted average displacement for a magnitude/style.
- kuehn_et_al_fdm.calc_displ_avg.calc_displ_avg(*, magnitude, style, coefficient_type='median')[source]
Calculate the median predicted average displacement in meters.
- Parameters
magnitude (int or float or numpy.ndarray with a single element) – Earthquake moment magnitude.
style (str) – Style of faulting (case-insensitive). Valid options are ‘strike-slip’, ‘reverse’, or ‘normal’.
coefficient_type (str, optional) – Option to run model using mean or median point estimates of the model coefficients (case- insensitive). Valid options are ‘mean’ or ‘median’. (The ‘full’ option is not enabled for this function.) Default ‘median’.
- Returns
Average displacement in meters.
- Return type
float
- Raises
ValueError – If coefficient_type is not ‘mean’ or ‘median’.
Examples
From command line:
$ kea-displ_avg -m 7 -s normal
kuehn_et_al_fdm.calc_displ_profile module
This module calculates the predicted displacement profile for a magnitude/style/percentile scenario.
- kuehn_et_al_fdm.calc_displ_profile.calc_displ_profile(*, magnitude, style, percentile, coefficient_type='median', folded=True, location_step=0.05)[source]
Calculate the predicted displacement profile in meters.
- Parameters
magnitude (int or float or numpy.ndarray with a single element) – Earthquake moment magnitude.
style (str) – Style of faulting (case-insensitive). Valid options are ‘strike-slip’, ‘reverse’, or ‘normal’.
percentile (int or float or numpy.ndarray with a single element) – Aleatory quantile value. Use -1 for mean.
coefficient_type (str, optional) – Option to run model using mean or median point estimates of the model coefficients (case- insensitive). Valid options are ‘mean’ or ‘median’. (The ‘full’ option is not enabled for this function.) Default ‘median’.
folded (boolean, optional) – Return displacement for the folded location. Default True.
location_step (float, optional) – Profile location step interval. Default 0.05.
- Returns
‘locations’: Normalized location along rupture length.
’displ_meters’: Displacement in meters.
- Return type
tuple
- Raises
ValueError – If coefficient_type is not ‘mean’ or ‘median’.
Examples
From command line:
$ kea-displ_profile -m 6 -s reverse -p 0.5 $ kea-displ_profile -m 6 -s reverse -p -1 -ls 0.01 -ct median --unfolded
kuehn_et_al_fdm.calc_displ_site module
This module calculates the predicted displacement for a magnitude/location/style/percentile scenario. In other words, this module implements the model in a deterministic fault displacement hazard analysis.
- kuehn_et_al_fdm.calc_displ_site.calc_displ_site(*, magnitude, location, style, percentile, coefficient_type='median', folded=True, debug=False, override=False)[source]
Calculate the predicted displacement in meters. If displacement is less than 1 mm (0.001 m), returns zero.
- Parameters
magnitude (int or float or numpy.ndarray with a single element) – Earthquake moment magnitude.
location (int or float or numpy.ndarray with a single element) – Normalized location along rupture length, range [0, 1.0].
style (str) – Style of faulting (case-insensitive). Valid options are ‘strike-slip’, ‘reverse’, or ‘normal’.
percentile (int or float or numpy.ndarray with a single element) – Aleatory quantile value. Use -1 for mean.
coefficient_type (str, optional) – Option to run model using full epistemic uncertainty or with point estimates (mean or median) of the model coefficients (case-insensitive). Valid options are ‘mean’, ‘median’, or ‘full’. Default ‘median’.
folded (boolean, optional) – Return displacement for the folded location. Default True.
debug (boolean, optional) – Option to return DataFrame of internal calculations. Default False.
override (boolean, optional) – Option to override single scenario limitation that is hard-coded. Not recommended for most users. Default False.
- Returns
If debug is False –
- displ_folded_metersnumpy.ndarray
Displacement in meters for the folded location. The array contains a single element.
If debug is True –
- pd.DataFrame
A DataFrame with the following columns:
magnitude: Earthquake moment magnitude.
location: Normalized location along rupture length.
style: Style of faulting.
percentile: The percentile for which the displacement is calculated.
model_id: Model coefficient row number or point estimate definition.
bc_param: Box-Cox transformation parameter (lambda).
mean_site: Mean displacement in transformed units for the site location.
stdv_site: Total standard deviation in transformed units for the site location.
mean_complement: Mean displacement in transformed units for the complementary location.
stdv_complement: Total standard deviation in transformed units for the complementary location.
Y_site: Transformed displacement for the site location.
Y_complement: Transformed displacement for the complementary location.
Y_folded: Transformed displacement for the folded location.
displ_site_meters: Displacement in meters for the site location.
displ_complement_meters: Displacement in meters for the complementary location.
displ_folded_meters: Displacement in meters for the folded location.
- Raises
RuntimeError – If debug is True and override is also True. Debug mode is not available when running multiple scenarios because the dataframe arrays are mismatched.
Examples
From command line:
$ kea-displ_site -m 7 -l 0.25 -s strike-slip -p 0.5 -ct full --debug $ kea-displ_site -m 7 -l 0.25 -s strike-slip -p 0.5 --unfolded
kuehn_et_al_fdm.calc_params module
This module calculates the statistical distribution parameters for forward predition of the model.
kuehn_et_al_fdm.calc_prob_exceed module
This module calculates the probability of exceedance for a magnitude/location/style scenario. In other words, this module implements the conditional probability of exceedance term in the hazard integral in a probabilistic fault displacement hazard analysis.
- kuehn_et_al_fdm.calc_prob_exceed.calc_prob_exceed(*, magnitude, location, style, displacement_array, coefficient_type='median', folded=True, debug=False)[source]
Calculate the probability of exceedance.
- Parameters
magnitude (int or float or numpy.ndarray with a single element) – Earthquake moment magnitude.
location (int or float or numpy.ndarray with a single element) – Normalized location along rupture length, range [0, 1.0].
style (str) – Style of faulting (case-insensitive). Valid options are ‘strike-slip’, ‘reverse’, or ‘normal’.
displacement_array (ArrayLike) – Test values of displacement in meters.
coefficient_type (str, optional) – Option to run model using full epistemic uncertainty or with point estimates (mean or median) of the model coefficients (case-insensitive). Valid options are ‘mean’, ‘median’, or ‘full’. Default ‘median’.
folded (boolean, optional) – Return probability of exceedance for the folded location. Default True.
debug (boolean, optional) – Option to return DataFrame of internal calculations. Default False.
- Returns
If debug is False –
- If coefficient_type is not ‘full’:
- probex_foldednumpy.ndarray, optional
Probability of exceedance for the folded location (if folded is True).
- probex_sitenumpy.ndarray, optional
Probability of exceedance for the site location (if folded is False).
- If coefficient_type is ‘full’:
- pandas.DataFrame
A DataFrame with the following columns:
model_id: Model coefficient row number or point estimate definition.
displ_meters: Test value of displacement in meters.
transformed_displ: Test value of displacement in transformed units.
probex_folded: Probability of exceedance for the folded location (if folded is True).
probex_site: Probability of exceedance for the site location (if folded is False).
If debug is True –
- pandas.DataFrame
A DataFrame with the following columns:
magnitude: Earthquake moment magnitude.
location: Normalized location along rupture length.
style: Style of faulting.
model_id: Model coefficient row number or point estimate definition.
bc_param: Box-Cox transformation parameter (lambda).
mean_site: Mean displacement in transformed units for the site location.
stdv_site: Total standard deviation in transformed units for the site location.
mean_complement: Mean displacement in transformed units for the complementary location.
stdv_complement: Total standard deviation in transformed units for the complementary location.
displ_meters: Test value of displacement in meters.
transformed_displ: Test value of displacement in transformed units.
probex_site: Probability of exceedance for the site location.
probex_complement: Probability of exceedance for the complementary location.
probex_folded: Probability of exceedance for the folded location.
- Raises
ValueError – If coefficient_type is not ‘mean’, ‘median’, or ‘full’.
Examples
From command line:
$ kea-prob_exceed -m 6 -l 0.2 -s reverse -d .01 0.03 0.1 0.3 1 3 10 30 $ kea-prob_exceed -m 6 -l 0.2 -s reverse -d .01 0.03 0.1 0.3 1 3 10 30 --debug
kuehn_et_al_fdm.calc_prob_occur module
This module calculates the probability of occurance for a magnitude/location/style scenario. For example, one can compute the percentile rank of an observation(s) with respect to the model predictions.
- kuehn_et_al_fdm.calc_prob_occur.calc_prob_occur(*, magnitude, location_array, style, displacement_array, coefficient_type='median')[source]
Calculate the percentile rank of observations. Note that the ocation-displacement array pairs should be oriented with the profile peak at location <= 0.5.
- Parameters
magnitude (int or float or numpy.ndarray with a single element) – Earthquake moment magnitude.
location_array (ArrayLike) – Normalized locations along rupture length, range [0, 1.0].
style (str) – Style of faulting (case-insensitive). Valid options are ‘strike-slip’, ‘reverse’, or ‘normal’.
displacement_array (ArrayLike) – Test values of displacement in meters.
coefficient_type (str, optional) – Option to run model using mean or median point estimates of the model coefficients (case- insensitive). Valid options are ‘mean’ or ‘median’. (The ‘full’ option is not enabled for this function.) Default ‘median’.
- Returns
percentile – Percentile rank for the location-displacement pair using the unfolded model (right-skewed).
- Return type
numpy.ndarray
- Raises
ValueError – If location_array and displacement_array do not have the same shape. If coefficient_type is not ‘mean’ or ‘median’.
Examples
From command line:
$ kea-prob_occur -m 6.2 -l 0 0.4 0.5 0.7 0.9 1 -s reverse -d 0.12 0.34 0.6 0.55 0.4 0.1
kuehn_et_al_fdm.load_data module
This module loads the model coefficients.
kuehn_et_al_fdm.prediction_functions module
This module contains various private helper functions used to calculate the model parameters.
kuehn_et_al_fdm.transformation_functions module
This module contains various private helper functions used to calculate the model predictions in transformed units.
kuehn_et_al_fdm.utilities module
This module contains various private helper functions.