In [1725]:
matplotlib inline
In [1726]:
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
In [1727]:
from __future__ import print_function

%matplotlib inline
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 11, 4
In [1728]:
#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 [1729]:
#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 [1730]:
#print (aniso_data['lat'])
In [1731]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [1732]:
aniso_data.describe()
Out[1732]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 307.000000 307.000000 307.000000 307.000000 307.000000 3.070000e+02 307.000000 307.000000 307.000000 307.000000 307.000000 307.000000 307.000000 307.0 307.0 307.0 307.0 307.0 307.0 307.000000
mean 41.819418 142.749199 53.058436 5.119544 0.000240 2.012079e+13 446.007948 475.994951 416.020945 85.790098 100.742866 11.677003 14.277492 7.0 5.0 -1.0 0.0 1.0 15.0 -2228.225142
std 2.390544 1.823806 60.812593 0.931516 0.000258 5.071518e+10 37.083868 56.762437 43.955748 36.799114 66.792615 11.653076 23.610781 0.0 0.0 0.0 0.0 0.0 0.0 1855.796331
min 18.835000 131.064000 0.000000 3.500000 -0.000969 2.002071e+13 165.400000 199.840000 126.220000 2.430000 0.050000 0.760000 0.110000 7.0 5.0 -1.0 0.0 1.0 15.0 -5901.138431
25% 41.707100 141.977000 29.215000 4.500000 0.000075 2.009023e+13 429.550000 443.350000 412.540000 70.985000 27.900000 5.505000 1.270000 7.0 5.0 -1.0 0.0 1.0 15.0 -3479.443054
50% 42.349700 142.506000 41.390000 4.900000 0.000258 2.012121e+13 436.390000 455.170000 418.930000 83.630000 119.060000 7.610000 3.090000 7.0 5.0 -1.0 0.0 1.0 15.0 -2098.409381
75% 42.696850 143.115500 63.365000 5.700000 0.000428 2.017097e+13 458.115000 491.605000 427.440000 102.480000 165.505000 12.205000 15.590000 7.0 5.0 -1.0 0.0 1.0 15.0 -339.164667
max 49.183300 155.168000 681.710000 9.000000 0.000687 2.018121e+13 600.810000 774.510000 521.550000 178.550000 179.610000 77.590000 99.740000 7.0 5.0 -1.0 0.0 1.0 15.0 93.895069
In [1733]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [1734]:
#aniso_data['azslow']
In [1735]:
statsOUT = aniso_data.describe()
In [1736]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [1737]:
statsOUT.viso
Out[1737]:
count    307.000000
mean     446.007948
std       37.083868
min      165.400000
1%       345.579000
5%       420.479000
10%      423.740000
25%      429.550000
50%      436.390000
75%      458.115000
90%      492.978000
95%      513.799000
99%      559.859000
max      600.810000
Name: viso, dtype: float64
In [1738]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
446.0079478827362 423.74
In [1739]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [1740]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [1741]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [1742]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [1743]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [1744]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [1745]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [1746]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [1747]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [1748]:
#print(aniso_data.time)
In [1749]:
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[1749]:
<matplotlib.text.Text at 0x144cb5630>
In [1750]:
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[1750]:
<matplotlib.text.Text at 0x144e2a6a0>
In [1751]:
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[1751]:
<matplotlib.text.Text at 0x144ecb390>
In [1752]:
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[1752]:
<matplotlib.text.Text at 0x144f730b8>
In [1753]:
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[1753]:
<matplotlib.text.Text at 0x14500eda0>
In [1754]:
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[1754]:
<matplotlib.text.Text at 0x1452367f0>
In [1755]:
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[1755]:
<matplotlib.text.Text at 0x1453a7668>