Source code for openquake.hazardlib.scalerel.wc1994
# -*- coding: utf-8 -*-# vim: tabstop=4 shiftwidth=4 softtabstop=4## Copyright (C) 2012-2025 GEM Foundation## OpenQuake is free software: you can redistribute it and/or modify it# under the terms of the GNU Affero General Public License as published# by the Free Software Foundation, either version 3 of the License, or# (at your option) any later version.## OpenQuake is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU Affero General Public License for more details.## You should have received a copy of the GNU Affero General Public License# along with OpenQuake. If not, see <http://www.gnu.org/licenses/>."""Module :mod:`openquake.hazardlib.scalerel.wc1994` implements :class:`WC1994`."""frommathimportlog10fromopenquake.hazardlib.scalerel.baseimportBaseMSRSigma,BaseASRSigma
[docs]classWC1994(BaseMSRSigma,BaseASRSigma):""" Wells and Coppersmith magnitude -- rupture area relationships, see 1994, Bull. Seism. Soc. Am., pages 974-2002. Implements both magnitude-area and area-magnitude scaling relationships. """
[docs]defget_median_area(self,mag,rake):""" The values are a function of both magnitude and rake. Setting the rake to ``None`` causes their "All" rupture-types to be applied. """ifrakeisNone:# their "All" casereturn10.0**(-3.49+0.91*mag)elif(-45<=rake<=45)or(rake>=135)or(rake<=-135):# strike slipreturn10.0**(-3.42+0.90*mag)elifrake>0:# thrust/reversereturn10.0**(-3.99+0.98*mag)else:# normalreturn10.0**(-2.87+0.82*mag)
[docs]defget_std_dev_area(self,mag,rake):""" Standard deviation for WC1994. Magnitude is ignored. """ifrakeisNone:# their "All" casereturn0.24elif(-45<=rake<=45)or(rake>=135)or(rake<=-135):# strike slipreturn0.22elifrake>0:# thrust/reversereturn0.26else:# normalreturn0.22
[docs]defget_std_dev_mag(self,area,rake):""" Standard deviation on the magnitude for the WC1994 area relation. """ifrakeisNone:# their "All" casereturn0.24elif(-45<=rake<=45)or(rake>=135)or(rake<=-135):# strike slipreturn0.23elifrake>0:# thrust/reversereturn0.25else:# normalreturn0.25
[docs]defget_median_mag(self,area,rake):""" Return magnitude (Mw) given the area and rake. Setting the rake to ``None`` causes their "All" rupture-types to be applied. :param area: Area in square km. :param rake: Rake angle (the rupture propagation direction) in degrees, from -180 to 180. """ifrakeisNone:# their "All" casereturn4.07+0.98*log10(area)elif(-45<=rake<=45)or(rake>135)or(rake<-135):# strike slipreturn3.98+1.02*log10(area)elifrake>0:# thrust/reversereturn4.33+0.90*log10(area)else:# normalreturn3.93+1.02*log10(area)