listfile = glob.glob(p.file_output+'_c*'+'_p*.nc') nr = 0 distance_min = 400 f0 = numpy.linspace(1/distance_min*dx, 1/2 - 1/distance_min*dx, num=int(distance_min/dx/2.)) for coordfile in listfile: print(coordfile) data = rw_data.Sat_SWOT(nfile=coordfile) data.load_swath(ssh_obs=[], ssh_model=[]) nal, nac = numpy.shape(data.ssh_obs) for iac in range(nac): if nal*dx>=distance_min: tap = 0.04 ffo, PSD_obs = myspectools.psd1d(hh=data.ssh_obs[10:-10,iac], dx=dx, detrend=True, tap=tap) ffm, PSD_model = myspectools.psd1d(hh=data.ssh_model[10:-10,iac], dx=dx, detrend=True, tap=tap) try: SS_obs = SS_obs + numpy.interp(f0, ffo, PSD_obs) SS_model = SS_model + numpy.interp(f0, ffm, PSD_model) except: SS_obs = numpy.interp(f0, ffo, PSD_obs) SS_model = numpy.interp(f0,ffm, PSD_model) nr += 1 SS_obs /= nr SS_model /= nr
nr = 0 distance_min = 400 f0 = numpy.linspace(1 / distance_min * dx, 1 / 2 - 1 / distance_min * dx, num=int(distance_min / dx / 2.)) for coordfile in listfile: print(coordfile) data = rw_data.Sat_SWOT(file=coordfile) data.load_swath(SSH_obs=[], SSH_model=[]) nal, nac = numpy.shape(data.SSH_obs) for iac in range(nac): if nal * dx >= distance_min: tap = 0.04 ff, PSD_obs = myspectools.psd1d(hh=data.SSH_obs[:, iac], dx=dx, detrend=True, tap=tap) ff, PSD_model = myspectools.psd1d(hh=data.SSH_model[:, iac], dx=dx, detrend=True, tap=tap) try: SS_obs = SS_obs + numpy.interp(f0, ff, PSD_obs) SS_model = SS_model + numpy.interp(f0, ff, PSD_model) except: SS_obs = numpy.interp(f0, ff, PSD_obs) SS_model = numpy.interp(f0, ff, PSD_model) nr += 1
dx = p.delta_al #km listfile = glob.glob(p.file_output+'_c*'+'_p*.nc') nr = 0 distance_min = 400 f0 = numpy.linspace(1/distance_min*dx, 1/2-1/distance_min*dx,num = int(distance_min/dx/2.)) for coordfile in listfile: print(coordfile) data=rw_data.Sat_SWOT(file = coordfile) data.load_swath(SSH_obs = [], SSH_model = []) nal, nac = numpy.shape(data.SSH_obs) for iac in range(nac): if nal*dx>=distance_min: tap = 0.04 ff, PSD_obs = myspectools.psd1d(hh=data.SSH_obs[:,iac],dx=dx, detrend=True, tap=tap) ff, PSD_model = myspectools.psd1d(hh=data.SSH_model[:,iac],dx=dx, detrend=True, tap=tap) try: SS_obs = SS_obs + numpy.interp(f0, ff, PSD_obs) SS_model = SS_model + numpy.interp(f0, ff, PSD_model) except: SS_obs = numpy.interp(f0, ff, PSD_obs) SS_model = numpy.interp(f0,ff, PSD_model) nr+=1 SS_obs/=nr SS_model/=nr
listfile = glob.glob(p.file_output+'_c*'+'_p*.nc') nr = 0 distance_min = 400 f0 = numpy.linspace(1/distance_min*dx, 1/2-1/distance_min*dx,num = int(distance_min/dx/2.)) for coordfile in listfile: print(coordfile) data = rw_data.Sat_SWOT(file=coordfile) data.load_swath(roll_err = [], phase_err = [], bd_err = [], timing_err=[], x_ac = []) nal, nac = numpy.shape(data.roll_err) if nal*dx>=distance_min: tap = 0.04 if p.roll: roll_err = data.roll_err[:,0]/(data.x_ac[0]*1000)*1.e6 ffr, PSD_roll = myspectools.psd1d(hh=roll_err,dx=dx, detrend=True, tap=tap) if p.phase: phase_err = data.phase_err[:,0]/(data.x_ac[0]*1000)*1.e6 ffp, PSD_phase = myspectools.psd1d(hh=phase_err,dx=dx, detrend=True, tap=tap) if p.baseline_dilation: bd_err = data.bd_err[:,-1]/((data.x_ac[-1])**2) ffb, PSD_bd = myspectools.psd1d(bd_err,dx=dx, detrend=True, tap=tap) if p.timing: timing_err = data.timing_err[:,-1] fft, PSD_timing = myspectools.psd1d(hh=timing_err,dx=dx, detrend=True, tap=tap) try: SS_roll = SS_roll+numpy.interp(f0, ffr, PSD_roll) SS_phase = SS_phase+numpy.interp(f0, ffp, PSD_phase) SS_bd = SS_bd+numpy.interp(f0, ffb, PSD_bd)
hh_roll = [] hh_phase = [] hh_bd = [] hh_timing = [] data = rw_data.Sat_SWOT(nfile=ifile) data.load_swath(wt=[], wt_err=[]) nal, nac = numpy.shape(data.roll_err) if nal * dx >= distance_min: f0 = numpy.linspace(1 / distance_min * dx, 1 / 2 - 1 / distance_min * dx, num=int(distance_min / dx / 2.)) tap = 0.04 if p.roll: ff, PSD_roll = myspectools.psd1d(hh=data.roll_err, dx=dx, detrend=True, tap=tap) if p.phase: ff, PSD_phase = myspectools.psd1d(hh=data.phase_err, dx=dx, detrend=True, tap=tap) if p.baselinedilation: ff, PSD_bd = myspectools.psd1d(hh=data.bd_err, dx=dx, detrend=True, tap=tap) if p.timing: ff, PSD_timing = myspectools.psd1d(hh=data.timing_err, dx=dx, detrend=True,
nr=0 for ifile in listfile: print(ifile) hh_roll=[] hh_phase=[] hh_bd=[] hh_timing=[] data=rw_data.Sat_SWOT(nfile=ifile) data.load_swath(wt=[], wt_err=[]) nal, nac=numpy.shape(data.roll_err) if nal*dx>=distance_min: f0=numpy.linspace(1/distance_min*dx, 1/2-1/distance_min*dx,num=int(distance_min/dx/2.)) tap=0.04 if p.roll: ff, PSD_roll=myspectools.psd1d(hh=data.roll_err,dx=dx, detrend=True, tap=tap) if p.phase: ff, PSD_phase=myspectools.psd1d(hh=data.phase_err,dx=dx, detrend=True, tap=tap) if p.baselinedilation: ff, PSD_bd=myspectools.psd1d(hh=data.bd_err,dx=dx, detrend=True, tap=tap) if p.timing: ff, PSD_timing=myspectools.psd1d(hh=data.timing_err,dx=dx, detrend=True, tap=tap) try: SS_roll=SS_roll+numpy.interp(f0, ff, PSD_roll) SS_phase=SS_phase+numpy.interp(f0, ff, PSD_phase) SS_bd=SS_bd+numpy.interp(f0, ff, PSD_bd) SS_timing=SS_timing+numpy.interp(f0, ff, PSD_timing) except: SS_roll=numpy.interp(f0, ff, PSD_roll) SS_phase=numpy.interp(f0,ff, PSD_phase) SS_bd=numpy.interp(f0, ff, PSD_bd) SS_timing=numpy.interp(f0, ff, PSD_timing) nr+=1
nr=0 for file in listfile: print(file) hh_roll=[] hh_phase=[] hh_bd=[] hh_timing=[] data=rw_data.Sat_SWOT(file=coordfile) data.load_swath(wt=[], wt_err=[]) nal, nac=numpy.shape(data.roll_err) if nal*dx>=distance_min: f0=numpy.linspace(1/distance_min*dx, 1/2-1/distance_min*dx,num=int(distance_min/dx/2.)) tap=0.04 if p.roll: ff, PSD_roll=myspectools.psd1d(hh=data.roll_err,dx=dx, detrend=True, tap=tap) if p.phase: ff, PSD_phase=myspectools.psd1d(hh=data.phase_err,dx=dx, detrend=True, tap=tap) if p.baselinedilation: ff, PSD_bd=myspectools.psd1d(hh=data.bd_err,dx=dx, detrend=True, tap=tap) if p.timing: ff, PSD_timing=myspectools.psd1d(hh=data.timing_err,dx=dx, detrend=True, tap=tap) try: SS_roll=SS_roll+numpy.interp(f0, ff, PSD_roll) SS_phase=SS_phase+numpy.interp(f0, ff, PSD_phase) SS_bd=SS_bd+numpy.interp(f0, ff, PSD_bd) SS_timing=SS_timing+numpy.interp(f0, ff, PSD_timing) except: SS_roll=numpy.interp(f0, ff, PSD_roll) SS_phase=numpy.interp(f0,ff, PSD_phase) SS_bd=numpy.interp(f0, ff, PSD_bd) SS_timing=numpy.interp(f0, ff, PSD_timing)