diff --git a/rtgmpy/BldgCodeTargets.json b/rtgmpy/BldgCodeTargets.json index 074011aaa341d0d0f2dfd6b96f77edb779d9ecc6..f2c7d21699d1393c3d43f069dbebcfdc02cd4160 100644 --- a/rtgmpy/BldgCodeTargets.json +++ b/rtgmpy/BldgCodeTargets.json @@ -1,2 +1,2 @@ -{"ASCE7": {"UH_retPeriod": 2475, "uh_time_yr":50,"PrC_tgt": 0.1, "beta": 0.6, "tgtRisk_time": 0.01, "risk_time_yr": 50}, -"AASHTO": {"UH_retPeriod": 1033, "uh_time_yr":75,"PrC_tgt": 0.05, "beta": 0.6, "tgtRisk_time": 0.015, "risk_time_yr": 75}} \ No newline at end of file +{"ASCE7": {"UH_retPeriod": 2474.915822, "uh_time_yr":50,"PrC_tgt": 0.1, "beta": 0.6, "tgtRisk_time": 0.01, "risk_time_yr": 50}, +"AASHTO": {"UH_retPeriod": 1033, "uh_time_yr":75,"PrC_tgt": 0.05, "beta": 0.6, "tgtRisk_time": 0.015, "risk_time_yr": 75}} diff --git a/rtgmpy/GroundMotionHazard.py b/rtgmpy/GroundMotionHazard.py index a63f55ac0029ccfe2f57d7a4dc1959117401cd15..6bc7f883e347d05a76c35526f181cabad832e154 100644 --- a/rtgmpy/GroundMotionHazard.py +++ b/rtgmpy/GroundMotionHazard.py @@ -250,7 +250,7 @@ class GroundMotionHazard(dict): return out_data def upsample_all( - self, anchor_uh_tr: float = 2475, min_scale: float = 0.10, max_scale: float = 10.0 + self, anchor_uh_tr: float = 2474.915822, min_scale: float = 0.10, max_scale: float = 10.0 ): """! Instance method that interpolates and extrapolates all IM hazard curves in the GroundMotionHazard class @@ -279,7 +279,7 @@ class GroundMotionHazard(dict): return up_data - def get_uh_iml(self, ret_periods: Union[List[float], float] = 2475) -> dict: + def get_uh_iml(self, ret_periods: Union[List[float], float] = 2474.915822) -> dict: """! Instance method that returns a dictionary of interpolated uniform hazard IM values @param ret_periods: @@ -308,7 +308,7 @@ class GroundMotionHazard(dict): ax: mpl.axes, imts: Union[str, List[str]] = None, upsample: bool = True, - anchor_uh_tr: float = 2475, + anchor_uh_tr: float = 2474.915822, ): """! Instance method that plots the ground motion hazard curves in log-space diff --git a/rtgmpy/RiskTargetedGMCalc.py b/rtgmpy/RiskTargetedGMCalc.py index dfe8b27238a8f78e444fa85c4f3197d5c3086767..68e15af04bf8d80742fffd4c047ee99f494561b3 100644 --- a/rtgmpy/RiskTargetedGMCalc.py +++ b/rtgmpy/RiskTargetedGMCalc.py @@ -23,7 +23,7 @@ mpl.rcParams["axes.prop_cycle"] = cycler( def calc_rtgm( haz_data: dict, - UH_retPeriod: Union[float, int] = 2475, + UH_retPeriod: Union[float, int] = 2474.915822, uh_time_yr: Union[float, int] = 50, PrC_tgt: float = 0.10, beta: float = 0.60, @@ -291,7 +291,7 @@ def calc_fragility( logMed = np.log(anchor_im) - st.norm.ppf(PrC_tgt) * beta # Calculate pdf and cdf - pdf = st.norm.pdf(np.log(iml), logMed, beta) + pdf = st.lognorm.pdf(x=iml, scale=np.exp(logMed), s=beta) cdf = st.norm.cdf(np.log(iml), logMed, beta) return (iml, pdf, cdf) @@ -319,8 +319,8 @@ def integrate_collapse_risk( hazXpdf = fragPDF * afe # Numerical integration - colCDF = scipy.integrate.cumtrapz(hazXpdf, np.log(iml), initial=0) - colProb = scipy.integrate.trapz(hazXpdf, np.log(iml)) + colCDF = scipy.integrate.cumtrapz(hazXpdf, iml, initial=0) + colProb = scipy.integrate.trapz(hazXpdf, iml) # Calculate collapse risk over specified time horizon colRisk_Yr = 1 - (1 - colProb) ** risk_time_yr