In [2067]:
matplotlib inline
In [2068]:
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
In [2069]:
from __future__ import print_function

%matplotlib inline
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 11, 4
In [2070]:
#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 [2071]:
#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 [2072]:
#print (aniso_data['lat'])
In [2073]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [2074]:
aniso_data.describe()
Out[2074]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 837.000000 837.000000 837.000000 837.000000 837.000000 8.370000e+02 837.000000 837.000000 837.000000 837.000000 837.000000 837.000000 837.000000 837.0 837.0 837.0 837.0 837.0 837.0 837.000000
mean 41.469223 142.731974 51.493955 4.881481 0.000257 2.011817e+13 368.985783 372.794182 365.177360 51.556344 135.104922 2.023775 0.425544 7.0 5.0 -1.0 0.0 1.0 15.0 -2332.277362
std 2.028657 1.632673 53.831061 1.008815 0.000244 4.929751e+10 3.421974 6.121380 2.780338 19.441178 26.832460 1.362900 1.317502 0.0 0.0 0.0 0.0 0.0 0.0 1804.547802
min 27.052000 131.064000 0.000000 2.800000 -0.000969 2.002062e+13 355.170000 359.290000 348.450000 1.960000 0.320000 0.120000 0.010000 7.0 5.0 -1.0 0.0 1.0 15.0 -5924.483602
25% 40.859000 141.982000 29.150000 4.200000 0.000085 2.008091e+13 367.600000 370.980000 363.420000 39.590000 128.620000 1.410000 0.150000 7.0 5.0 -1.0 0.0 1.0 15.0 -3645.814806
50% 41.986300 142.440000 42.500000 4.800000 0.000265 2.012040e+13 368.790000 372.250000 365.090000 47.420000 136.040000 1.950000 0.240000 7.0 5.0 -1.0 0.0 1.0 15.0 -2348.169183
75% 42.641300 143.127000 63.260000 5.600000 0.000440 2.017021e+13 369.940000 373.680000 366.860000 59.690000 146.950000 2.410000 0.380000 7.0 5.0 -1.0 0.0 1.0 15.0 -570.188257
max 49.183300 155.168000 681.710000 9.000000 0.000693 2.018122e+13 436.130000 523.810000 387.090000 175.740000 179.360000 33.480000 31.010000 7.0 5.0 -1.0 0.0 1.0 15.0 108.356364
In [2075]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [2076]:
#aniso_data['azslow']
In [2077]:
statsOUT = aniso_data.describe()
In [2078]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [2079]:
statsOUT.viso
Out[2079]:
count    837.000000
mean     368.985783
std        3.421974
min      355.170000
1%       363.936400
5%       365.840000
10%      366.466000
25%      367.600000
50%      368.790000
75%      369.940000
90%      371.188000
95%      372.534000
99%      377.027600
max      436.130000
Name: viso, dtype: float64
In [2080]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
368.9857825567503 366.466
In [2081]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [2082]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [2083]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [2084]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [2085]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [2086]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [2087]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [2088]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [2089]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [2090]:
#print(aniso_data.time)
In [2091]:
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[2091]:
<matplotlib.text.Text at 0x139c792b0>
In [2092]:
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[2092]:
<matplotlib.text.Text at 0x14b9fce10>
In [2093]:
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[2093]:
<matplotlib.text.Text at 0x14bb6fd68>
In [2094]:
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[2094]:
<matplotlib.text.Text at 0x14bc1b5c0>
In [2095]:
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[2095]:
<matplotlib.text.Text at 0x14bfc2550>
In [2096]:
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[2096]:
<matplotlib.text.Text at 0x14c12c438>
In [2097]:
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[2097]:
<matplotlib.text.Text at 0x14c29f4e0>