In [1818]:
matplotlib inline
In [1819]:
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
In [1820]:
from __future__ import print_function

%matplotlib inline
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 11, 4
In [1821]:
#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 [1822]:
#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 [1823]:
#print (aniso_data['lat'])
In [1824]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [1825]:
aniso_data.describe()
Out[1825]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 216.000000 216.000000 216.000000 216.000000 216.000000 2.160000e+02 216.000000 216.000000 216.000000 216.000000 216.000000 216.000000 216.000000 216.0 216.0 216.0 216.0 216.0 216.0 216.000000
mean 41.548069 142.340630 56.050139 5.262963 0.000217 2.012429e+13 367.349167 399.225926 335.471620 122.182083 65.514676 14.549120 16.659537 7.0 5.0 -1.0 0.0 1.0 15.0 -2108.790744
std 2.455119 2.109472 68.018463 1.017164 0.000272 4.548988e+10 230.921914 259.508885 208.046252 41.382280 34.531099 14.563448 25.994807 0.0 0.0 0.0 0.0 0.0 0.0 1667.379406
min 27.052000 131.064000 0.000000 2.900000 -0.000969 2.002112e+13 138.010000 165.690000 110.340000 0.590000 2.920000 0.750000 0.060000 7.0 5.0 -1.0 0.0 1.0 15.0 -5771.551484
25% 41.140525 141.949750 27.545000 4.500000 0.000055 2.009092e+13 339.277500 353.177500 324.830000 127.367500 44.775000 5.920000 0.750000 7.0 5.0 -1.0 0.0 1.0 15.0 -3269.736477
50% 42.016000 142.160500 40.735000 5.100000 0.000224 2.012082e+13 343.315000 357.750000 331.055000 137.245000 52.745000 7.320000 1.440000 7.0 5.0 -1.0 0.0 1.0 15.0 -2203.925923
75% 42.644975 142.717000 64.035000 6.000000 0.000395 2.017073e+13 348.967500 371.945000 334.920000 144.625000 71.702500 18.287500 27.615000 7.0 5.0 -1.0 0.0 1.0 15.0 -420.432987
max 49.183300 155.168000 447.460000 9.000000 0.000683 2.018121e+13 3240.400000 3541.160000 2939.640000 179.700000 172.130000 68.540000 99.220000 7.0 5.0 -1.0 0.0 1.0 15.0 93.895069
In [1826]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [1827]:
#aniso_data['azslow']
In [1828]:
statsOUT = aniso_data.describe()
In [1829]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [1830]:
statsOUT.viso
Out[1830]:
count     216.000000
mean      367.349167
std       230.921914
min       138.010000
1%        269.384000
5%        293.262500
10%       303.465000
25%       339.277500
50%       343.315000
75%       348.967500
90%       364.215000
95%       380.797500
99%      1106.932500
max      3240.400000
Name: viso, dtype: float64
In [1831]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
367.34916666666663 303.46500000000003
In [1832]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [1833]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [1834]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [1835]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [1836]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [1837]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [1838]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [1839]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [1840]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [1841]:
#print(aniso_data.time)
In [1842]:
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[1842]:
<matplotlib.text.Text at 0x146973278>
In [1843]:
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[1843]:
<matplotlib.text.Text at 0x1469ff080>
In [1844]:
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[1844]:
<matplotlib.text.Text at 0x146c21940>
In [1845]:
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[1845]:
<matplotlib.text.Text at 0x146cc3b38>
In [1846]:
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[1846]:
<matplotlib.text.Text at 0x146ee6438>
In [1847]:
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[1847]:
<matplotlib.text.Text at 0x146f7d5f8>
In [1848]:
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[1848]:
<matplotlib.text.Text at 0x147199320>