In [2005]:
matplotlib inline
In [2006]:
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
In [2007]:
from __future__ import print_function

%matplotlib inline
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 11, 4
In [2008]:
#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 [2009]:
#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 [2010]:
#print (aniso_data['lat'])
In [2011]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [2012]:
aniso_data.describe()
Out[2012]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 392.000000 392.000000 392.000000 392.000000 392.000000 3.920000e+02 392.000000 392.000000 392.000000 392.000000 392.000000 392.000000 392.000000 392.0 392.0 392.0 392.0 392.0 392.0 392.000000
mean 42.032829 142.544209 51.399515 4.835204 0.000259 2.012703e+13 665.375816 673.300383 657.451020 25.058903 110.467934 2.340077 0.553189 7.0 5.0 -1.0 0.0 1.0 15.0 -1994.459076
std 1.570583 1.585725 48.835425 1.067150 0.000242 5.416953e+10 11.699731 8.740261 21.309592 23.938803 10.707974 3.215299 4.041857 0.0 0.0 0.0 0.0 0.0 0.0 1988.612404
min 27.860800 131.064000 0.000000 2.900000 -0.000959 2.002071e+13 478.540000 657.640000 253.620000 0.000000 28.670000 0.550000 0.030000 7.0 5.0 -1.0 0.0 1.0 15.0 -5901.138431
25% 41.882925 141.970750 32.210000 4.100000 0.000091 2.008079e+13 661.725000 668.677500 654.997500 17.387500 106.547500 1.780000 0.170000 7.0 5.0 -1.0 0.0 1.0 15.0 -3683.983469
50% 42.400000 142.196500 39.690000 4.700000 0.000270 2.014117e+13 665.685000 672.550000 658.750000 21.585000 111.290000 2.070000 0.250000 7.0 5.0 -1.0 0.0 1.0 15.0 -1375.016320
75% 42.691150 142.985500 62.625000 5.400000 0.000436 2.018091e+13 668.520000 675.867500 661.380000 25.640000 115.315000 2.390000 0.390000 7.0 5.0 -1.0 0.0 1.0 15.0 0.157246
max 47.127700 155.168000 681.710000 9.000000 0.000693 2.018122e+13 702.780000 722.310000 685.970000 179.630000 170.030000 63.950000 79.910000 7.0 5.0 -1.0 0.0 1.0 15.0 108.356364
In [2013]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [2014]:
#aniso_data['azslow']
In [2015]:
statsOUT = aniso_data.describe()
In [2016]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [2017]:
statsOUT.viso
Out[2017]:
count    392.000000
mean     665.375816
std       11.699731
min      478.540000
1%       653.604500
5%       656.411500
10%      658.600000
25%      661.725000
50%      665.685000
75%      668.520000
90%      671.067000
95%      673.723000
99%      698.566300
max      702.780000
Name: viso, dtype: float64
In [2018]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
665.3758163265306 658.6
In [2019]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [2020]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [2021]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [2022]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [2023]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [2024]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [2025]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [2026]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [2027]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [2028]:
#print(aniso_data.time)
In [2029]:
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[2029]:
<matplotlib.text.Text at 0x14a78d7f0>
In [2030]:
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[2030]:
<matplotlib.text.Text at 0x14a908198>
In [2031]:
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[2031]:
<matplotlib.text.Text at 0x14a9aa3c8>
In [2032]:
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[2032]:
<matplotlib.text.Text at 0x14a516240>
In [2033]:
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[2033]:
<matplotlib.text.Text at 0x144d20d30>
In [2034]:
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[2034]:
<matplotlib.text.Text at 0x14ac28ba8>
In [2035]:
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[2035]:
<matplotlib.text.Text at 0x14acd5da0>