djura.record_selection

GCIM-based ground motion record selection.

GCIM selector

class djura.record_selection.gcim.GCIM(data=None, conditional=None, records=None, dis_oq=None, poe_for_selection=None)[source]

Bases: object

default_data: dict = {'add_data_for_dis': None, 'avg-sa': None, 'component-definition': 'RotD50', 'context_limits': {'EQ_name': None, 'Rjb': None, 'Rrup': None, 'magnitude': None, 'mechanism': None, 'soil_Vs30': None}, 'gmms': None, 'greedy-loops': 1, 'im-star': None, 'im_weights': [], 'imi': ['SA(0.05s)', 'SA(0.075s)', 'SA(0.1s)', 'SA(0.15s)', 'SA(0.2s)', 'SA(0.25s)', 'SA(0.3s)', 'SA(0.4s)', 'SA(0.5s)', 'SA(0.75s)', 'SA(1.0s)', 'SA(1.3s)', 'SA(1.5s)', 'SA(2.0s)'], 'ks_alpha': 0.05, 'max_scaling_factor': 3.0, 'nreplicate': 1, 'num-components': 2, 'num_records': 40, 'ruptures': None, 'seed': 0, 'total-weights': None}
create(data=None)[source]

Creates the target GCIM distribution (conditional or unconditional)

Notes

https://docs.openquake.org/oq-engine/master/openquake.hazardlib.gsim.html in order to check required input parameters for the ground motion models, e.g. rupture parameters (rup_param), site parameters (site_param), distance parameters (dist_param). Rupture parameters ‘fhw’, ‘azimuth’, ‘upper_sd’ and ‘lower_sd’ are used to derive some gmm parameters in accordance with Kaklamanos et al. 2011 within ConditionalSpectrum._set_contexts method. They are not required by any gmm.

References

Bradley, B.A. (2010). A generalized conditional intensity measure approach and holistic ground-motion selection. Earthquake Engineering & Structural Dynamics, 39. DOI: 10.1002/eqe.995

Bradley, B.A. (2012). A ground motion selection algorithm based on the generalized conditional intensity measure approach. Soil Dynamics and Earthquake Engineering, 40, 48-61. https://doi.org/10.1016/j.soildyn.2012.04.007

Lin, T., Harmsen, S. C., Baker, J. W., & Luco, N. (2013). Conditional Spectrum Computation Incorporating Multiple Causal Earthquakes and Ground-Motion Prediction Models. In Bulletin of the Seismological Society of America (Vol. 103, Issue 2A, pp. 1103-1116). https://doi.org/10.1785/0120110293

Tarbali, K., & Bradley, B.A. (2015). Ground motion selection for scenario ruptures using the generalised conditional intensity measure (GCIM) method. Earthquake Engineering & Structural Dynamics, 44, 1601 - 1621. DOI: 10.1002/eqe.2546

Baker, J.W., & Lee, C.B. (2018). An Improved Algorithm for Selecting Ground Motions to Match a Conditional Spectrum. Journal of Earthquake Engineering, 22, 708 - 723. DOI:10.1080/13632469.2016.1264334

Parameters:
  • data (**Optional parameters of**) – File containing information on input arguments Required, if ‘data’ was not provided for GCIM object Overrides global ‘self.data’, by default None

  • data

  • ruptures (List[dict]) –

    Rupture scenarios with hazard context parameters and GMM associations. Example:

    [
        {"mag": float, "weight": Optional[float],
                       "gmms": Optional[ID]},
        {"mag": 5,     "weight": Optional[float],
                       "gmms": Optional[ID]},
    ]
    

    mag is one example context parameter; weight is the rupture weight (sum must be 1.0). If omitted, provide total-weights under the gmms key instead.

  • gmms (List[dict]) –

    Ground motion models associated with each IM type. The weights are optional; if omitted, provide total weights under the weights sub-key of each ruptures entry. Example:

    [
        {"ID": Optional[int],
         im1: {"names": List[str],
               "weights": Optional[List],
               "total-weights": Optional[List]},
         im2: {...}},
        {"ID": Optional[int], ...}
    ]
    

    If ID is not provided it is inferred from the list index. The sum of weights (and of total-weights) must be 1.0 per IM type. total-weights = gmms.weights × ruptures.weights

  • parameters** (**Optional context)

  • vs30 (float) – Average shear-wave velocity of the site, [m/s]

  • mag (float) – Magnitude of the earthquake (required by all gmm)

  • rjb (float) – Closest distance to surface projection of coseismic rupture [km]

  • parameters**

  • vs30measured (bool) – vs30 type, True (measured) or False (inferred)

  • z1pt0 (float) – Depth to Vs=1 km/sec from the site

  • z2pt5 (float) – Depth to Vs=2.5 km/sec from the site, in [km]

  • rake (float) – Fault rake

  • dip (float) – Fault dip

  • width (float) – Fault width

  • hypo_depth (float) – Hypocentral depth of the rupture, [km]

  • ztor (float) – Depth to top of coseismic rupture [km]

  • fhw (int) – Hanging-wall factor, 1 for site on down-dip side of top of rupture; 0 otherwise

  • azimuth (float) – Source-to-site azimuth, alternative of hanging wall factor

  • upper_sd (float) – Upper seismogenic depth

  • lower_sd (float) – Lower seismogenic depth

  • rrup (float) – Closest distance to coseismic rupture [km]

  • repi (float) – Epicentral distance [km]

  • rhypo (float) – Hypocentral distance [km]

  • rx (float) – Horizontal distance from top of rupture measured perpendicular to fault strike [km]

  • ry0 (float) – The horizontal distance off the end of the rupture measured parallel to strike [km]

  • z_tor (float) – Depth to the top of the rupture plane, by default 1

  • data

  • num-components (int, optional) – 1 for single-component selection and arbitrary component sigma. 2 for two-component selection and average component sigma, by default 2

  • component-definition (str, optional) – The spectra definition, ‘GeoMean’, ‘RotD50’, ‘RotD100’. Necessary if num-components = 2, by default ‘RotD50’

  • imi (List[str], optional) –

    IMis to be used for GCIM distribution creation. Default:

    ['SA(0.05s)', 'SA(0.075s)', 'SA(0.1s)', 'SA(0.15s)',
     'SA(0.2s)', 'SA(0.25s)', 'SA(0.3s)', 'SA(0.4s)',
     'SA(0.5s)', 'SA(0.75s)', 'SA(1.0s)', 'SA(1.3s)',
     'SA(1.5s)', 'SA(2.0s)']
    

  • only) (**Required parameters of** data (conditional GCIM)

  • im-star (dict) –

    Conditioning IM descriptor. Keys: type (IM type, e.g. 'SA'), value (conditioning level), period (conditioning period in seconds; not required for period-independent IMs). Example:

    {"type": str, "value": float, "period": Optional[float]}
    

    If None, the target is an unconditional spectrum; If not None, target is conditional spectrum unless overriden by self.conditional parameter;

Return type:

dict

Returns:

  • dict – Dictionary containing the GCIM distribution and key meta information, the keys are described as follows

  • ’im-star’ (dict) – Conditional IM descriptors, same as input “im-star”

  • ’target’ (dict) – Target multivariate GCIM distribution. Keys:

    • mu_lnIMi: mean for all rupture scenarios and GMMs

    • sigma_lnIMi: stdv for all rupture scenarios and GMMs

    • cov_lnIMi: covariance matrix for all rupture scenarios and GMMs

    • IMi: ground motion intensity measures (IMs)

    • correlations: correlation matrices between all IMi types

  • ’data’ (dict) – Extra information during intermediate calculations mu_lnIMi_rup, sigma_lnIMi_rup, cov_lnIMi_rup, mu_lnIMj_rup, sigma_lnIMj_rup, epsilon_lnIMj_rup, mu_lnIMi_lnIMj_rup, sigma_lnIMi_lnIMj_rup, cov_lnIMi_lnIMj_rup, case_weights

select(data=None, output_create=None)[source]

Perform the ground motion selection

Parameters:
  • data (**Parameters of**) – File containing information on input arguments, Required, if ‘data’ was not provided for GCIM object Overrides global ‘self.data’, by default None

  • output_create (Union[Path, str, dict]) – Outputs of ‘create’ method Required if run with no previous run of ‘create’ by default None

  • data

  • nrun (int, optional) – Number of separate runs, by default 1

  • nreplicate (int, optional) – Number of replicates, by default 1 The algorithm is repeated for nreplicate times

  • num_records (int, optional) – Number of ground motions to be selected, by default 40

  • seed (int, optional) – For repeatability. For a particular seed not equal to zero, the code will output the same set of ground motions. The set will change when the ‘seed’ value changes. If set to zero, the code randomizes the algorithm and different sets of ground motions (satisfying the target mean and variance) are generated each time, by default 0

  • ks_alpha (float, optional) – Kolmogorov-Smirnov test significance level, by default 0.05

  • im_weights (List[float], optional) – Weights of IMs, must match the number of items under self.data.imi by default 1.0 for each IM type

  • context_limits (dict, optional) –

    Limiting values on context parameters; keys must be present in the metadata. By default None. Example:

    {"magnitude": [6, 7]}  # events of magnitude 6–7 only
    

  • max_scaling_factor (float, optional) – Maximum scaling factor allowed, by default 1, i.e. no scaling allowed

Returns:

Selected record information

Return type:

dict

get_all_scenarios()[source]
get_supported_rupture_parameters()[source]

Gets supported rupture parameters

Returns:

Names of rupture parameters supported

Return type:

frozenset

get_supported_sites_parameters()[source]

Gets supported sites parameters

Returns:

Names of sites parameters supported

Return type:

frozenset

get_supported_distances_parameters()[source]

Gets supported distances parameters

Returns:

Names of distances parameters supported

Return type:

dict

get_supported_ims()[source]
Return type:

dict

get_metadata_parameters()[source]
Return type:

set

available_correlation_models()[source]
Return type:

dict

get_supported_im_component_types()[source]
Return type:

dict

get_available_gsims()[source]
check_gmpe_attributes(gmpe)[source]
get_gmpe_parameters(gmpe)[source]
get_causal_pars_db()[source]

Response spectrum

class djura.record_selection.gm_to_rs.ResponseSpectrumFromGM(damping, output_format='dict')[source]

Bases: object

periods = array([0.  , 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1 ,        0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.2 , 0.21,        0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.3 , 0.31, 0.32,        0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.4 , 0.41, 0.42, 0.43,        0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.5 , 0.51, 0.52, 0.53, 0.54,        0.55, 0.56, 0.57, 0.58, 0.59, 0.6 , 0.61, 0.62, 0.63, 0.64, 0.65,        0.66, 0.67, 0.68, 0.69, 0.7 , 0.71, 0.72, 0.73, 0.74, 0.75, 0.76,        0.77, 0.78, 0.79, 0.8 , 0.81, 0.82, 0.83, 0.84, 0.85, 0.86, 0.87,        0.88, 0.89, 0.9 , 0.91, 0.92, 0.93, 0.94, 0.95, 0.96, 0.97, 0.98,        0.99, 1.  , 1.01, 1.02, 1.03, 1.04, 1.05, 1.06, 1.07, 1.08, 1.09,        1.1 , 1.11, 1.12, 1.13, 1.14, 1.15, 1.16, 1.17, 1.18, 1.19, 1.2 ,        1.21, 1.22, 1.23, 1.24, 1.25, 1.26, 1.27, 1.28, 1.29, 1.3 , 1.31,        1.32, 1.33, 1.34, 1.35, 1.36, 1.37, 1.38, 1.39, 1.4 , 1.41, 1.42,        1.43, 1.44, 1.45, 1.46, 1.47, 1.48, 1.49, 1.5 , 1.51, 1.52, 1.53,        1.54, 1.55, 1.56, 1.57, 1.58, 1.59, 1.6 , 1.61, 1.62, 1.63, 1.64,        1.65, 1.66, 1.67, 1.68, 1.69, 1.7 , 1.71, 1.72, 1.73, 1.74, 1.75,        1.76, 1.77, 1.78, 1.79, 1.8 , 1.81, 1.82, 1.83, 1.84, 1.85, 1.86,        1.87, 1.88, 1.89, 1.9 , 1.91, 1.92, 1.93, 1.94, 1.95, 1.96, 1.97,        1.98, 1.99, 2.  , 2.01, 2.02, 2.03, 2.04, 2.05, 2.06, 2.07, 2.08,        2.09, 2.1 , 2.11, 2.12, 2.13, 2.14, 2.15, 2.16, 2.17, 2.18, 2.19,        2.2 , 2.21, 2.22, 2.23, 2.24, 2.25, 2.26, 2.27, 2.28, 2.29, 2.3 ,        2.31, 2.32, 2.33, 2.34, 2.35, 2.36, 2.37, 2.38, 2.39, 2.4 , 2.41,        2.42, 2.43, 2.44, 2.45, 2.46, 2.47, 2.48, 2.49, 2.5 , 2.51, 2.52,        2.53, 2.54, 2.55, 2.56, 2.57, 2.58, 2.59, 2.6 , 2.61, 2.62, 2.63,        2.64, 2.65, 2.66, 2.67, 2.68, 2.69, 2.7 , 2.71, 2.72, 2.73, 2.74,        2.75, 2.76, 2.77, 2.78, 2.79, 2.8 , 2.81, 2.82, 2.83, 2.84, 2.85,        2.86, 2.87, 2.88, 2.89, 2.9 , 2.91, 2.92, 2.93, 2.94, 2.95, 2.96,        2.97, 2.98, 2.99, 3.  , 3.01, 3.02, 3.03, 3.04, 3.05, 3.06, 3.07,        3.08, 3.09, 3.1 , 3.11, 3.12, 3.13, 3.14, 3.15, 3.16, 3.17, 3.18,        3.19, 3.2 , 3.21, 3.22, 3.23, 3.24, 3.25, 3.26, 3.27, 3.28, 3.29,        3.3 , 3.31, 3.32, 3.33, 3.34, 3.35, 3.36, 3.37, 3.38, 3.39, 3.4 ,        3.41, 3.42, 3.43, 3.44, 3.45, 3.46, 3.47, 3.48, 3.49, 3.5 , 3.51,        3.52, 3.53, 3.54, 3.55, 3.56, 3.57, 3.58, 3.59, 3.6 , 3.61, 3.62,        3.63, 3.64, 3.65, 3.66, 3.67, 3.68, 3.69, 3.7 , 3.71, 3.72, 3.73,        3.74, 3.75, 3.76, 3.77, 3.78, 3.79, 3.8 , 3.81, 3.82, 3.83, 3.84,        3.85, 3.86, 3.87, 3.88, 3.89, 3.9 , 3.91, 3.92, 3.93, 3.94, 3.95,        3.96, 3.97, 3.98, 3.99, 4.  ])
derive_response_spectrum_batch(gm_dir_path, dt_filepath, gm_filepath, periods=None)[source]

Derives response spectrum for 1 or more ground motion records and stores into self.rs

Parameters:
  • gm_dir_path (Path) – Path to the folder containing ground motion files

  • dt_filepath (Path) – Path to a file containing time steps of each ground motion of interest

  • gm_filepath (Union[Path, List[Path]]) – Path to a file containing filenames of each ground motion of interest

  • periods (List) – Periods used to compute the accelerations, if left None, uses a range between 0 and 4 seconds

Return type:

None

derive_response_spectrum(accelerations, dt, periods=None)[source]

Derives response spectrum for a single acceleration time history

Parameters:
  • accelerations (List) – Accelerations time history

  • dt (float) – Time step

  • periods (List) – Periods used to compute the accelerations, if left None, uses a range between 0 and 4 seconds

Returns:

Periods in [s] Spectral accelerations, Union[List, float]

Return type:

tuple[List, any]

Intensity measures

class djura.record_selection.intensity_measure.IntensityMeasure[source]

Bases: object

g = 9.81
get_sat(period, acc, dt, damping)[source]

Get the pseudo spectral acceleration (Sa(period, damping)) of a ground motion

Parameters:
  • period (Union[float, array]) – Period of interest, where the Sa(T) is being calculated in [s]

  • acc (List[float]) – Acceleration time series in [g]

  • dt (float) – Time step in [s], if period==0.0, may be set to any value

  • damping (float) – Damping ratio, if period==0.0, may be set to any value

Returns:

Sa(period, damping) in [g], if T=0, Sa = PGA

Return type:

Union[float, array]

get_sdt(acc, dt, period, damping)[source]

Get the pseudo spectral displacement (Sd(period, damping)) of a ground motion

Parameters:
  • acc (List[float]) – Acceleration time series in [g]

  • dt (float) – Time step in [s], if period==0.0, may be set to any value

  • period (float) – Period of interest, where the Sd(T) is being calculated in [s]

  • damping (float) – Damping ratio, if period==0.0, may be set to any value

Returns:

Sd(period, damping) in [m], if T=0, Sd = PGD

Return type:

float

get_svt(acc, dt, period, damping)[source]

Get the pseudo spectral velocity (Sv(period, damping)) of a ground motion

Parameters:
  • acc (List[float]) – Acceleration time series in [g]

  • dt (float) – Time step in [s], if period==0.0, may be set to any value

  • period (float) – Period of interest, where the Sv(T) is being calculated in [s]

  • damping (float) – Damping ratio, if period==0.0, may be set to any value

Returns:

Sv(period, damping) in [m/s], if T=0, Sv = PGV

Return type:

float

get_pga(acc)[source]

Get the peak ground acceleration (PGA)

Parameters:

acc (List[float]) – Acceleration time series in [g]

Returns:

PGA in [g]

Return type:

float

get_pgv(acc, dt)[source]

Get peak ground velocity (PGV) in [m/s]

Parameters:
  • acc (List[float]) – Acceleration time series in [g]

  • dt (float) – Time step in [s]

Returns:

PGV in [m/s]

Return type:

float

get_pgd(acc, dt)[source]

Get peak ground displacement (PGD) in [m]

Parameters:
  • acc (List[float]) – Acceleration time series in [g]

  • dt (float) – Time step in [s]

Returns:

PGD in [m]

Return type:

float

get_sa_avg(acc, dt, period, damping, bounds, size=10)[source]

Get average pseudo spectral acceleration (Sa_avg) with the selected bounds

Parameters:
  • acc (List[float]) – Acceleration time series in [g]

  • dt (float) – Time step in [s]

  • period (float) – Period of interest, where the Sa_avg is being calculated in [s]

  • damping (float) – Damping ratio

  • bounds (List[float]) – Bounds for the period, e.g. [0.2, 1.5], where lower period will be 0.2*period, upper period bound will be 1.5*period

  • size (int) – Number of uniformly spaced periods considered within the range of periods (bounds), by default 10

Returns:

Average pseudo-spectral acceleration (Sa_avg)

Return type:

float

sat2(acc, dt, period, damping, osc_type='psa', max_freq_ratio=5.0)[source]
get_fiv3(acc, dt, tn, alpha=0.7, beta=0.85)[source]

Get the filtered incremental velocity IM for a ground motion

References

Dávalos H, Miranda E. Filtered incremental velocity: A novel approach in intensity measures for seismic collapse estimation. Earthquake Engineering & Structural Dynamics 2019; 48(12): 1384-1405. DOI: 10.1002/eqe.3205.

Parameters:
  • acc (List[float]) – Acceleration time history in [g]

  • dt (float) – Time step in [s]

  • tn (float) – Period in [s]

  • alpha (float) – Period factor, by default 0.7

  • beta (float) – Cut-off frequency factor, by default 0.85

Returns:

  • float – Intensity measure FIV3 (as per Eq. (3) of Davalos and Miranda (2019)) in [m/s]

  • ndarray – 1D array - Filtered incremental velocity (as per Eq. (2) of Davalos and Miranda (2019)) in [m/s]

  • ndarray – 1D array - Time series of FIV in [m/s]

  • ndarray – 1D array - Filtered acceleration time history in [g]

  • ndarray – 1D array - Three peak values used to compute FIV3

  • ndarray – 1D array - Three trough values used to compute FIV3

get_sa_rot_d_xx(acc1, acc2, dt, period, damping, percentiles=None, num_theta=180)[source]

Get the RotDxx IM of a ground motion signal pair

References

Boore DM. Orientation-independent, nongeometric-mean measures of seismic intensity from two horizontal components of motion. Bulletin of the Seismological Society of America 2010; 100(4): 1830-1835. DOI: 10.1785/0120090400.

Parameters:
  • acc1 (List[float]) – Acceleration time series in [g] in direction 1

  • acc2 (List[float]) – Acceleration time series in [g] in direction 2

  • dt (float) – Time step in [s]

  • period (float) – Period of interest in [s]

  • damping (float) – Damping ratio

  • percentiles (List[float]) – Percentile to calculate, by default [16., 50., 84.]

  • num_theta (int) – Number of rotations to consider between 0 and 180°, by default 180

Returns:

RotDxx values for given percentiles in [g]

Return type:

List[float]

get_arias_intensity(acc, dt)[source]

Get Arias Intensity (Ia) in [m/s]

Parameters:
  • acc (List[float]) – Acceleration time series in [g]

  • dt (float) – Time step in [s]

Returns:

Ia in [m/s]

Return type:

float

get_significant_duration(acc, dt, start=0.05, end=0.95)[source]

Get the significant duration using cumulative acceleration according to Trifunac and Brady (1975).

Parameters:
  • acc (List[float]) – Acceleration time series in [g]

  • dt (float) – Time step in [s]

  • start (float) – Threshold for duration start, by default 0.05

  • end (float) – Threshold for duration end, by default 0.95

Returns:

(duration, start time, end time) in [s]

Return type:

tuple[float, float, float]

get_cav(acc, dt)[source]

Get cumulative absolute velocity (CAV) in [m/s]

Parameters:
  • acc (List[float]) – Acceleration time series in [g]

  • dt (float) – Time step in [s]

Returns:

CAV in [m/s]

Return type:

float

sa_to_sd(sa, period)[source]

Convert to spectral displacement (Sd) from pseudo spectral acceleration (Sa) at a specific period

Parameters:
  • sa (float) – SA in [g]

  • period (float) – Period, T in [s]

Returns:

SD in [m]

Return type:

float

sd_to_sa(sd, period)[source]

Convert to pseudo spectral acceleration (Sa) from spectral displacement (Sd) at a specific period

Parameters:
  • sd (float) – SD in [m]

  • period (float) – Period, T in [s]

Returns:

SA in [g]

Return type:

float

get_ei(acc, dt, period, damping)[source]

Get the input energy (EI(period, damping)) of a ground motion for a particular period

Method

Piecewise linear exact method

References

Aydinoglu M.N. and Y.M. Fahjan, 2003. A unified formulation of the piecewise exact method for inelastic seismic demand analysis including the P-delta effect

param acc:

Acceleration time series in [g]

type acc:

List[float]

param dt:

Time step in [s], if period==0.0, may be set to any value

type dt:

float

param period:

Period of interest, where the EI(T) is being calculated in [s]

type period:

float

param damping:

Damping ratio, if period==0.0, may be set to any value

type damping:

float

returns:

EI(period, damping) in [m2/s2]

rtype:

float

NGA-West2 interface

class djura.record_selection.nga_west2.NGAWest2(metadata, verbosity=0)[source]

Bases: object

get_metadata_keys(get_meta=False)[source]
add_missing_im(im_name, period)[source]
add_missing_sa(period)[source]
add_missing_sa_avg(period)[source]
add_missing_fiv3(period)[source]
get_im(im_type, period, acc, dt, damping, bounds, size)[source]

Correlation models

djura.record_selection.correlation_models.baker_jayaram(period1, period2, d1=0.366, d2=0.105, d3=0.0099, d4=0.109, d5=0.2)[source]

SA vs SA Valid for T = 0.01-10sec

References

Baker JW, Jayaram N. Correlation of Spectral Acceleration Values from NGA Ground Motion Models. Earthquake Spectra 2008; 24(1): 299-317. DOI: 10.1193/1.2857544.

Parameters:
  • period1 (float) – First period

  • period2 (float) – Second period

Returns:

Predicted correlation coefficient

Return type:

float

djura.record_selection.correlation_models.akkar(period1, period2)[source]

SA vs SA Valid for T = 0.01-4sec

References

Akkar S., Sandikkaya MA., Ay BO., 2014, Compatible ground-motion prediction equations for damping scaling factors and vertical to horizontal spectral amplitude ratios for the broader Europe region, Bull Earthquake Eng, 12, pp. 517-547.

Parameters:
  • period1 (float) – First period

  • period2 (float) – Second period

Returns:

Predicted correlation coefficient

Return type:

float

djura.record_selection.correlation_models.bradley2011_ds()[source]

Duration 575 vs Duration 595

References

Bradley B.A. (2011). Correlation of significant duration with amplitude and cumulative intensity measures and its use in ground motion selection, Journal of Earthquake Engineering, 15(6): 809-832. DOI: 10.1080/13632469.2011.557140Correlation

Returns:

Correlation value

Return type:

float

djura.record_selection.correlation_models.bradley2011_ds595_sa(period=None)[source]

Duration 595 vs SA correlation

Lowest period is 0.01! Highest period is 10!

References

Bradley B.A. (2011). Correlation of significant duration with amplitude and cumulative intensity measures and its use in ground motion selection, Journal of Earthquake Engineering, 15(6): 809-832. DOI: 10.1080/13632469.2011.557140Correlation

Parameters:

period (float) – Period of interest, by default None (for PGA)

Returns:

Correlation value

Return type:

float

djura.record_selection.correlation_models.bradley2011_ds575_sa(period=None)[source]

Duration 575 vs SA correlation

Lowest period is 0.01! Highest period is 10!

References

Bradley B.A. (2011). Correlation of significant duration with amplitude and cumulative intensity measures and its use in ground motion selection, Journal of Earthquake Engineering, 15(6): 809-832. DOI: 10.1080/13632469.2011.557140Correlation

Parameters:

period (float) – Period of interest, by default None (for PGA)

Returns:

Correlation value

Return type:

float

djura.record_selection.correlation_models.bradley2011_ds595_pgv()[source]

Duration 595 vs PGV

References

Bradley B.A. (2011). Correlation of significant duration with amplitude and cumulative intensity measures and its use in ground motion selection, Journal of Earthquake Engineering, 15(6): 809-832. DOI: 10.1080/13632469.2011.557140Correlation

Returns:

Correlation value

Return type:

float

djura.record_selection.correlation_models.bradley2011_ds575_pgv()[source]

Duration 575 vs PGV

References

Bradley B.A. (2011). Correlation of significant duration with amplitude and cumulative intensity measures and its use in ground motion selection, Journal of Earthquake Engineering, 15(6): 809-832. DOI: 10.1080/13632469.2011.557140Correlation

Returns:

Correlation value

Return type:

float

djura.record_selection.correlation_models.bradley2011_pga(period)[source]

PGA vs SA correlation

Lowest period is 0.01! Highest period is 10!

References

Bradley, B.A. (2011). Empirical correlation of PGA, spectral accelerations and spectrum intensities from active shallow crustal earthquakes. Earthquake Engineering & Structural Dynamics, 40. DOI: 10.1002/eqe.1110

Parameters:

period (float) – Period of interest

Returns:

Correlation value

Return type:

float

djura.record_selection.correlation_models.bradley2012_pgv(period=None)[source]

PGV vs SA correlation and PGV vs PGA correlation

For vs SA correlation: Lowest period is 0.01! Highest period is 10!

References

Bradley, B.A. (2012). Empirical Correlations between Peak Ground Velocity and Spectrum-Based Intensity Measures. Earthquake Spectra, 28, 17 - 35. DOI:10.1193/1.3675582

Parameters:

period (float) – Period of interest, by default None (for PGA)

Returns:

Correlation value

Return type:

float

djura.record_selection.correlation_models.dm18(period1, period2)[source]

Sa_avg3 vs Sa_avg3 correlation

For periods between 0.1 and 3 seconds

Parameters:
  • period1 (float) – First period

  • period2 (float) – Second period

References

Héctor Dávalos & Eduardo Miranda (2018): A Ground Motion Prediction Model for Average Spectral Acceleration, Journal of Earthquake Engineering, DOI: 10.1080/13632469.2018.1518278

Returns:

Correlation value

Return type:

float

djura.record_selection.correlation_models.ann_corr(im_pair, period1=None, period2=None)[source]

Correlation matrices predicted through an ANN model

Parameters:
  • im_pair (str) – IMi-IMj pair

  • period1 (float) – Period associated with IMi, by default None

  • period2 (float) – Period associated with IMj, by default None

Returns:

Correlation value

Return type:

float

djura.record_selection.correlation_models.aso2024(im_pair, period1=None, period2=None)[source]

Correlation matrices predicted through an ANN model

Parameters:
  • im_pair (str) – IMi-IMj pair

  • period1 (float) – Period associated with IMi, by default None

  • period2 (float) – Period associated with IMj, by default None

Returns:

Correlation value

Return type:

float

djura.record_selection.correlation_models.eshm20(period1, period2)[source]
djura.record_selection.correlation_models.eshm20_between_event(period1, period2)[source]
djura.record_selection.correlation_models.eshm20_between_site(period1, period2)[source]
djura.record_selection.correlation_models.eshm20_within_event(period1, period2)[source]
djura.record_selection.correlation_models.baker2007_ia_sa(period)[source]

Arias Intensity (IA) vs Spectral acceleration correlation

References

Baker, J.W. (2007). Correlation of ground motion intensity parameters used for predicting structural and geaotehnical response. Applications of Statistics and Probability in Civil Engineering. DOI:10.1017/CBO9780511509759.001

Parameters:

period (float) – Period of interest, by default None (for PGA)

Returns:

Correlation value

Return type:

float

djura.record_selection.correlation_models.bradley2015_ia_sa(period)[source]

Piecewise median correlation between Arias Intensity (IA) vs Spectral acceleration correlation

References

Bradley, B. A. (2015). Correlation of Arias intensity with amplitude, duration and cumulative intensity measures. Soil Dynamics and Earthquake Engineering, 78, 89-98. https://doi.org/10.1016/j.soildyn.2015.07.009

Parameters:

period (float) – Period of interest, by default None (for PGA)

Returns:

Correlation value

Return type:

float

djura.record_selection.correlation_models.bradley2015_ia_pga()[source]

Aris Intensity (IA) vs PGA

References

Bradley, B. A. (2015). Correlation of Arias intensity with amplitude, duration and cumulative intensity measures. Soil Dynamics and Earthquake Engineering, 78, 89-98. https://doi.org/10.1016/j.soildyn.2015.07.009

Returns:

Correlation value

Return type:

float

djura.record_selection.correlation_models.bradley2015_ia_pgv()[source]

Aris Intensity (IA) vs PGV

References

Bradley, B. A. (2015). Correlation of Arias intensity with amplitude, duration and cumulative intensity measures. Soil Dynamics and Earthquake Engineering, 78, 89-98. https://doi.org/10.1016/j.soildyn.2015.07.009

Returns:

Correlation value

Return type:

float

djura.record_selection.correlation_models.bradley2015_ia_ds575()[source]

Aris Intensity (IA) vs Ds575

References

Bradley, B. A. (2015). Correlation of Arias intensity with amplitude, duration and cumulative intensity measures. Soil Dynamics and Earthquake Engineering, 78, 89-98. https://doi.org/10.1016/j.soildyn.2015.07.009

Returns:

Correlation value

Return type:

float

djura.record_selection.correlation_models.bradley2015_ia_ds595()[source]

Aris Intensity (IA) vs Ds595

References

Bradley, B. A. (2015). Correlation of Arias intensity with amplitude, duration and cumulative intensity measures. Soil Dynamics and Earthquake Engineering, 78, 89-98. https://doi.org/10.1016/j.soildyn.2015.07.009

Returns:

Correlation value

Return type:

float

class djura.record_selection.correlations.Correlations[source]

Bases: object

get_correlation(period_i, period_j, correlation_model)[source]

Compute the inter-period correlation for any two Sa(T) values

Parameters:
  • period_i (float) – first period

  • period_j (float) – second period

  • correlation_model (str) – Correlation model name, supported ‘baker_jayaram’, ‘akkar’

Returns:

Predicted correlation coefficient

Return type:

float

Raises:

ValueError – Not a valid correlation function if wront GCIM.corr_func is provided

get_correlation_matrix(periods, model)[source]

Get correlation matrix

Parameters:
  • periods (List) – Periods

  • model (str) – Name of correlation model

Returns:

Correlation matrix

Return type:

np.ndarray

Utilities

djura.record_selection.metrics.hellinger_distance(mu1, sigma1, mu2, sigma2, method='quadrature')[source]

Compute Hellinger distance between two probability distributions

Parameters:
  • mu1 (float) – Parameters of first probability distribution (location and scale of underlying normal)

  • sigma1 (float) – Parameters of first probability distribution (location and scale of underlying normal)

  • mu2 (float) – Parameters of second probability distribution

  • sigma2 (float) – Parameters of second probability distribution

  • method (str) – ‘quadrature’ for numerical interation or ‘sampling’ for discrete approximation ‘closed-form’ for a closed form computation using medians and dispersions by default, ‘quadrature’

Returns:

float

Return type:

Hellinger distance (between 0 and 1)

djura.record_selection.data_reader.read_metadata(metadata)[source]