In [1632]:
matplotlib inline
In [1633]:
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
In [1634]:
from __future__ import print_function

%matplotlib inline
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 11, 4
In [1635]:
#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 [1636]:
#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 [1637]:
#print (aniso_data['lat'])
In [1638]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [1639]:
aniso_data.describe()
Out[1639]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 448.000000 448.000000 448.000000 448.000000 448.000000 4.480000e+02 448.000000 448.000000 448.000000 448.000000 448.000000 448.000000 448.000000 448.0 448.0 448.0 448.0 448.0 448.0 448.000000
mean 41.781605 142.520551 50.081362 4.883259 0.000242 2.013112e+13 607.476853 641.798839 573.154263 133.511384 43.511295 10.689241 7.121429 7.0 5.0 -1.0 0.0 1.0 15.0 -1850.450951
std 2.066581 1.635011 52.372487 1.114842 0.000250 4.714360e+10 5.727785 5.906177 9.405541 4.270977 4.271411 1.593971 10.863708 0.0 0.0 0.0 0.0 0.0 0.0 1729.794972
min 18.835000 131.064000 0.000000 2.600000 -0.000969 2.002071e+13 568.840000 622.980000 474.630000 96.760000 6.770000 7.640000 2.220000 7.0 5.0 -1.0 0.0 1.0 15.0 -5901.138431
25% 41.541900 141.971000 31.307500 4.100000 0.000070 2.010055e+13 605.282500 638.797500 571.127500 132.380000 42.380000 10.050000 4.650000 7.0 5.0 -1.0 0.0 1.0 15.0 -3021.670184
50% 42.320650 142.196500 38.955000 4.700000 0.000247 2.014071e+13 607.290000 641.055000 573.815000 133.605000 43.605000 10.520000 5.315000 7.0 5.0 -1.0 0.0 1.0 15.0 -1523.357993
75% 42.670825 142.916000 62.627500 5.625000 0.000431 2.018091e+13 609.652500 643.502500 576.582500 134.680000 44.680000 10.920000 6.115000 7.0 5.0 -1.0 0.0 1.0 15.0 0.068255
max 49.183300 155.168000 681.710000 9.000000 0.000683 2.018122e+13 645.710000 676.790000 620.080000 161.170000 71.170000 28.420000 95.020000 7.0 5.0 -1.0 0.0 1.0 15.0 108.356364
In [1640]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [1641]:
#aniso_data['azslow']
In [1642]:
statsOUT = aniso_data.describe()
In [1643]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [1644]:
statsOUT.viso
Out[1644]:
count    448.000000
mean     607.476853
std        5.727785
min      568.840000
1%       591.160000
5%       601.519000
10%      603.365000
25%      605.282500
50%      607.290000
75%      609.652500
90%      611.881000
95%      613.585500
99%      627.263400
max      645.710000
Name: viso, dtype: float64
In [1645]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
607.4768526785714 603.365
In [1646]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [1647]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [1648]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [1649]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [1650]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [1651]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [1652]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [1653]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [1654]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [1655]:
#print(aniso_data.time)
In [1656]:
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[1656]:
<matplotlib.text.Text at 0x143839390>
In [1657]:
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[1657]:
<matplotlib.text.Text at 0x14382e320>
In [1658]:
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[1658]:
<matplotlib.text.Text at 0x13fe21400>
In [1659]:
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[1659]:
<matplotlib.text.Text at 0x13d93d400>
In [1660]:
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[1660]:
<matplotlib.text.Text at 0x13d904c18>
In [1661]:
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[1661]:
<matplotlib.text.Text at 0x13d6c9b70>
In [1662]:
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[1662]:
<matplotlib.text.Text at 0x13d599cc0>