See :meth:`superclass method
        <.base.GroundShakingIntensityModel.get_mean_and_stddevs>`
        for spec of input and result values.
960310
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]
        imean = (self._compute_magnitude(rup, C) +
                 self._compute_distance(rup, dists, C) +
                 self._get_site_amplification(sites, C) +
                 self._compute_forearc_backarc_term(C, sites, dists, rup))

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

        # Convert units to g,
        # but only for PGA and SA (not PGV):
        if imt.name in "SA PGA":
            mean = np.log((10.0 ** (imean - 2.0)) / g)
        else:
            # PGV:
            mean = np.log(10.0 ** imean)
        # Return stddevs in terms of natural log scaling
        stddevs = np.log(10.0 ** np.array(istddevs))
        # mean_LogNaturale = np.log((10 ** mean) * 1e-2 / g)
        return mean, 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
1043306
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_SITE = self.SITE_COEFFS[imt]
        s_c, idx = self._get_site_classification(sites.vs30)
        sa_rock = (self.get_magnitude_scaling_term(C, rup) +
                   self.get_sof_term(C, rup) +
                   self.get_depth_term(C, rup) +
                   self.get_distance_term(C, dists, rup))

        sa_soil = self.add_site_amplification(C, C_SITE, sites,
                                              sa_rock, idx, rup)

        stddevs = self.get_stddevs(C, sites.vs30.shape, idx, stddev_types)
        return sa_soil, stddevs
1343512
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        C = self.COEFFS[imt]
        mean = (
            self._get_magnitude_term(C, rup.mag) +
            self._get_distance_term(C, rup.mag, dists.rrup) +
            self._get_style_of_faulting_term(C, rup.rake) +
            self._get_site_response_term(C, sites.vs30))

        stddevs = self._get_stddevs(C, stddev_types, len(sites.vs30))
        return mean, stddevs
492095
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        # extract dictionaries of coefficients specific to required
        # intensity measure type and for PGA
        C = self.COEFFS[imt]
        C_PGA = self.COEFFS[PGA()]

        # Get mean and standard deviation of PGA on rock (Vs30 1100 m/s^2)
        pga1100 = np.exp(self.get_mean_values(C_PGA, sites, rup, dists, None))
        # Get mean and standard deviations for IMT
        mean = self.get_mean_values(C, sites, rup, dists, pga1100)
        if imt.name == "SA" and imt.period <= 0.25:
            # According to Campbell & Bozorgnia (2013) [NGA West 2 Report]
            # If Sa (T) < PGA for T < 0.25 then set mean Sa(T) to mean PGA
            # Get PGA on soil
            pga = self.get_mean_values(C_PGA, sites, rup, dists, pga1100)
            idx = mean <= pga
            mean[idx] = pga[idx]
        # Get standard deviations
        stddevs = self._get_stddevs(C,
                                    C_PGA,
                                    rup,
                                    sites,
                                    pga1100,
                                    stddev_types)
        return mean, stddevs
1150491
def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        
        # fix hypocentral depth to 20 km. Create new rupture context to avoid
        # changing the original one
        new_rup = copy.deepcopy(rup)
        new_rup.hypo_depth = 20.

        mean, stddevs = super().get_mean_and_stddevs(
            sites, new_rup, dists, imt, stddev_types)

        return mean, stddevs
1240999
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)

        F, HW = self._get_fault_type_hanging_wall(rup.rake)
        S = self._get_site_class(sites.vs30)

        # compute pga on rock (used then to compute site amplification factor)
        C = self.COEFFS[PGA()]
        pga_rock = np.exp(
            self._compute_mean_on_rock(C, rup.mag, dists.rrup, F, HW)
        )

        # compute mean for the given imt (do not repeat the calculation if
        # imt is PGA, just add the site amplification term)
        if imt == PGA():
            mean = np.log(pga_rock) + S * self._compute_f5(C, pga_rock)
        else:
            C = self.COEFFS[imt]
            mean = (
                self._compute_mean_on_rock(C, rup.mag, dists.rrup, F, HW) +
                S * self._compute_f5(C, pga_rock)
            )

        C_STD = self.COEFFS_STD[imt]
        stddevs = self._get_stddevs(
            C_STD, rup.mag, stddev_types, sites.vs30.size
        )

        return mean, stddevs
446669
def _get_stddevs(self, C, stddev_types, rup, imt, num_sites):
        
        stddevs = []
        for stddev_type in stddev_types:
            sigma_mean = self._compute_standard_dev(rup, imt, C)
            sigma_tot = np.sqrt((sigma_mean ** 2) + (C['SigmaReg'] ** 2))
            sigma_tot = np.log10(np.exp(sigma_tot))
            stddevs.append(sigma_tot + np.zeros(num_sites))
        return stddevs
1197548
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)
        # Defining frequency
        if imt == PGA():
            freq = 50.0
        elif imt == PGV():
            freq = 2.0
        else:
            freq = 1./imt.period

        # Equation 3 of Atkinson (2010)
        x1 = np.min([-0.18+0.17*np.log10(freq), 0])

        # Equation 4 a-b-c of Atkinson (2010)
        if rup.hypo_depth < 20.0:
            x0 = np.max([0.217-0.321*np.log10(freq), 0])
        elif rup.hypo_depth > 35.0:
            x0 = np.min([0.263+0.0924*np.log10(freq), 0.35])
        else:
            x0 = 0.2

        # Limiting calculation distance to 1km
        # (as suggested by C. Bruce Worden)
        rjb = [d if d > 1 else 1 for d in dists.rjb]

        # Equation 2 and 5 of Atkinson (2010)
        mean += (x0 + x1*np.log10(rjb))/np.log10(np.e)

        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
1319664
def get_mean_and_stddevs(self, sctx, rctx, dctx, imt, stddev_types):
        
        # Get original mean and standard deviations
        mean, stddevs = super().get_mean_and_stddevs(
            sctx, rctx, dctx, imt, stddev_types)
        # Return mean, increased by the adjustment factor,
        # and standard devation
        return mean + nga_west2_epistemic_adjustment(rctx.mag, dctx.rrup),\
            stddevs
1271674
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.rrup, sites.backarc) +
                 self._get_site_term(C, sites.vs30) +
                 self._get_scaling_term(C, dists.rrup))
        # Convert mean from cm/s and cm/s/s and from common logarithm to
        # natural logarithm
        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.rrup), stddev_types)
        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
1025464
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, rup.mag, dists.rhypo, rup.hypo_depth, mean,
                               idx_rock)
            self._compute_std(C, stddevs, idx_rock)

        if idx_soil.any():
            C = self.COEFFS_SOIL[imt]
            self._compute_mean(C, rup.mag, dists.rhypo, rup.hypo_depth, mean,
                               idx_soil)
            self._compute_std(C, stddevs, idx_soil)

        return mean, stddevs
1246578
def _get_stddevs(self, C, imt, rup, sites, stddev_types, sa1180, dists):
        
        std_intra = self._get_intra_event_std(C, rup.mag, sa1180, sites.vs30,
                                              sites.vs30measured, dists.rrup)
        std_inter = self._get_inter_event_std(C, rup.mag, sa1180, sites.vs30)
        stddevs = []
        for stddev_type in stddev_types:
            assert stddev_type in self.DEFINED_FOR_STANDARD_DEVIATION_TYPES
            if stddev_type == const.StdDev.TOTAL:
                stddevs.append(np.sqrt(std_intra ** 2 +
                                       std_inter ** 2))
            elif stddev_type == const.StdDev.INTRA_EVENT:
                stddevs.append(std_intra)
            elif stddev_type == const.StdDev.INTER_EVENT:
                stddevs.append(std_inter)
        return stddevs
248038
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]
        if isinstance(imt, PGA):
            imt_per = 0.0
        else:
            imt_per = imt.period
        # Fix site parameters for consistent dS2S application.
        sites.vs30 = np.array([250])
        sites.z1pt0 = np.array([330])
        # intensity on a reference soil is used for both mean
        # and stddev calculations.
        ln_y_ref = self._get_ln_y_ref(rup, dists, C)
        # exp1 and exp2 are parts of eq. 7
        exp1 = np.exp(C['phi3'] * (sites.vs30.clip(-np.inf, 1130) - 360))
        exp2 = np.exp(C['phi3'] * (1130 - 360))
        # v1 is the period dependent site term. The Vs30 above which, the
        # amplification is constant
        v1 = self._get_v1(imt)
        # Get log-mean from regular unadjusted model
        b13a_mean = self._get_mean(sites, C, ln_y_ref, exp1, exp2, v1)
        # Adjust mean and standard deviation
        mean = b13a_mean + self._get_dL2L(imt_per) + self._get_dS2S(imt_per)
        mean += convert_to_LHC(imt)
        stddevs = self._get_adjusted_stddevs(sites, rup, C, stddev_types,
                                             ln_y_ref, exp1, exp2, imt_per)

        return mean, stddevs
714720
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)

        C = self.COEFFS[imt]
        mean = (self._get_magnitude_scaling(C, rup.mag) +
                self._get_distance_scaling(C, rup.mag, dists.rhypo))
        if imt.name in "SA PGA":
            mean = np.log(np.exp(mean) / (100.0 * g))
        stddevs = self._compute_std(C, stddev_types, len(dists.rhypo))
        return mean, stddevs