In [1787]:
matplotlib inline
In [1788]:
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
In [1789]:
from __future__ import print_function

%matplotlib inline
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 11, 4
In [1790]:
#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 [1791]:
#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 [1792]:
#print (aniso_data['lat'])
In [1793]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [1794]:
aniso_data.describe()
Out[1794]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 62.000000 62.000000 62.000000 62.000000 62.000000 6.200000e+01 62.000000 62.000000 62.000000 62.000000 62.000000 62.000000 62.000000 62.0 62.0 62.0 62.0 62.0 62.0 62.000000
mean 41.758934 142.541065 50.986129 5.448387 0.000223 2.012411e+13 377.461129 466.162258 288.760000 94.712097 88.903710 35.347581 45.254677 7.0 5.0 -1.0 0.0 1.0 15.0 -2160.260235
std 1.514253 1.557768 44.767727 1.238421 0.000241 4.147807e+10 111.014401 119.128999 160.214138 42.275484 64.387184 32.421776 40.602254 0.0 0.0 0.0 0.0 0.0 0.0 1523.292667
min 37.836700 138.578000 0.240000 3.100000 -0.000311 2.003093e+13 150.330000 163.290000 80.030000 0.000000 1.490000 0.310000 0.050000 7.0 5.0 -1.0 0.0 1.0 15.0 -5458.929131
25% 41.491025 141.986000 26.787500 4.500000 0.000029 2.010011e+13 312.537500 485.370000 148.480000 71.840000 25.432500 2.155000 0.355000 7.0 5.0 -1.0 0.0 1.0 15.0 -3161.914372
50% 42.150450 142.341500 47.085000 5.200000 0.000206 2.012037e+13 398.350000 497.025000 229.700000 92.155000 80.630000 30.255000 67.120000 7.0 5.0 -1.0 0.0 1.0 15.0 -2340.724221
75% 42.627225 143.010250 64.707500 6.475000 0.000415 2.015781e+13 481.707500 538.902500 476.332500 117.807500 159.810000 71.117500 83.925000 7.0 5.0 -1.0 0.0 1.0 15.0 -998.328107
max 45.300800 150.957000 264.960000 9.000000 0.000662 2.018101e+13 496.690000 573.270000 491.580000 176.190000 179.670000 84.000000 97.710000 7.0 5.0 -1.0 0.0 1.0 15.0 32.984220
In [1795]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [1796]:
#aniso_data['azslow']
In [1797]:
statsOUT = aniso_data.describe()
In [1798]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [1799]:
statsOUT.viso
Out[1799]:
count     62.000000
mean     377.461129
std      111.014401
min      150.330000
1%       156.588600
5%       161.726000
10%      179.403000
25%      312.537500
50%      398.350000
75%      481.707500
90%      490.109000
95%      492.732000
99%      495.787200
max      496.690000
Name: viso, dtype: float64
In [1800]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
377.46112903225804 179.403
In [1801]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [1802]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [1803]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [1804]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [1805]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [1806]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [1807]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [1808]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [1809]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [1810]:
#print(aniso_data.time)
In [1811]:
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[1811]:
<matplotlib.text.Text at 0x145f41d68>
In [1812]:
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[1812]:
<matplotlib.text.Text at 0x1460a7780>
In [1813]:
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[1813]:
<matplotlib.text.Text at 0x146139f60>
In [1814]:
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[1814]:
<matplotlib.text.Text at 0x14635ccf8>
In [1815]:
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[1815]:
<matplotlib.text.Text at 0x1463ff908>
In [1816]:
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[1816]:
<matplotlib.text.Text at 0x146627748>
In [1817]:
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[1817]:
<matplotlib.text.Text at 0x1466cae10>