In [108]:
matplotlib inline
In [109]:
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
In [158]:
from __future__ import print_function

%matplotlib inline
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 15, 6
In [111]:
from IPython.display import HTML

HTML('''<script>
code_show=true; 
function code_toggle() {
 if (code_show){
 $('div.input').hide();
 } else {
 $('div.input').show();
 }
 code_show = !code_show
} 
$( document ).ready(code_toggle);
</script>
<form action="javascript:code_toggle()"><input type="submit" value="Click here to toggle on/off the raw code."></form>''')
Out[111]:
In [112]:
#ch= "ch01"
In [113]:
datadir = "http://ncedc.org/ftp/outgoing/taira/SAFOD/XC/"
 
fl = 1.0
fh = 5.0
nstack = 100
nstep = 50


shot_st_id = 389200
shot_et_id = 459100

ch01_st = 9.0
ch01_et = 30.0
ch02_st = 9.0
ch02_et = 30.0
ch03_st = 9.0
ch03_et = 30.0
ch04_st = 0.0
ch04_et = 30.0
ch05_st = 0.0
ch05_et = 10.0
ch06_st = 0.0
ch06_et = 3.0

finamepara = ""

xc_oneOPT = 1
#xc_oneOPT = 0

if xc_oneOPT == 1:
    finamepara = "xc_one_"+str(fl)+"_"+str(fh)+"kHz_"+str(nstack)+"Ns_"+str(shot_st_id)+"_"+str(shot_et_id)+".out"
    finamepara_raw = "xc_one_raw_"+str(nstack)+"Ns_"+str(shot_st_id)+"_"+str(shot_et_id)+".out"
    finamepara_amp = "amp_xc_one_"+str(fl)+"_"+str(fh)+"kHz_"+str(nstack)+"Ns_"+str(shot_st_id)+"_"+str(shot_et_id)+".out"
    finamepara_raw_amp = "amp_xc_one_raw_"+str(nstack)+"Ns_"+str(shot_st_id)+"_"+str(shot_et_id)+".out"
    
else:
    finamepara = "xc_"+str(fl)+"_"+str(fh)+"kHz_"+str(nstack)+"Ns.overlap"+str(nstep)+".out"
    finamepara_raw = "xc_raw_"+str(nstack)+"Ns.overlap"+str(nstep)+".out"
    finamepara_amp = "amp_xc_"+str(fl)+"_"+str(fh)+"kHz_"+str(nstack)+"Ns.overlap"+str(nstep)+".out"
    finamepara_raw_amp = "amp_xc_raw_"+str(nstack)+"Ns.overlap"+str(nstep)+".out"


#print(finamepara)
#ch02_9.0_30.0_xc_one_1.0_5.0kHz_100Ns_389200_459100.out

ch01_finame =  datadir+"ch01_"+str(ch01_st)+"_"+str(ch01_et)+"_"+finamepara
ch02_finame =  datadir+"ch02_"+str(ch02_st)+"_"+str(ch02_et)+"_"+finamepara
ch03_finame =  datadir+"ch03_"+str(ch03_st)+"_"+str(ch03_et)+"_"+finamepara
ch04_finame =  datadir+"ch04_"+str(ch04_st)+"_"+str(ch04_et)+"_"+finamepara
# raw
ch05_finame =  datadir+"ch05_"+str(ch05_st)+"_"+str(ch05_et)+"_"+finamepara_raw
ch06_finame =  datadir+"ch06_"+str(ch06_st)+"_"+str(ch06_et)+"_"+finamepara_raw

ch01_finame_amp =  datadir+"ch01_"+str(ch01_st)+"_"+str(ch01_et)+"_"+finamepara_amp
ch02_finame_amp =  datadir+"ch02_"+str(ch02_st)+"_"+str(ch02_et)+"_"+finamepara_amp
ch03_finame_amp =  datadir+"ch03_"+str(ch03_st)+"_"+str(ch03_et)+"_"+finamepara_amp
ch04_finame_amp =  datadir+"ch04_"+str(ch04_st)+"_"+str(ch04_et)+"_"+finamepara_amp
# raw
ch05_finame_amp =  datadir+"ch05_"+str(ch05_st)+"_"+str(ch05_et)+"_"+finamepara_raw_amp
ch06_finame_amp =  datadir+"ch06_"+str(ch06_st)+"_"+str(ch06_et)+"_"+finamepara_raw_amp
#print(ch01_finame_amp)
In [114]:
#ch01_fi = "http://ncedc.org/ftp/outgoing/taira/SAFOD/XC/ch01_9.0_30.0_xc_1.0_5.0kHz_100Ns.overlap50.out"
ch01_fi = ch01_finame
#49000 1.61821e-05 49000 2017-12-01T10:34:13 2017-12-01T02:34:13.72 0.999996424
ch01_data = pd.read_csv(ch01_fi,   
                       sep=" ",names=["id1", "timedelay", "id2", "timeUTC", "timelocal", "xc"],header=None)
ch01_fi_amp = ch01_finame_amp
#49000 0.999689 49000 2017-12-01T10:34:13 2017-12-01T02:34:13.72 0.00598362 5.75066E-4 0.00609988
ch01_data_amp = pd.read_csv(ch01_fi_amp,   
                       sep=" ",names=["id1", "amp_med", "id2", "timeUTC", "timelocal", "amp_l1", "ph_med", "ph_l1"],header=None)
In [115]:
#ch02_fi = "http://ncedc.org/ftp/outgoing/taira/SAFOD/XC/ch02_9.0_30.0_xc_1.0_5.0kHz_100Ns.overlap50.out"
ch02_fi = ch02_finame
#49000 1.61821e-05 49000 2017-12-01T10:34:13 2017-12-01T02:34:13.72 0.999996424
ch02_data = pd.read_csv(ch02_fi,   
                       sep=" ",names=["id1", "timedelay", "id2", "timeUTC", "timelocal", "xc"],header=None)
ch02_fi_amp = ch02_finame_amp
#49000 0.999689 49000 2017-12-01T10:34:13 2017-12-01T02:34:13.72 0.00598362 5.75066E-4 0.00609988
ch02_data_amp = pd.read_csv(ch02_fi_amp,   
                       sep=" ",names=["id1", "amp_med", "id2", "timeUTC", "timelocal", "amp_l1", "ph_med", "ph_l1"],header=None)
In [116]:
#ch03_fi = "http://ncedc.org/ftp/outgoing/taira/SAFOD/XC/ch03_9.0_30.0_xc_1.0_5.0kHz_100Ns.overlap50.out"
ch03_fi = ch03_finame
#49000 1.61821e-05 49000 2017-12-01T10:34:13 2017-12-01T02:34:13.72 0.999996424
ch03_data = pd.read_csv(ch03_fi,   
                       sep=" ",names=["id1", "timedelay", "id2", "timeUTC", "timelocal", "xc"],header=None)
ch03_fi_amp = ch03_finame_amp
#49000 0.999689 49000 2017-12-01T10:34:13 2017-12-01T02:34:13.72 0.00598362 5.75066E-4 0.00609988
ch03_data_amp = pd.read_csv(ch03_fi_amp,   
                       sep=" ",names=["id1", "amp_med", "id2", "timeUTC", "timelocal", "amp_l1", "ph_med", "ph_l1"],header=None)
In [117]:
#ch04_fi = "http://ncedc.org/ftp/outgoing/taira/SAFOD/XC/ch04_0.0_30.0_xc_1.0_5.0kHz_100Ns.overlap50.out"
ch04_fi = ch04_finame
#49000 1.61821e-05 49000 2017-12-01T10:34:13 2017-12-01T02:34:13.72 0.999996424
ch04_data = pd.read_csv(ch04_fi,   
                       sep=" ",names=["id1", "timedelay", "id2", "timeUTC", "timelocal", "xc"],header=None)
ch04_fi_amp = ch04_finame_amp
#49000 0.999689 49000 2017-12-01T10:34:13 2017-12-01T02:34:13.72 0.00598362 5.75066E-4 0.00609988
ch04_data_amp = pd.read_csv(ch04_fi_amp,   
                       sep=" ",names=["id1", "amp_med", "id2", "timeUTC", "timelocal", "amp_l1", "ph_med", "ph_l1"],header=None)
In [118]:
#ch05_fi = "http://ncedc.org/ftp/outgoing/taira/SAFOD/XC/ch05_0.0_10.0_xc_raw_100Ns.overlap50.out"
ch05_fi = ch05_finame
#49000 1.61821e-05 49000 2017-12-01T10:34:13 2017-12-01T02:34:13.72 0.999996424
ch05_data = pd.read_csv(ch05_fi,   
                       sep=" ",names=["id1", "timedelay", "id2", "timeUTC", "timelocal", "xc"],header=None)
ch05_fi_amp = ch05_finame_amp
#49000 0.999689 49000 2017-12-01T10:34:13 2017-12-01T02:34:13.72 0.00598362 5.75066E-4 0.00609988
ch05_data_amp = pd.read_csv(ch05_fi_amp,   
                       sep=" ",names=["id1", "amp_med", "id2", "timeUTC", "timelocal", "amp_l1", "ph_med", "ph_l1"],header=None)
In [119]:
#ch06_fi = "http://ncedc.org/ftp/outgoing/taira/SAFOD/XC/ch06_0.0_3.0_xc_raw_100Ns.overlap50.out"
ch06_fi = ch06_finame
#49000 1.61821e-05 49000 2017-12-01T10:34:13 2017-12-01T02:34:13.72 0.999996424
ch06_data = pd.read_csv(ch06_fi,   
                       sep=" ",names=["id1", "timedelay", "id2", "timeUTC", "timelocal", "xc"],header=None)
ch06_fi_amp = ch06_finame_amp
#49000 0.999689 49000 2017-12-01T10:34:13 2017-12-01T02:34:13.72 0.00598362 5.75066E-4 0.00609988
ch06_data_amp = pd.read_csv(ch06_fi_amp,   
                       sep=" ",names=["id1", "amp_med", "id2", "timeUTC", "timelocal", "amp_l1", "ph_med", "ph_l1"],header=None)
In [120]:
pth_finame =  datadir+"/pth_time.all.out.notab"
pth_fi = pth_finame
#2017-05-20T01:53:19	2017-05-19T18:53:19 939.09 22.25 29 25.74 21.3 12.1 23
pth_data = pd.read_csv(pth_fi,   
                       sep=" ",names=["timeUTC", "timelocal", "pressure_hPa", "inside_temp_C", "inside_rela_humi_per", "outside_temp_C","outside_rela_humi_per","logger_volt","logger_temp_C"],header=None)
In [121]:
pth_data['time'] = pd.to_datetime(pth_data['timeUTC'])
#pth_data.describe()
In [122]:
#print (xc_data['timedelay'])
In [123]:
ch01_data['time'] = pd.to_datetime(ch01_data['timeUTC'])
ch02_data['time'] = pd.to_datetime(ch02_data['timeUTC'])
ch03_data['time'] = pd.to_datetime(ch03_data['timeUTC'])
ch04_data['time'] = pd.to_datetime(ch04_data['timeUTC'])
ch05_data['time'] = pd.to_datetime(ch05_data['timeUTC'])
ch06_data['time'] = pd.to_datetime(ch06_data['timeUTC'])

ch01_data_amp['time'] = pd.to_datetime(ch01_data_amp['timeUTC'])
ch02_data_amp['time'] = pd.to_datetime(ch02_data_amp['timeUTC'])
ch03_data_amp['time'] = pd.to_datetime(ch03_data_amp['timeUTC'])
ch04_data_amp['time'] = pd.to_datetime(ch04_data_amp['timeUTC'])
ch05_data_amp['time'] = pd.to_datetime(ch05_data_amp['timeUTC'])
ch06_data_amp['time'] = pd.to_datetime(ch06_data_amp['timeUTC'])
In [124]:
#ch01_data.describe()
In [125]:
#ch02_data.describe()
In [126]:
#ch03_data.describe()
In [127]:
#ch04_data.describe()
In [128]:
#ch05_data.describe()
In [129]:
#ch06_data.describe()
In [130]:
#ch01_data_amp.describe()
In [131]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [132]:
#aniso_data['azslow']
In [133]:
statsOUT_ch01 = ch01_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
statsOUT_ch02 = ch02_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
statsOUT_ch03 = ch03_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
statsOUT_ch04 = ch04_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
statsOUT_ch05 = ch05_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
statsOUT_ch06 = ch06_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])

statsOUT_ch01_amp = ch01_data_amp.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
statsOUT_ch02_amp = ch02_data_amp.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
statsOUT_ch03_amp = ch03_data_amp.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
statsOUT_ch04_amp = ch04_data_amp.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
statsOUT_ch05_amp = ch05_data_amp.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
statsOUT_ch06_amp = ch06_data_amp.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [134]:
#statsOUT = xc_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [135]:
#statsOUT_ch01.timedelay
In [136]:
#statsOUT_ch02.timedelay
In [137]:
#statsOUT_ch03.timedelay
In [138]:
#statsOUT_ch04.timedelay
In [139]:
#statsOUT_ch05.timedelay
In [140]:
#statsOUT_ch06.timedelay
In [141]:
#statsOUT_ch01_amp.amp_med
In [159]:
fig, ax = plt.subplots()
ax.xaxis.set_major_formatter(mdates.DateFormatter('%Y/%m/%d\n%H:%M'))
    
#plt.plot(aniso_data.time, aniso_data.viso, "o", label = 'Viso')
#plt.plot(ch01_data['time'], ch01_data['timedelay']*1000, "o", label = 'ch01 Time Delay')
#plt.plot(ch02_data['time'], ch02_data['timedelay']*1000, "o", label = 'ch02 Time Delay')
#plt.plot(ch03_data['time'], ch03_data['timedelay']*1000, "o", label = 'ch03 Time Delay')
plt.plot(ch01_data['time'], ch01_data['timedelay']*1000-0, label = 'Vertical (ch01)')
plt.plot(ch02_data['time'], ch02_data['timedelay']*1000-0, label = 'Horizontal-1 (ch02)')
plt.plot(ch03_data['time'], ch03_data['timedelay']*1000-0, label = 'Horizontal-2 (ch03)')
plt.plot(ch04_data['time'], ch04_data['timedelay']*1000-0, label = 'Hydrophone (ch04)')
plt.plot(ch05_data['time'], ch05_data['timedelay']*1000-5, label = 'HV source (ch05)')
plt.plot(ch06_data['time'], ch06_data['timedelay']*1000*25-7.5, label = 'Source x 25 (ch06)')

#plt.ylim(350,600)
#plt.ylim(viso_minplot, viso_maxplot)
plt.xlabel("Time UTC", fontsize=16)
plt.ylabel("Time Delay (microseconds)", fontsize=16)
plt.legend(loc="upper right", fontsize=14) 
plt.title("Time Delay",fontsize=16)
plt.tick_params(labelsize=14)
#plt.xlim("2018-01-01 00:00:00","2018-03-01 0:00:00")
plt.xlim("2018-04-01 00:00:00","2018-06-01 0:00:00")
#plt.xlim("2017-12-01 00:00:00","2018-06-01 0:00:00")

plt.ylim(-25,60)
# 04-06 2018
plt.ylim(-10,10)
# 12 2017 -06 2018
#plt.ylim(-10,60)
Out[159]:
(-10, 10)
In [161]:
fig, ax = plt.subplots()
ax.xaxis.set_major_formatter(mdates.DateFormatter('%Y/%m/%d\n%H:%M'))

plt.plot(ch01_data_amp['time'], ch01_data_amp['amp_med']*1, label = 'Vertical (ch01)')
plt.plot(ch02_data_amp['time'], ch02_data_amp['amp_med']*1+0.04, label = 'Horizontal-1 (ch02)')
plt.plot(ch03_data_amp['time'], ch03_data_amp['amp_med']*1+0.08, label = 'Horizontal-2 (ch03)')
plt.plot(ch04_data_amp['time'], ch04_data_amp['amp_med']*1-0.04, label = 'Hydrophone (ch04)')
plt.plot(ch05_data_amp['time'], ch05_data_amp['amp_med']*5-4-0.08, label = 'HV source x 5 (ch05)')
plt.plot(ch06_data_amp['time'], ch06_data_amp['amp_med']*30-29-0.12, label = 'Source x30 (ch06)')


#plt.ylim(350,600)
#plt.ylim(viso_minplot, viso_maxplot)
plt.xlabel("Time UTC",fontsize=16)
plt.ylabel("Amplitude ratio",fontsize=16)
plt.legend(loc="upper right",fontsize=14) 
plt.title("Amplitude ratio",fontsize=16)
plt.tick_params(labelsize=14)

plt.xlim("2018-04-01 00:00:00","2018-06-01 0:00:00")
#plt.xlim("2017-12-01 00:00:00","2018-06-01 0:00:00")

plt.ylim(0.85,1.55)

# 04-06 2018
plt.ylim(0.85,1.35)
# 12 2017 to 06 2018
#plt.ylim(0.85,1.5)
Out[161]:
(0.85, 1.35)
In [162]:
plt.rcParams['figure.figsize'] = 15, 3
fig, ax = plt.subplots()
ax.xaxis.set_major_formatter(mdates.DateFormatter('%Y/%m/%d\n%H:%M'))

plt.plot(pth_data['time'], pth_data['pressure_hPa']*1, label = 'Pressure hPa')


#plt.ylim(350,600)
#plt.ylim(viso_minplot, viso_maxplot)
plt.xlabel("Time UTC",fontsize=16)
plt.ylabel("Pressure (hPa)",fontsize=16)
plt.legend(loc="upper right",fontsize=14) 
plt.title("Enviromental data",fontsize=16)
plt.tick_params(labelsize=14)

plt.xlim("2018-04-01 00:00:00","2018-06-01 0:00:00")
#plt.xlim("2017-12-01 00:00:00","2018-06-01 0:00:00")
Out[162]:
(736785.0, 736846.0)
In [163]:
plt.rcParams['figure.figsize'] = 15, 3
fig, ax = plt.subplots()
ax.xaxis.set_major_formatter(mdates.DateFormatter('%Y/%m/%d\n%H:%M'))

plt.plot(pth_data['time'], pth_data['outside_temp_C']*1, label = 'Outside temperature (degrees Celsius)')


#plt.ylim(350,600)
#plt.ylim(viso_minplot, viso_maxplot)
plt.xlabel("Time UTC",fontsize=16)
plt.ylabel("Temperature (degrees Celsius)",fontsize=16)
plt.legend(loc="upper right",fontsize=14) 
plt.title("Enviromental data",fontsize=16)
plt.tick_params(labelsize=14)

plt.xlim("2018-04-01 00:00:00","2018-06-01 0:00:00")
#plt.xlim("2017-12-01 00:00:00","2018-06-01 0:00:00")

#plt.ylim(0.85,1.55)
#plt.ylim(0.95,1.1)
Out[163]:
(736785.0, 736846.0)