In [1880]:
matplotlib inline
In [1881]:
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
In [1882]:
from __future__ import print_function

%matplotlib inline
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 11, 4
In [1883]:
#sta = "IBUH01" # velocity decrease, direction change, but increase aniso coeff, but  rms_coeff increase
#sta = "IBUH02" # velocoty degrease, no change direction, no change anino coeff. no increase aniso rms_coeff
#sta = "IBUH03"# Hokkaido velocoty degrease, change direction, no change anino coeff. no increase aniso rms_coeff
                           # Tohoku-oki velocity degrease, no change direction, no change anino coeff. no increase aniso rms_coeff
#sta = "IBUH04" # seismic data are not good
#sta = "IBUH05" # no change
#sta = "IBUH06" # velocity increase, az all direction. but why az_coeff increase? all parameters are messy
#sta = "IBUH07" # no change


#sta = "SRCH09"  # velocoty degrease, no change direction, no change anino coeff. no increase aniso rms_coeff
#sta = "SRCH10" #  no change
#sta = "SRCH08" # no change
#sta = "SRCH07" # no chnage
 
#sta = "SBSH08" # no many data
#sta = "SBSH07" # small change?
#sta = "SBSH03" # no change? no many data


sta = "HDKH04" # iso change no azimuth change, no coeff change
#sta = "HDKH01" # large variability, unclear velocity change
#sta = "HDKH03" # no change?
#sta = "HDKH05" # no change. 
#sta = "HDKH06" # no change?

#sta = "IKRH01"  # 
#sta = "IKRH02"# 
#sta = "IKRH03"# 
In [1884]:
#IBUH01 2003-04-17T15:40:54.9600 42.55450 143.50700 72.40 4.40 0.0006361000 20030418004000 516.48 541.09 491.87 126.17 36.17 9.10 3.71 7 5 -1 0 1 15

aniso_fi = "http://ncedc.org/ftp/outgoing/taira/"+sta+".out2"
aniso_data = pd.read_csv(aniso_fi,   
                       sep=" ",names=["sta", "time", "lat", "long", "depth", "mag", "elapse_diff", "evid", "viso", "vfast", "vslow", "azfast", "azslow", "azcoeff", "rms_coeff", "leng", "ddeg", "ns", "ne", "f1", "f2","elapse_days"],header=None)
In [1885]:
#print (aniso_data['lat'])
In [1886]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [1887]:
aniso_data.describe()
Out[1887]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 747.000000 747.000000 747.000000 747.000000 747.000000 7.470000e+02 747.000000 747.000000 747.000000 747.000000 747.000000 747.000000 747.000000 747.0 747.0 747.0 747.0 747.0 747.0 747.000000
mean 41.821719 142.960142 52.961780 4.869344 0.000265 2.011828e+13 572.309933 604.452195 540.167697 71.343253 90.740763 10.615288 5.776774 7.0 5.0 -1.0 0.0 1.0 15.0 -2324.505353
std 1.778376 1.786434 53.818225 1.000099 0.000240 5.174669e+10 9.980400 10.962935 15.033720 85.553331 4.931183 2.562861 7.056865 0.0 0.0 0.0 0.0 0.0 0.0 1892.972499
min 27.860800 134.290000 0.000000 2.600000 -0.000969 2.002062e+13 446.070000 570.950000 310.770000 0.000000 52.250000 0.940000 1.090000 7.0 5.0 -1.0 0.0 1.0 15.0 -5924.483602
25% 41.483900 141.992000 31.315000 4.200000 0.000097 2.008047e+13 569.305000 599.565000 536.950000 1.550000 89.020000 9.890000 3.750000 7.0 5.0 -1.0 0.0 1.0 15.0 -3777.293302
50% 42.239200 142.507000 43.390000 4.800000 0.000273 2.012081e+13 573.510000 605.190000 541.180000 3.830000 90.630000 10.510000 4.910000 7.0 5.0 -1.0 0.0 1.0 15.0 -2213.630846
75% 42.678900 143.339500 63.805000 5.500000 0.000449 2.017072e+13 577.325000 610.100000 545.175000 177.900000 92.320000 11.050000 6.010000 7.0 5.0 -1.0 0.0 1.0 15.0 -417.591050
max 49.183300 155.168000 681.710000 9.000000 0.000693 2.018122e+13 622.150000 722.790000 599.550000 179.970000 169.650000 51.250000 91.450000 7.0 5.0 -1.0 0.0 1.0 15.0 108.356364
In [1888]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [1889]:
#aniso_data['azslow']
In [1890]:
statsOUT = aniso_data.describe()
In [1891]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [1892]:
statsOUT.viso
Out[1892]:
count    747.000000
mean     572.309933
std        9.980400
min      446.070000
1%       548.684200
5%       555.984000
10%      560.356000
25%      569.305000
50%      573.510000
75%      577.325000
90%      580.896000
95%      583.772000
99%      594.224200
max      622.150000
Name: viso, dtype: float64
In [1893]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
572.3099330655957 560.356
In [1894]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [1895]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [1896]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [1897]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [1898]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [1899]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [1900]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [1901]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [1902]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [1903]:
#print(aniso_data.time)
In [1904]:
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(aniso_data['time'], aniso_data['viso'], "o", label = 'Viso')
#plt.ylim(350,600)
plt.ylim(viso_minplot, viso_maxplot)
plt.xlabel("Time UTC")
plt.ylabel("Velocitu (m/s)")
plt.legend(loc="upper left") 
plt.title(""+sta+" Viso")

#plt.xlim("2011-01-01 00:00:00","2018-10-01 0:00:00")
Out[1904]:
<matplotlib.text.Text at 0x1481a3b38>
In [1905]:
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(aniso_data['time'], aniso_data['rms_coeff'], "o", label = 'rms_coeff')
plt.ylim(rms_coeff_minplot, rms_coeff_maxplot)
plt.xlabel("Time UTC")
plt.ylabel("RMS_Coeff(%)")
plt.legend(loc="upper left") 
plt.title(""+sta+" RMS_Coeff")
Out[1905]:
<matplotlib.text.Text at 0x147f8d320>
In [1906]:
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(aniso_data['time'], aniso_data['azcoeff'], "o", label = 'azcoeff')
plt.ylim(azcoeff_minplot, azcoeff_maxplot)
plt.xlabel("Time UTC")
plt.ylabel("Az coeff(%)")
plt.legend(loc="upper left") 
plt.title(""+sta+" AzCoeff")
Out[1906]:
<matplotlib.text.Text at 0x1482b8080>
In [1907]:
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(aniso_data['time'], aniso_data['azfast'], "o", label = 'azfast')
plt.ylim(azfast_minplot, azfast_maxplot)
plt.xlabel("Time UTC")
plt.ylabel("Az fast(deg)")
plt.legend(loc="upper left") 
plt.title(""+sta+" Az fast")
Out[1907]:
<matplotlib.text.Text at 0x1484225c0>
In [1908]:
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(aniso_data['time'], aniso_data['azslow'], "o", label = 'azslow')
plt.ylim(azslow_minplot, azslow_maxplot)
plt.xlabel("Time UTC")
plt.ylabel("Az slow(deg)")
plt.legend(loc="upper left") 
plt.title(""+sta+" Az slow")
Out[1908]:
<matplotlib.text.Text at 0x148596240>
In [1909]:
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(aniso_data['time'], aniso_data['vfast'], "o", label = 'vfast')
plt.ylim(vfast_minplot, vfast_maxplot)
plt.xlabel("Time UTC")
plt.ylabel("v fast (m/s)")
plt.legend(loc="upper left") 
plt.title(""+sta+" v fast")
Out[1909]:
<matplotlib.text.Text at 0x1486f6a90>
In [1910]:
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(aniso_data['time'], aniso_data['vslow'], "o", label = 'vslow')
plt.ylim(vslow_minplot, vslow_maxplot)
plt.xlabel("Time UTC")
plt.ylabel("v slow (m/s)")
plt.legend(loc="upper left") 
plt.title(""+sta+" v slow")
Out[1910]:
<matplotlib.text.Text at 0x1487a7c88>