diff --git a/wetb/prepost/Simulations.py b/wetb/prepost/Simulations.py index 751149b931c73cb65da32805d9f7748ffc459f6b..510ffeda430528e6734343292ae8e05438851c11 100755 --- a/wetb/prepost/Simulations.py +++ b/wetb/prepost/Simulations.py @@ -5204,38 +5204,6 @@ class Cases(object): return envelope - def int_envelope(ch1,ch2,Nx): - # Function to interpolate envelopes and output arrays of same length - - # Number of points is defined by Nx + 1, where the + 1 is needed to - # close the curve - - upper = [] - lower = [] - - indmax = np.argmax(ch1) - indmin = np.argmin(ch1) - if indmax > indmin: - lower = np.array([ch1[indmin:indmax+1],ch2[indmin:indmax+1]]).T - upper = np.concatenate((np.array([ch1[indmax:],ch2[indmax:]]).T,\ - np.array([ch1[:indmin+1],ch2[:indmin+1]]).T),axis=0) - else: - upper = np.array([ch1[indmax:indmin+1,:],ch2[indmax:indmin+1,:]]).T - lower = np.concatenate((np.array([ch1[indmin:],ch2[indmin:]]).T,\ - np.array([ch1[:indmax+1],ch2[:indmax+1]]).T),axis=0) - - - int_1 = np.linspace(min(min(upper[:,0]),min(lower[:,0])),\ - max(max(upper[:,0]),max(upper[:,0])),Nx/2+1) - upper = np.flipud(upper) - int_2_up = np.interp(int_1,np.array(upper[:,0]),np.array(upper[:,1])) - int_2_low = np.interp(int_1,np.array(lower[:,0]),np.array(lower[:,1])) - - int_env = np.concatenate((np.array([int_1[:-1],int_2_up[:-1]]).T,\ - np.array([int_1[::-1],int_2_low[::-1]]).T),axis=0) - - return int_env - def envelope(self, silent=False, ch_list=[], append=''): """ Calculate envelopes and save them in a table.