See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
496117
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        

        # get mean and std using the superclass
        mean, stddevs = super().get_mean_and_stddevs(
            sites, rup, dists, imt, stddev_types)
        
        A08 = self.A08_COEFFS[imt]
        f_ena = 10.0 ** (A08["c"] + A08["d"] * dists.rjb)

        return np.log(np.exp(mean)*f_ena), stddevs
105398
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        # extracting dictionary of coefficients specific to required
        # intensity measure type.
        C = self.COEFFS_SSLAB[imt]

        # cap magnitude values at 8.0, see page 1709
        mag = rup.mag
        if mag >= 8.0:
            mag = 8.0

        # compute PGA on rock (needed for site amplification calculation)
        G = 10 ** (0.301 - 0.01 * mag)
        pga_rock = self._compute_mean(self.COEFFS_SSLAB[PGA()], G, mag,
                                      rup.hypo_depth, dists.rrup, sites.vs30,
                                      # by passing pga_rock > 500 the soil
                                      # amplification is 0
                                      np.zeros_like(sites.vs30) + 600,
                                      PGA())
        pga_rock = 10 ** (pga_rock)

        # compute actual mean and convert from log10 to ln and units from
        # cm/s**2 to g
        mean = self._compute_mean(C, G, mag, rup.hypo_depth, dists.rrup,
                                  sites.vs30, pga_rock, imt)
        mean = np.log((10 ** mean) * 1e-2 / g)

        if imt.period == 4.0:
            mean /= 0.550

        stddevs = self._get_stddevs(C, stddev_types, sites.vs30.shape[0])

        return mean, stddevs
1021093
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        # get the necessary set of coefficients
        C = self.COEFFS[imt]
        # compute median sa on rock (vs30=1180m/s). Used for site response
        # term calculation
        sa1180 = np.exp(self._get_sa_at_1180(C, imt, sites, rup, dists))

        # get the mean value
        mean = (self._get_basic_term(C, rup, dists) +
                self._get_faulting_style_term(C, rup) +
                self._get_site_response_term(C, imt, sites.vs30, sa1180) +
                self._get_hanging_wall_term(C, dists, rup) +
                self._get_top_of_rupture_depth_term(C, imt, rup) +
                self._get_soil_depth_term(C, sites.z1pt0 / METRES_PER_KM,
                                          sites.vs30)
                )
        mean += self._get_regional_term(C, imt, sites.vs30, dists.rrup)
        # get standard deviations
        stddevs = self._get_stddevs(C, imt, rup, sites, stddev_types, sa1180,
                                    dists)
        return mean, stddevs
669975
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        assert all(stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
                   for stddev_type in stddev_types)

        mean = np.zeros_like(sites.vs30)
        stddevs = [np.zeros_like(sites.vs30) for _ in stddev_types]

        idx_rock = sites.vs30 >= self.ROCK_VS30
        idx_soil = sites.vs30 < self.ROCK_VS30

        if idx_rock.any():
            C = self.COEFFS_ROCK[imt]
            self._compute_mean(C, self.CONSTS['A1_rock'],
                               self.CONSTS['A2_rock'], self.CONSTS['A3_rock'],
                               self.CONSTS['A4_rock'], self.CONSTS['A5_rock'],
                               self.CONSTS['A6_rock'], rup.mag, rup.hypo_depth,
                               dists.rrup, mean, idx_rock)
            self._compute_std(C, rup.mag, stddevs, idx_rock)

            if imt == SA(period=4.0, damping=5.0):
                mean = mean / 0.399

        if idx_soil.any():
            C = self.COEFFS_SOIL[imt]
            self._compute_mean(C, self.CONSTS['A1_soil'],
                               self.CONSTS['A2_soil'], self.CONSTS['A3_soil'],
                               self.CONSTS['A4_soil'], self.CONSTS['A5_soil'],
                               self.CONSTS['A6_soil'], rup.mag, rup.hypo_depth,
                               dists.rrup, mean, idx_soil)
            self._compute_std(C, rup.mag, stddevs, idx_soil)

        return mean, stddevs
662688
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        # extracting dictionary of coefficients (for soil amplification)
        # specific to required intensity measure type
        C_SR = self.COEFFS_SOIL_RESPONSE[imt]

        # compute median PGA on rock (in g), needed to compute non-linear site
        # amplification
        C = self.COEFFS_AC10[PGA()]
        pga4nl = np.exp(
            self._compute_mean(C, rup.mag, dists.rjb, rup.rake)) * 1e-2 / g

        # compute full mean value by adding site amplification terms
        # (but avoiding recomputing mean on rock for PGA)
        if imt == PGA():
            mean = (np.log(pga4nl) +
                    self._get_site_amplification_linear(sites.vs30, C_SR) +
                    self._get_site_amplification_non_linear(sites.vs30, pga4nl,
                                                            C_SR))
        else:
            C = self.COEFFS_AC10[imt]
            mean = (self._compute_mean(C, rup.mag, dists.rjb, rup.rake) +
                    self._get_site_amplification_linear(sites.vs30, C_SR) +
                    self._get_site_amplification_non_linear(sites.vs30, pga4nl,
                                                            C_SR))

        # convert from cm/s**2 to g for SA (PGA is already computed in g)
        if imt.name == "SA":
            mean = np.log(np.exp(mean) * 1e-2 / g)

        stddevs = self._get_stddevs(C, stddev_types, num_sites=len(sites.vs30))

        return mean, stddevs
198065
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        

        # Distance term
        R = np.sqrt(dists.rjb ** 2 + 11.29 ** 2)

        # Magnitude term
        M = rup.mag - 6

        # Site term only distinguishes between lava and ash;
        # since ash sites have Vs30 in the range 60-200m/s,
        # we use this upper value as class separator
        S = np.zeros(R.shape)
        S[sites.vs30 <= 200] = 1

        # Mean ground motion (log10)
        mean = (0.518 + 0.387*M - np.log10(R) - 0.00256*R + 0.335*S)

        # Converting to natural log
        mean /= np.log10(np.e)

        # Check for standard deviation type
        assert all(stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
                   for stddev_type in stddev_types)

        # Constant (total) standard deviation
        stddevs = [0.237/np.log10(np.e) + np.zeros(R.shape)]

        return mean, stddevs
109913
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        # compute median PGA on rock, needed to compute non-linear site
        # amplification
        C_pga = self.COEFFS[PGA()]
        median_pga = np.exp(
            self._compute_mean(C_pga, rup.mag, dists, rup.rake)
        )

        # compute full mean value by adding nonlinear site amplification terms
        C = self.COEFFS[imt]
        mean = (self._compute_mean(C, rup.mag, dists, rup.rake) +
                self._compute_non_linear_term(C, median_pga, sites))

        stddevs = self._get_stddevs(C, stddev_types, num_sites=sites.vs30.size)

        return mean + self.adjustment_factor, stddevs
149274
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        # Check that the GSIM supports the standard deviations requested
        assert all(stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
                   for stddev_type in stddev_types)
        coe = self.COEFFS[imt]
        mean = (self._get_magnitude_scaling(coe, rup.mag) +
                self._get_distance_scaling(coe, dists.rhypo) +
                self._get_azimuth_correction(coe, dists.azimuth))
        # Convert to g
        if imt.name in "SA PGA":
            mean = np.log(np.exp(mean) / (100.0 * g))
        # Compute std
        stddevs = self._compute_std(coe, stddev_types, dists.azimuth.shape)
        return mean, stddevs
56231
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        assert all(stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
                   for stddev_type in stddev_types)

        # Compute SA with primed coeffs and PGA with both unprimed and
        # primed coeffs
        C = self.COEFFS_PRIMED[imt]
        C_PGA = self.COEFFS_PRIMED[PGA()]
        C_PGA_unprimed = self.COEFFS_UNPRIMED[PGA()]

        # Get S term to determine if consider site term is applied
        S = self._get_site_class(sites)
        # Abrahamson and Silva (1997) hanging wall term. This is not used
        # in the latest version of GMPE but is defined in functional form in
        # the paper so we keep it here as a placeholder
        f4HW = self._compute_f4(C, rup.mag, dists.rrup)

        # Flags for rake angles
        CN, CR = self._get_fault_mechanism_flags(rup.rake)

        # Get volcanic path distance which Rvol=0 for current implementation
        # of McVerry2006Asc, but kept here as placeholder for future use
        rvol = self._get_volcanic_path_distance(dists.rrup)

        # Get delta_C and delta_D terms for site class
        delta_C, delta_D = self._get_deltas(sites)
        # Compute lnPGA_ABCD primed
        lnPGAp_ABCD = self._compute_mean(C_PGA, S, rup.mag, dists.rrup, rvol,
                                         rup.hypo_depth, CN, CR, f4HW,
                                         delta_C, delta_D)

        # Compute lnPGA_ABCD unprimed
        lnPGA_ABCD = self._compute_mean(C_PGA_unprimed, S, rup.mag, dists.rrup,
                                        rvol, rup.hypo_depth, CN, CR, f4HW,
                                        delta_C, delta_D)

        # Compute lnSA_ABCD
        lnSAp_ABCD = self._compute_mean(C, S, rup.mag, dists.rrup, rvol,
                                        rup.hypo_depth, CN, CR, f4HW,
                                        delta_C, delta_D)

        # Stage 3: Equation 6 SA_ABCD(T). This is lnSA_ABCD
        # need to calculate final lnSA_ABCD from non-log values but return log
        mean = np.log(np.exp(lnSAp_ABCD) *
                      (np.exp(lnPGA_ABCD) / np.exp(lnPGAp_ABCD)))

        # Compute standard deviations
        C_STD = self.COEFFS_STD[imt]
        stddevs = self._get_stddevs(
            C_STD, rup.mag, stddev_types, sites
        )

        return mean, stddevs
271528
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        mean, stddevs = super().get_mean_and_stddevs(sites, rup, dists, imt,
                                                     stddev_types)
        delta = self._get_delta(imt, rup.mag)
        return mean-delta, stddevs
458361
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        C = self.COEFFS[imt]

        imean = (self._get_magnitude_term(C, rup.mag) +
                 self._get_distance_term(C, dists.rhypo, rup.mag))
        # Convert mean from cm/s and cm/s/s
        if imt.name in "SA PGA":
            mean = np.log((10.0 ** (imean - 2.0)) / g)
        else:
            mean = np.log(10.0 ** imean)
        stddevs = self._get_stddevs(C, len(dists.rhypo), stddev_types)
        return mean, stddevs
93906
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        # Check that the requested standard deviation type is available
        assert all(stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
                   for stddev_type in stddev_types)
        #
        # Set parameters
        magn = rup.mag
        epi = dists.repi
        theta = dists.azimuth
        #
        # Convert Mw into Ms
        if magn < 6.58:
            mag = (magn - 0.59) / 0.86
        else:
            mag = (magn + 2.42) / 1.28
        #
        # Set coefficients
        coeff = self.COEFFS[imt]
        a1ca, a1cb, a1cc, a1cd, a1ce, a2ca, a2cb, a2cc, a2cd, a2ce = \
            gc(coeff, mag)
        #
        # Get correction coefficients. Here for each site we find the
        # the geometry of the ellipses
        ras = []
        for epi, theta in zip(dists.repi, dists.azimuth):
            res = get_ras(epi, theta, mag, coeff)
            ras.append(res)
        ras = np.array(ras)
        rbs = rbf(ras, coeff, mag)
        #
        # Compute values of ground motion for the two cases. The value of
        # 225 is hardcoded under the assumption that the hypocentral depth
        # corresponds to 15 km (i.e. 15**2)
        mean1 = (a1ca + a1cb * mag +
                 a1cc * np.log((ras**2+225)**0.5 +
                               a1cd * np.exp(a1ce * mag)))
        mean2 = (a2ca + a2cb * mag +
                 a2cc * np.log((rbs**2+225)**0.5 +
                               a2cd * np.exp(a2ce * mag)))
        #
        # Get distances
        x = (mean1 * np.sin(np.radians(dists.azimuth)))**2
        y = (mean2 * np.cos(np.radians(dists.azimuth)))**2
        mean = mean1 * mean2 / np.sqrt(x+y)
        if imt.name == "PGA":
            mean = np.exp(mean)/g/100
        elif imt.name == "PGV":
            mean = np.exp(mean)
        else:
            raise ValueError('Unsupported IMT')
        #
        # Get the standard deviation
        stddevs = self._compute_std(coeff, stddev_types, len(dists.repi))
        #
        # Return results
        return np.log(mean), stddevs
169274
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        # extracting dictionary of coefficients specific to required
        # intensity measure type.
        C = self.COEFFS[imt]
        C_SR = self.COEFFS_SOIL_RESPONSE[imt]

        # compute PGA on rock conditions - needed to compute non-linear
        # site amplification term
        pga4nl = self._get_pga_on_rock(rup, dists, C)

        # equation 1, pag 106, without sigma term, that is only the first 3
        # terms. The third term (site amplification) is computed as given in
        # equation (6), that is the sum of a linear term - equation (7) - and
        # a non-linear one - equations (8a) to (8c).
        # Mref, Rref values are given in the caption to table 6, pag 119.
        if imt == PGA():
            # avoid recomputing PGA on rock, just add site terms
            mean = np.log(pga4nl) + \
                self._get_site_amplification_linear(sites.vs30, C_SR) + \
                self._get_site_amplification_non_linear(sites.vs30, pga4nl,
                                                        C_SR)
        else:
            mean = self._compute_magnitude_scaling(rup, C) + \
                self._compute_distance_scaling(rup, dists, C) + \
                self._get_site_amplification_linear(sites.vs30, C_SR) + \
                self._get_site_amplification_non_linear(sites.vs30, pga4nl,
                                                        C_SR)

        stddevs = self._get_stddevs(C, stddev_types, num_sites=len(sites.vs30))

        return mean, stddevs
461994
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        mean = self._get_mean(sites, rup, dists, imt, stddev_types)
        stddevs = [np.ones(len(dists.rrup))*get_sigma(imt)]
        return mean, stddevs
1194566
def _get_stddevs(self, C, stddev_types, num_sites):
        
        assert all(stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
                   for stddev_type in stddev_types)

        # Using a frequency independent value of sigma as recommended
        # in the caption of Table 2 of Atkinson (2010)
        stddevs = [0.26/np.log10(np.e) + np.zeros(num_sites)]

        return stddevs
110424
def _get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types, 
        mag_conversion_sigma=0.0):
        
        # extract dictionaries of coefficients specific to required
        # intensity measure type
        C = self.COEFFS[imt]

        # clip distance at 4 km, minimum distance for which the equation is
        # valid (see section 2.2.4, page 201). This also avoids singularity
        # in the equation
        rhypo = dists.rhypo
        rhypo[rhypo < 4.] = 4.

        mean = C['a'] * rup.mag + C['b'] * rhypo - np.log10(rhypo)

        mean[sites.vs30 >= 800] += C['c1']
        mean[sites.vs30 < 800] += C['c2']

        # convert from log10 to ln, and from cm/s2 to g
        mean = mean * np.log(10) - 2 * np.log(10) - np.log(g)

        stddevs = self._get_stddevs(C, stddev_types, rhypo.shape[0], 
            mag_conversion_sigma=mag_conversion_sigma)

        return mean, stddevs
579703
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        # extracting dictionary of coefficients specific to required
        # intensity measure type.

        C = self.COEFFS[imt]

        mean = (self._get_magnitude_term(C, rup.mag) +
                self._get_distance_term(C, dists.rjb, rup.mag) +
                self._get_site_term(C, sites.vs30))

        # Units of GMPE are in terms of m/s (corrected in an Erratum)
        # Convert to g
        if imt.name in "SA PGA":
            mean = np.log(np.exp(mean) / g)
        else:
            # For PGV convert from m/s to cm/s/s
            mean = np.log(np.exp(mean) * 100.)

        # Get standard deviations
        stddevs = self._get_stddevs(C, stddev_types, dists.rjb.shape)
        return mean, stddevs