From f0d6731b975bbabb30cf43cad4e613079f976444 Mon Sep 17 00:00:00 2001 From: wcarthur Date: Fri, 12 Oct 2018 14:28:37 +1100 Subject: [PATCH] Fix years per simulation in calculating ARIs using GEV --- hazard/evd.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hazard/evd.py b/hazard/evd.py index 75fc3107..8b58336a 100644 --- a/hazard/evd.py +++ b/hazard/evd.py @@ -253,7 +253,7 @@ def func(x, a, b, c): loc, scale, shp = pars return w, loc, scale, shp -def gevfit(data, intervals, numsim, nodata=-9999., minrecords=50, ): +def gevfit(data, intervals, nodata=-9999., minrecords=50, yrspersim=1): """ Calculate extreme value distribution parameters using the Lmoments module. Return period values are not calculated if the shape parameter is negative @@ -324,7 +324,7 @@ def gevfit(data, intervals, numsim, nodata=-9999., minrecords=50, ): else: # Calculate wind speed for each return period w[i] = (np.transpose(loc + (scale / shp) * - (1. - np.power(-1. * np.log(1. - (1. / t)), shp)))) + (1. - np.power(-1. * np.log(1. - (yrspersim / t)), shp)))) # Replace any non-finite numbers with the missing value: if not np.isfinite(w[i]):