Open chrisdicaprio opened 2 years ago
def compute_cov_at_poe(levels,values_mean,values_cov,poe,inv_time):
rp = -inv_time/np.log(1-poe)
try:
target_level = np.exp( np.interp( np.log(1/rp), np.flip(np.log(values_mean)), np.flip(np.log(levels)) ) )
except:
breakpoint()
return np.exp( np.interp(np.log(target_level),np.log(levels),np.log(values_cov)) )
We want to be able to calculate coefficient of variation (CoV) maps for a given probability of exceedance (PoE).
This is done by (at every grid point)
target_level
target_level
. This is done by treating shaking levels as the x-values and CoV as the y values in the interpolation (opposite of how interpolation is done in step 1). NB: use log-log interpolation