Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
#Dip Slip
if duration>0: #Is there a source time fucntion? Yes!
r=read(staname[k]+".subfault"+num+'.DS.disp.r')
t=read(staname[k]+".subfault"+num+'.DS.disp.t')
z=read(staname[k]+".subfault"+num+'.DS.disp.z')
else: #No! This is the impulse response!
r=read(staname[k]+".subfault"+num+'.DS.disp.ri')
t=read(staname[k]+".subfault"+num+'.DS.disp.ti')
z=read(staname[k]+".subfault"+num+'.DS.disp.zi')
ntemp,etemp=rt2ne(r[0].data,t[0].data,az[k])
n=r.copy()
n[0].data=ntemp/100
e=t.copy()
e[0].data=etemp/100
z[0].data=z[0].data/100
n=origin_time(n,time_epi,tb)
e=origin_time(e,time_epi,tb)
z=origin_time(z,time_epi,tb)
n.write(staname[k]+".subfault"+num+'.DS.disp.n',format='SAC')
e.write(staname[k]+".subfault"+num+'.DS.disp.e',format='SAC')
z.write(staname[k]+".subfault"+num+'.DS.disp.z',format='SAC')
silentremove(staname[k]+".subfault"+num+'.DS.disp.r')
silentremove(staname[k]+".subfault"+num+'.DS.disp.t')
if impulse==True:
silentremove(staname[k]+".subfault"+num+'.DS.disp.ri')
silentremove(staname[k]+".subfault"+num+'.DS.disp.ti')
silentremove(staname[k]+".subfault"+num+'.DS.disp.zi')
else: #Waveforms are velocity, as before, rotate from RT-Z to NE+Z and scale to m/s
#Strike slip
if duration>0: #Is there a source time fucntion? Yes!
r=read(staname[k]+".subfault"+num+'.SS.vel.r')
t=read(staname[k]+".subfault"+num+'.SS.vel.t')
r=read(staname[k]+".subfault"+num+'.DS.disp.r')
t=read(staname[k]+".subfault"+num+'.DS.disp.t')
z=read(staname[k]+".subfault"+num+'.DS.disp.z')
else: #No! This is the impulse response!
r=read(staname[k]+".subfault"+num+'.DS.disp.ri')
t=read(staname[k]+".subfault"+num+'.DS.disp.ti')
z=read(staname[k]+".subfault"+num+'.DS.disp.zi')
ntemp,etemp=rt2ne(r[0].data,t[0].data,az[k])
n=r.copy()
n[0].data=ntemp/100
e=t.copy()
e[0].data=etemp/100
z[0].data=z[0].data/100
n=origin_time(n,time_epi,tb)
e=origin_time(e,time_epi,tb)
z=origin_time(z,time_epi,tb)
n.write(staname[k]+".subfault"+num+'.DS.disp.n',format='SAC')
e.write(staname[k]+".subfault"+num+'.DS.disp.e',format='SAC')
z.write(staname[k]+".subfault"+num+'.DS.disp.z',format='SAC')
silentremove(staname[k]+".subfault"+num+'.DS.disp.r')
silentremove(staname[k]+".subfault"+num+'.DS.disp.t')
if impulse==True:
silentremove(staname[k]+".subfault"+num+'.DS.disp.ri')
silentremove(staname[k]+".subfault"+num+'.DS.disp.ti')
silentremove(staname[k]+".subfault"+num+'.DS.disp.zi')
else: #Waveforms are velocity, as before, rotate from RT-Z to NE+Z and scale to m/s
#Strike slip
if duration>0: #Is there a source time fucntion? Yes!
r=read(staname[k]+".subfault"+num+'.SS.vel.r')
t=read(staname[k]+".subfault"+num+'.SS.vel.t')
z=read(staname[k]+".subfault"+num+'.SS.vel.z')
else: #No! This is the impulse response!
r=read(staname[k]+".subfault"+num+'.SS.vel.r')
t=read(staname[k]+".subfault"+num+'.SS.vel.t')
z=read(staname[k]+".subfault"+num+'.SS.vel.z')
else: #No! This is the impulse response!
r=read(staname[k]+".subfault"+num+'.SS.vel.ri')
t=read(staname[k]+".subfault"+num+'.SS.vel.ti')
z=read(staname[k]+".subfault"+num+'.SS.vel.zi')
ntemp,etemp=rt2ne(r[0].data,t[0].data,az[k])
n=r.copy()
n[0].data=ntemp/100
e=t.copy()
e[0].data=etemp/100
z[0].data=z[0].data/100
n=origin_time(n,time_epi,tb)
e=origin_time(e,time_epi,tb)
z=origin_time(z,time_epi,tb)
n.write(staname[k]+".subfault"+num+'.SS.vel.n',format='SAC')
e.write(staname[k]+".subfault"+num+'.SS.vel.e',format='SAC')
z.write(staname[k]+".subfault"+num+'.SS.vel.z',format='SAC')
silentremove(staname[k]+".subfault"+num+'.SS.vel.r')
silentremove(staname[k]+".subfault"+num+'.SS.vel.t')
if impulse==True:
silentremove(staname[k]+".subfault"+num+'.SS.vel.ri')
silentremove(staname[k]+".subfault"+num+'.SS.vel.ti')
silentremove(staname[k]+".subfault"+num+'.SS.vel.zi')
#Dip Slip
if duration>0: #Is there a source time fucntion? Yes!
r=read(staname[k]+".subfault"+num+'.DS.vel.r')
t=read(staname[k]+".subfault"+num+'.DS.vel.t')
z=read(staname[k]+".subfault"+num+'.DS.vel.z')
else: #No! This is the impulse response!
r=read(staname[k]+".subfault"+num+'.DS.vel.ri')
if duration>0: #Is there a source time fucntion? Yes!
r=read(staname[k]+".subfault"+num+'.DS.disp.r')
t=read(staname[k]+".subfault"+num+'.DS.disp.t')
z=read(staname[k]+".subfault"+num+'.DS.disp.z')
else: #No! This is the impulse response!
r=read(staname[k]+".subfault"+num+'.DS.disp.ri')
t=read(staname[k]+".subfault"+num+'.DS.disp.ti')
z=read(staname[k]+".subfault"+num+'.DS.disp.zi')
ntemp,etemp=rt2ne(r[0].data,t[0].data,az[k])
n=r.copy()
n[0].data=ntemp/100
e=t.copy()
e[0].data=etemp/100
z[0].data=z[0].data/100
n=origin_time(n,time_epi,tb)
e=origin_time(e,time_epi,tb)
z=origin_time(z,time_epi,tb)
n.write(staname[k]+".subfault"+num+'.DS.disp.n',format='SAC')
e.write(staname[k]+".subfault"+num+'.DS.disp.e',format='SAC')
z.write(staname[k]+".subfault"+num+'.DS.disp.z',format='SAC')
silentremove(staname[k]+".subfault"+num+'.DS.disp.r')
silentremove(staname[k]+".subfault"+num+'.DS.disp.t')
if impulse==True:
silentremove(staname[k]+".subfault"+num+'.DS.disp.ri')
silentremove(staname[k]+".subfault"+num+'.DS.disp.ti')
silentremove(staname[k]+".subfault"+num+'.DS.disp.zi')
else: #Waveforms are velocity, as before, rotate from RT-Z to NE+Z and scale to m/s
#Strike slip
if duration>0: #Is there a source time fucntion? Yes!
r=read(staname[k]+".subfault"+num+'.SS.vel.r')
t=read(staname[k]+".subfault"+num+'.SS.vel.t')
z=read(staname[k]+".subfault"+num+'.SS.vel.z')
if duration>0: #Is there a source time fucntion? Yes!
r=read(staname[k]+".subfault"+num+'.SS.vel.r')
t=read(staname[k]+".subfault"+num+'.SS.vel.t')
z=read(staname[k]+".subfault"+num+'.SS.vel.z')
else: #No! This is the impulse response!
r=read(staname[k]+".subfault"+num+'.SS.vel.ri')
t=read(staname[k]+".subfault"+num+'.SS.vel.ti')
z=read(staname[k]+".subfault"+num+'.SS.vel.zi')
ntemp,etemp=rt2ne(r[0].data,t[0].data,az[k])
n=r.copy()
n[0].data=ntemp/100
e=t.copy()
e[0].data=etemp/100
z[0].data=z[0].data/100
n=origin_time(n,time_epi,tb)
e=origin_time(e,time_epi,tb)
z=origin_time(z,time_epi,tb)
n.write(staname[k]+".subfault"+num+'.SS.vel.n',format='SAC')
e.write(staname[k]+".subfault"+num+'.SS.vel.e',format='SAC')
z.write(staname[k]+".subfault"+num+'.SS.vel.z',format='SAC')
silentremove(staname[k]+".subfault"+num+'.SS.vel.r')
silentremove(staname[k]+".subfault"+num+'.SS.vel.t')
if impulse==True:
silentremove(staname[k]+".subfault"+num+'.SS.vel.ri')
silentremove(staname[k]+".subfault"+num+'.SS.vel.ti')
silentremove(staname[k]+".subfault"+num+'.SS.vel.zi')
#Dip Slip
if duration>0: #Is there a source time fucntion? Yes!
r=read(staname[k]+".subfault"+num+'.DS.vel.r')
t=read(staname[k]+".subfault"+num+'.DS.vel.t')
z=read(staname[k]+".subfault"+num+'.DS.vel.z')
else: #No! This is the impulse response!
#Strike slip
if duration>0: #Is there a source time fucntion? Yes!
r=read(staname[k]+".subfault"+num+'.SS.vel.r')
t=read(staname[k]+".subfault"+num+'.SS.vel.t')
z=read(staname[k]+".subfault"+num+'.SS.vel.z')
else: #No! This is the impulse response!
r=read(staname[k]+".subfault"+num+'.SS.vel.ri')
t=read(staname[k]+".subfault"+num+'.SS.vel.ti')
z=read(staname[k]+".subfault"+num+'.SS.vel.zi')
ntemp,etemp=rt2ne(r[0].data,t[0].data,az[k])
n=r.copy()
n[0].data=ntemp/100
e=t.copy()
e[0].data=etemp/100
z[0].data=z[0].data/100
n=origin_time(n,time_epi,tb)
e=origin_time(e,time_epi,tb)
z=origin_time(z,time_epi,tb)
n.write(staname[k]+".subfault"+num+'.SS.vel.n',format='SAC')
e.write(staname[k]+".subfault"+num+'.SS.vel.e',format='SAC')
z.write(staname[k]+".subfault"+num+'.SS.vel.z',format='SAC')
silentremove(staname[k]+".subfault"+num+'.SS.vel.r')
silentremove(staname[k]+".subfault"+num+'.SS.vel.t')
if impulse==True:
silentremove(staname[k]+".subfault"+num+'.SS.vel.ri')
silentremove(staname[k]+".subfault"+num+'.SS.vel.ti')
silentremove(staname[k]+".subfault"+num+'.SS.vel.zi')
#Dip Slip
if duration>0: #Is there a source time fucntion? Yes!
r=read(staname[k]+".subfault"+num+'.DS.vel.r')
t=read(staname[k]+".subfault"+num+'.DS.vel.t')
z=read(staname[k]+".subfault"+num+'.DS.vel.z')