Skip to content

Commit

Permalink
Fix years per simulation in calculating ARIs using GEV
Browse files Browse the repository at this point in the history
  • Loading branch information
wcarthur committed Oct 12, 2018
1 parent 8cd4c22 commit f0d6731
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hazard/evd.py
Expand Up @@ -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
Expand Down Expand Up @@ -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]):
Expand Down

0 comments on commit f0d6731

Please sign in to comment.