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 [1520]:
#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 [1521]:
#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 [1522]:
#print (aniso_data['lat'])
In [1523]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [1524]:
aniso_data.describe()
Out[1524]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 404.000000 404.000000 404.000000 404.000000 404.000000 4.040000e+02 404.000000 404.000000 404.000000 404.000000 404.000000 404.000000 404.000000 404.0 404.0 404.0 404.0 404.0 404.0 404.000000
mean 42.009658 142.739129 53.317005 4.835644 0.000261 2.012027e+13 976.040470 1018.452500 933.628614 60.796411 95.107772 8.258292 3.166188 7.0 5.0 -1.0 0.0 1.0 15.0 -2240.142769
std 1.438692 1.423768 50.292633 1.036250 0.000231 5.701924e+10 52.755266 59.947129 50.523004 73.436607 16.566305 2.979429 3.721419 0.0 0.0 0.0 0.0 0.0 0.0 2087.928154
min 27.860800 134.755000 0.010000 2.900000 -0.000740 2.002071e+13 853.400000 885.100000 812.530000 0.040000 12.110000 0.570000 0.140000 7.0 5.0 -1.0 0.0 1.0 15.0 -5901.138431
25% 41.777750 141.985000 32.607500 4.100000 0.000091 2.007050e+13 943.902500 979.005000 904.835000 6.617500 87.765000 6.435000 1.317500 7.0 5.0 -1.0 0.0 1.0 15.0 -4133.268782
50% 42.352700 142.434500 43.000000 4.700000 0.000267 2.014101e+13 968.955000 1010.145000 930.750000 14.720000 95.475000 8.015000 2.320000 7.0 5.0 -1.0 0.0 1.0 15.0 -1425.590166
75% 42.682425 143.142750 62.955000 5.500000 0.000435 2.018091e+13 1000.497500 1045.805000 958.327500 160.867500 102.762500 9.740000 3.677500 7.0 5.0 -1.0 0.0 1.0 15.0 0.006889
max 47.127700 155.052000 681.710000 9.000000 0.000693 2.018122e+13 1248.950000 1331.140000 1166.760000 179.920000 176.210000 23.550000 41.280000 7.0 5.0 -1.0 0.0 1.0 15.0 108.356364
In [1525]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [1526]:
#aniso_data['azslow']
In [1527]:
statsOUT = aniso_data.describe()
In [1528]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [1529]:
statsOUT.viso
Out[1529]:
count     404.000000
mean      976.040470
std        52.755266
min       853.400000
1%        871.440300
5%        901.446500
10%       921.669000
25%       943.902500
50%       968.955000
75%      1000.497500
90%      1042.286000
95%      1070.261500
99%      1128.692600
max      1248.950000
Name: viso, dtype: float64
In [1530]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
976.0404702970296 921.6690000000001
In [1531]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [1532]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [1533]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [1534]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [1535]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [1536]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [1537]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [1538]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [1539]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [1540]:
#print(aniso_data.time)
In [1541]:
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[1541]:
<matplotlib.text.Text at 0x1410877b8>
In [1542]:
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[1542]:
<matplotlib.text.Text at 0x1411307f0>
In [1543]:
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[1543]:
<matplotlib.text.Text at 0x141295240>
In [1544]:
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[1544]:
<matplotlib.text.Text at 0x14132ba90>
In [1545]:
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[1545]:
<matplotlib.text.Text at 0x1413d66d8>
In [1546]:
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[1546]:
<matplotlib.text.Text at 0x141539048>
In [1547]:
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[1547]:
<matplotlib.text.Text at 0x14169dcf8>