Esempio n. 1
0
def _get_phi(ergodic, PHI_SS, PHI_S2SS, phi_ss_quantile, phi_model, imt, mag):
    """
    Returns the within-event standard deviation (phi)
    """
    phi = get_phi_ss(imt, mag, PHI_SS)
    # check if phi adjustment (2.6.6) is needed
    # -> if phi < 0.4 in middle branch and T is below 0.5 s
    # -> preserve separation between high and low phi values
    if imt.period < 0.5 and phi_ss_quantile == 0.5:
        phi = max(phi, 0.4)

    elif imt.period < 0.5 and phi_ss_quantile != 0.5:
        # compute phi at quantile 0.5 and take the maximum comp to 0.4
        PHI_SS_0p5 = get_phi_ss_at_quantile_ACME(
                                    PHI_SETUP[phi_model], 0.5)
        phi_0p5 = get_phi_ss(imt, mag, PHI_SS_0p5)

        # make adjustment if needed
        phi = 0.4 + phi - phi_0p5 if phi_0p5 < 0.4 else phi

    if ergodic:
        C = PHI_S2SS[imt]
        phi = np.sqrt(phi ** 2. + C["phi_s2ss"] ** 2.)

    return phi
Esempio n. 2
0
 def _get_phi(self, imt, mag):
     """
     Returns the within-event standard deviation (phi)
     """
     phi = get_phi_ss(imt, mag, self.PHI_SS)
     if self.ergodic:
         C = self.PHI_S2SS[imt]
         phi = np.sqrt(phi**2. + C["phi_s2ss"]**2.)
     return phi
Esempio n. 3
0
 def _get_phi(self, imt, mag, sites, num_sites):
     """
     Returns the within-event standard deviation (phi). If the ergodic
     model is chosen the "global" phi_s2s model of Stewart et al. (2019)
     is used.
     """
     phi = get_phi_ss(imt, mag, self.PHI_SS)
     if self.ergodic:
         phi_s2s = get_stewart_2019_phis2s(imt, sites.vs30)
         phi = np.sqrt(phi**2. + phi_s2s**2.)
     return phi
Esempio n. 4
0
 def _get_phi(self, imt, mag, num_sites):
     """
     Returns the within-event standard deviation (phi). If the ergodic
     model is chosen the "global" phi_s2s model of Stewart et al. (2019)
     is used.
     """
     phi = get_phi_ss(imt, mag, self.PHI_SS)
     if self.ergodic:
         phi_s2s = get_phi_s2s(
             imt, self.DEFINED_FOR_REFERENCE_VELOCITY + np.zeros(num_sites))
         phi = np.sqrt(phi**2. + phi_s2s**2.)
     return phi
Esempio n. 5
0
def get_stddevs(ergodic, tau_model, TAU, PHI_SS, imt, ctx):
    """
    Returns the standard deviations for either the ergodic or
    non-ergodic models
    """
    phi = get_phi_ss(imt, ctx.mag, PHI_SS)
    if ergodic:
        phi_s2s = get_stewart_2019_phis2s(imt, ctx.vs30)
        phi = np.sqrt(phi**2. + phi_s2s**2.)
    tau = TAU_EXECUTION[tau_model](imt, ctx.mag, TAU)
    sigma = np.sqrt(tau**2. + phi**2.)
    return [sigma, tau, phi]