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 [1576]:
#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 [1577]:
#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 [1578]:
#print (aniso_data['lat'])
In [1579]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [1580]:
aniso_data.describe()
Out[1580]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 748.000000 748.000000 748.000000 748.000000 748.000000 7.480000e+02 748.000000 748.000000 748.000000 748.000000 748.000000 748.000000 748.000000 748.0 748.0 748.0 748.0 748.0 748.0 748.000000
mean 41.721984 142.841001 51.534398 4.866444 0.000261 2.011953e+13 546.341110 558.898810 533.783596 142.596631 76.179866 4.467955 1.735160 7.0 5.0 -1.0 0.0 1.0 15.0 -2283.062992
std 1.934007 1.724257 51.079936 1.003533 0.000240 4.989718e+10 6.673329 10.051724 7.459165 51.555914 16.276543 1.908200 3.921093 0.0 0.0 0.0 0.0 0.0 0.0 1830.596331
min 18.835000 131.064000 0.000000 2.800000 -0.000969 2.002062e+13 525.270000 537.220000 503.410000 0.300000 0.580000 0.560000 0.070000 7.0 5.0 -1.0 0.0 1.0 15.0 -5924.483602
25% 41.362900 141.986750 30.667500 4.200000 0.000092 2.008090e+13 542.650000 553.305000 529.590000 151.792500 67.907500 3.380000 0.590000 7.0 5.0 -1.0 0.0 1.0 15.0 -3655.687479
50% 42.194850 142.485000 43.640000 4.750000 0.000272 2.012072e+13 545.750000 557.520000 533.625000 161.505000 74.985000 4.290000 1.020000 7.0 5.0 -1.0 0.0 1.0 15.0 -2241.422502
75% 42.676475 143.247250 63.650000 5.500000 0.000435 2.017065e+13 549.310000 562.650000 537.930000 169.075000 83.442500 5.242500 1.870000 7.0 5.0 -1.0 0.0 1.0 15.0 -433.472824
max 49.183300 155.168000 681.710000 9.000000 0.000693 2.018122e+13 584.630000 656.830000 575.620000 179.800000 177.190000 23.360000 73.690000 7.0 5.0 -1.0 0.0 1.0 15.0 108.356364
In [1581]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [1582]:
#aniso_data['azslow']
In [1583]:
statsOUT = aniso_data.describe()
In [1584]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [1585]:
statsOUT.viso
Out[1585]:
count    748.000000
mean     546.341110
std        6.673329
min      525.270000
1%       531.278800
5%       537.521000
10%      539.494000
25%      542.650000
50%      545.750000
75%      549.310000
90%      553.379000
95%      558.213000
99%      568.052900
max      584.630000
Name: viso, dtype: float64
In [1586]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
546.3411096256685 539.4939999999999
In [1587]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [1588]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [1589]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [1590]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [1591]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [1592]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [1593]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [1594]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [1595]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [1596]:
#print(aniso_data.time)
In [1597]:
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[1597]:
<matplotlib.text.Text at 0x1421ff668>
In [1598]:
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[1598]:
<matplotlib.text.Text at 0x14242ab38>
In [1599]:
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[1599]:
<matplotlib.text.Text at 0x1427de3c8>
In [1600]:
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[1600]:
<matplotlib.text.Text at 0x14293da20>
In [1601]:
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[1601]:
<matplotlib.text.Text at 0x142aaf5f8>
In [1602]:
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[1602]:
<matplotlib.text.Text at 0x142c10ef0>
In [1603]:
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[1603]:
<matplotlib.text.Text at 0x142d7da58>