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

        COEFFS = self.COEFFS[imt]
        R = self._compute_term_r(COEFFS, rup.mag, dists.rrup)

        mean = 10 ** (self._compute_mean(COEFFS, rup.mag, R))

        # Convert units to g,
        # but only for PGA and SA (not PGV):
        if isinstance(imt, (PGA, SA)):
            mean = np.log(mean / (g*100.))
        else:
            # PGV:
            mean = np.log(mean)

        c1_rrup = _compute_C1_term(COEFFS, dists.rrup)
        log_phi_ss = 1.00

        stddevs = self._get_stddevs(
            COEFFS, stddev_types, sites.vs30.shape[0], rup.mag, c1_rrup,
            log_phi_ss, COEFFS['mean_phi_ss']
        )

        return mean, stddevs
Exemplo n.º 2
0
    def compute(self, ctx, imts, mean, sig, tau, phi):
        """
        See :meth:`superclass method
        <.base.GroundShakingIntensityModel.compute>`
        for spec of input and result values.
        """
        for m, imt in enumerate(imts):
            COEFFS = self.COEFFS[imt]
            if 'Foreland' in self.__class__.__name__:
                R = _compute_term_d(COEFFS, ctx.mag, ctx.rrup)
            else:
                R = _compute_term_r(COEFFS, ctx.mag, ctx.rrup)

            mean[m] = 10 ** _compute_mean(COEFFS, ctx.mag, R)

            # Convert units to g,
            # but only for PGA and SA (not PGV):
            if imt.string.startswith(("SA", "PGA")):
                mean[m] = np.log(mean[m] / (g*100.))
            else:
                # PGV:
                mean[m] = np.log(mean[m])

            c1_rrup = _compute_C1_term(COEFFS, ctx.rrup)
            log_phi_ss = 1.00

            sig[m], tau[m], phi[m] = _get_stddevs(
                COEFFS, ctx.mag, c1_rrup,
                log_phi_ss, COEFFS['mean_phi_ss'])
Exemplo n.º 3
0
    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        compute mean for Foreland
        """
        COEFFS = self.COEFFS[imt]
        R = self._compute_term_d(COEFFS, rup.mag, dists.rrup)

        mean = 10 ** (self._compute_mean(COEFFS, rup.mag, R))

        # Convert units to g,
        # but only for PGA and SA (not PGV):
        if imt.name in "SA PGA":
            mean = np.log(mean / (g*100.))
        else:
            # PGV:
            mean = np.log(mean)

        c1_rrup = _compute_C1_term(COEFFS, dists.rrup)
        log_phi_ss = 1.00
        stddevs = self._get_stddevs(COEFFS, stddev_types, sites.vs30.shape[0],
                                    rup.mag, c1_rrup, log_phi_ss,
                                    COEFFS['mean_phi_ss'])

        return mean, stddevs
Exemplo n.º 4
0
    def get_mean_and_stddevs(self, sites, rup, dists, imt, stddev_types):
        """
        compute mean for Foreland
        """
        COEFFS = self.COEFFS[imt]
        R = self._compute_term_d(COEFFS, rup.mag, dists.rrup)

        mean = 10**(self._compute_mean(COEFFS, rup.mag, R))

        # Convert units to g,
        # but only for PGA and SA (not PGV):
        if isinstance(imt, (PGA, SA)):
            mean = np.log(mean / (g * 100.))
        else:
            # PGV:
            mean = np.log(mean)

        c1_rrup = _compute_C1_term(COEFFS, dists.rrup)
        log_phi_ss = 1.00
        stddevs = self._get_stddevs(COEFFS, stddev_types, sites.vs30.shape[0],
                                    rup.mag, c1_rrup, log_phi_ss,
                                    COEFFS['mean_phi_ss'])

        return mean, stddevs