In [1663]:
matplotlib inline
In [1664]:
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
In [1665]:
from __future__ import print_function

%matplotlib inline
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 11, 4
In [1666]:
#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 [1667]:
#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 [1668]:
#print (aniso_data['lat'])
In [1669]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [1670]:
aniso_data.describe()
Out[1670]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 713.000000 713.000000 713.000000 713.000000 713.000000 7.130000e+02 713.000000 713.000000 713.000000 713.000000 713.000000 713.000000 713.000000 713.0 713.0 713.0 713.0 713.0 713.0 713.000000
mean 41.640118 142.753460 50.516508 4.879102 0.000259 2.011926e+13 407.031431 422.359229 391.703366 79.151697 166.374684 7.197055 1.616957 7.0 5.0 -1.0 0.0 1.0 15.0 -2288.859013
std 1.886570 1.650417 49.078206 1.029494 0.000244 5.033533e+10 7.474114 12.371879 8.710020 6.860846 18.975060 2.845577 5.928648 0.0 0.0 0.0 0.0 0.0 0.0 1845.485910
min 27.052000 131.064000 0.000000 2.700000 -0.000969 2.002062e+13 342.970000 400.330000 253.000000 6.920000 1.520000 2.650000 0.090000 7.0 5.0 -1.0 0.0 1.0 15.0 -5924.483602
25% 41.333800 141.986000 30.550000 4.100000 0.000091 2.008090e+13 405.030000 418.630000 390.020000 76.870000 166.720000 6.360000 0.660000 7.0 5.0 -1.0 0.0 1.0 15.0 -3656.518597
50% 42.193000 142.446000 42.680000 4.800000 0.000264 2.012071e+13 407.340000 421.840000 392.520000 78.900000 168.760000 6.930000 0.950000 7.0 5.0 -1.0 0.0 1.0 15.0 -2249.401185
75% 42.667500 143.139000 63.440000 5.600000 0.000445 2.017071e+13 409.540000 425.330000 394.520000 81.420000 171.160000 7.620000 1.320000 7.0 5.0 -1.0 0.0 1.0 15.0 -418.384687
max 49.183300 155.168000 681.710000 9.000000 0.000693 2.018122e+13 504.110000 640.840000 416.900000 164.090000 179.260000 42.670000 83.820000 7.0 5.0 -1.0 0.0 1.0 15.0 108.356364
In [1671]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [1672]:
#aniso_data['azslow']
In [1673]:
statsOUT = aniso_data.describe()
In [1674]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [1675]:
statsOUT.viso
Out[1675]:
count    713.000000
mean     407.031431
std        7.474114
min      342.970000
1%       391.242400
5%       397.216000
10%      400.198000
25%      405.030000
50%      407.340000
75%      409.540000
90%      412.006000
95%      415.036000
99%      420.054800
max      504.110000
Name: viso, dtype: float64
In [1676]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
407.03143057503513 400.198
In [1677]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [1678]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [1679]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [1680]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [1681]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [1682]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [1683]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [1684]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [1685]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [1686]:
#print(aniso_data.time)
In [1687]:
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[1687]:
<matplotlib.text.Text at 0x13d43fe48>
In [1688]:
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[1688]:
<matplotlib.text.Text at 0x13d7fec88>
In [1689]:
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[1689]:
<matplotlib.text.Text at 0x13c7847f0>
In [1690]:
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[1690]:
<matplotlib.text.Text at 0x14237b978>
In [1691]:
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[1691]:
<matplotlib.text.Text at 0x143a8fd30>
In [1692]:
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[1692]:
<matplotlib.text.Text at 0x143fbb080>
In [1693]:
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[1693]:
<matplotlib.text.Text at 0x1440704e0>