In [869]:
matplotlib inline
In [870]:
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
In [871]:
from __future__ import print_function

%matplotlib inline
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 11, 4
In [1548]:
#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 [1549]:
#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 [1550]:
#print (aniso_data['lat'])
In [1551]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [1552]:
aniso_data.describe()
Out[1552]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 26.000000 26.000000 26.000000 26.000000 26.000000 2.600000e+01 26.000000 26.000000 26.000000 26.000000 26.000000 26.000000 26.000000 26.0 26.0 26.0 26.0 26.0 26.0 26.000000
mean 41.398800 142.233423 58.966538 5.196154 0.000264 2.013159e+13 1339.007308 1615.721538 1062.294231 87.759615 101.608077 43.301538 57.277692 7.0 5.0 -1.0 0.0 1.0 15.0 -1815.090001
std 1.420218 0.666450 35.199830 0.974261 0.000268 4.500659e+10 1569.137614 1841.183267 1315.094083 52.525290 49.580956 19.066479 25.922763 0.0 0.0 0.0 0.0 0.0 0.0 1652.213996
min 37.520800 140.244000 10.680000 4.000000 -0.000133 2.004091e+13 145.860000 168.720000 75.660000 15.690000 24.610000 9.330000 13.900000 7.0 5.0 -1.0 0.0 1.0 15.0 -5109.146635
25% 41.079250 141.998750 35.060000 4.450000 0.000056 2.009087e+13 204.335000 261.097500 140.800000 43.655000 57.777500 31.277500 31.400000 7.0 5.0 -1.0 0.0 1.0 15.0 -3287.744881
50% 41.913800 142.271500 48.860000 4.850000 0.000235 2.012572e+13 324.490000 470.085000 178.895000 83.055000 111.535000 43.500000 62.005000 7.0 5.0 -1.0 0.0 1.0 15.0 -2060.809912
75% 42.450725 142.345750 69.032500 6.000000 0.000548 2.018086e+13 3084.582500 3678.557500 2334.902500 127.232500 134.535000 57.160000 81.632500 7.0 5.0 -1.0 0.0 1.0 15.0 -13.001186
max 42.796800 144.151000 171.900000 7.100000 0.000680 2.018113e+13 4377.740000 4959.320000 3796.170000 178.130000 174.980000 82.580000 93.580000 7.0 5.0 -1.0 0.0 1.0 15.0 83.344042
In [1553]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [1554]:
#aniso_data['azslow']
In [1555]:
statsOUT = aniso_data.describe()
In [1556]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [1557]:
statsOUT.viso
Out[1557]:
count      26.000000
mean     1339.007308
std      1569.137614
min       145.860000
1%        148.952500
5%        158.885000
10%       166.495000
25%       204.335000
50%       324.490000
75%      3084.582500
90%      3654.610000
95%      3683.057500
99%      4204.490000
max      4377.740000
Name: viso, dtype: float64
In [1558]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
1339.0073076923074 166.495
In [1559]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [1560]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [1561]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [1562]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [1563]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [1564]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [1565]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [1566]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [1567]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [1568]:
#print(aniso_data.time)
In [1569]:
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[1569]:
<matplotlib.text.Text at 0x14182d400>
In [1570]:
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[1570]:
<matplotlib.text.Text at 0x14198fb38>
In [1571]:
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[1571]:
<matplotlib.text.Text at 0x141a3ab38>
In [1572]:
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[1572]:
<matplotlib.text.Text at 0x141b8eba8>
In [1573]:
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[1573]:
<matplotlib.text.Text at 0x141cf4438>
In [1574]:
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[1574]:
<matplotlib.text.Text at 0x141e4ca90>
In [1575]:
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[1575]:
<matplotlib.text.Text at 0x14207dcc0>