Source code for openquake.hazardlib.scalerel.leonard2014
# -*- 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.leonard2014` implements:class:`Leonard2014_SCR`:class:`Leonard2014_Interplate`"""fromnumpyimportpower,log10fromopenquake.hazardlib.scalerel.baseimportBaseMSRSigma,BaseASRSigma
[docs]classLeonard2014_SCR(BaseMSRSigma,BaseASRSigma):""" Leonard, M., 2014. Self-consistent earthquake fault-scaling relations: Update and extension to stable continental strike-slip faults. Bulletin of the Seismological Society of America, 104(6), pp 2953-2965. Implements both magnitude-area and area-magnitude scaling relationships. """
[docs]defget_median_area(self,mag,rake):""" Calculates median fault area from magnitude. """ifrakeisNone:# Return average of strike-slip and dip-slip curvesreturnpower(10.0,(mag-4.185))elif(-45<=rake<=45)or(rake>=135)or(rake<=-135):# strike-slipreturnpower(10.0,(mag-4.18))else:# Dip-slip (thrust or normal), and undefined rakereturnpower(10.0,(mag-4.19))
[docs]defget_std_dev_area(self,mag,rake):""" Returns zero for now """return0.0
[docs]defget_median_mag(self,area,rake):""" Returns magnitude for a given fault area """ifrakeisNone:# Return average of strike-slip and dip-slip curvesreturnlog10(area)+4.185elif(-45<=rake<=45)or(rake>=135)or(rake<=-135):# strike slipreturnlog10(area)+4.18else:# Dip slip (thrust or normal), and undefined rakereturnlog10(area)+4.19
[docs]defget_std_dev_mag(self,area,rake):""" Returns zero for now """return0.0
[docs]classLeonard2014_Interplate(BaseMSRSigma,BaseASRSigma):""" Leonard, M., 2014. Self-consistent earthquake fault-scaling relations: Update and extension to stable continental strike-slip faults. Bulletin of the Seismological Society of America, 104(6), pp 2953-2965. Implements both magnitude-area and area-magnitude scaling relationships. """
[docs]defget_median_area(self,mag,rake):""" Calculates median fault area from magnitude. """ifrakeisNone:# Return average of strike-slip and dip-slip curvesreturnpower(10.0,(mag-3.995))elif(-45<=rake<=45)or(rake>=135)or(rake<=-135):# strike slipreturnpower(10.0,(mag-3.99))else:# Dip slip (thrust or normal), and undefined rakereturnpower(10.0,(mag-4.00))
[docs]defget_std_dev_area(self,mag,rake):""" Returns zero for now """return0.0
[docs]defget_median_mag(self,area,rake):""" Calculates median magnitude from fault area. """ifrakeisNone:# Return average of strike-slip and dip-slip curvesreturnlog10(area)+3.995elif(-45<=rake<=45)or(rake>=135)or(rake<=-135):# strike slipreturnlog10(area)+3.99else:# Dip slip (thrust or normal), and undefined rakereturnlog10(area)+4.00
[docs]defget_std_dev_mag(self,area,rake):""" Returns None for now """return0.0