In [1849]:
matplotlib inline
In [1850]:
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
In [1851]:
from __future__ import print_function

%matplotlib inline
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 11, 4
In [1852]:
#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 [1853]:
#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 [1854]:
#print (aniso_data['lat'])
In [1855]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [1856]:
aniso_data.describe()
Out[1856]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 135.000000 135.000000 135.000000 135.000000 135.000000 1.350000e+02 135.000000 135.000000 135.000000 135.000000 135.000000 135.000000 135.000000 135.0 135.0 135.0 135.0 135.0 135.0 135.000000
mean 41.635864 142.568178 56.596815 5.538519 0.000176 2.012133e+13 410.333185 422.688074 397.979704 107.498519 66.833926 5.247481 7.154296 7.0 5.0 -1.0 0.0 1.0 15.0 -2215.244766
std 3.020024 1.611409 74.500050 1.033252 0.000258 4.568450e+10 18.443138 34.463518 27.528751 45.101424 48.177330 9.790017 18.177833 0.0 0.0 0.0 0.0 0.0 0.0 1672.071777
min 18.835000 138.566000 0.000000 3.600000 -0.000969 2.002112e+13 348.870000 406.270000 281.500000 0.310000 0.400000 0.150000 0.010000 7.0 5.0 -1.0 0.0 1.0 15.0 -5771.551484
25% 41.638850 141.951000 27.410000 4.700000 0.000016 2.010032e+13 407.485000 410.410000 403.760000 85.730000 31.315000 0.910000 0.100000 7.0 5.0 -1.0 0.0 1.0 15.0 -3089.692329
50% 42.327800 142.280000 42.680000 5.300000 0.000195 2.012072e+13 409.290000 412.640000 405.890000 120.040000 50.150000 1.410000 0.250000 7.0 5.0 -1.0 0.0 1.0 15.0 -2236.559757
75% 42.696850 143.075500 61.330000 6.300000 0.000344 2.016067e+13 411.690000 416.580000 408.020000 137.750000 91.550000 2.470000 0.755000 7.0 5.0 -1.0 0.0 1.0 15.0 -792.584439
max 49.183300 150.957000 681.710000 9.000000 0.000632 2.018111e+13 540.560000 683.890000 420.710000 175.590000 178.220000 41.910000 87.870000 7.0 5.0 -1.0 0.0 1.0 15.0 69.666328
In [1857]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [1858]:
#aniso_data['azslow']
In [1859]:
statsOUT = aniso_data.describe()
In [1860]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [1861]:
statsOUT.viso
Out[1861]:
count    135.000000
mean     410.333185
std       18.443138
min      348.870000
1%       360.150200
5%       382.404000
10%      405.666000
25%      407.485000
50%      409.290000
75%      411.690000
90%      419.416000
95%      429.389000
99%      475.873400
max      540.560000
Name: viso, dtype: float64
In [1862]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
410.33318518518513 405.66600000000005
In [1863]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [1864]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [1865]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [1866]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [1867]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [1868]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [1869]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [1870]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [1871]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [1872]:
#print(aniso_data.time)
In [1873]:
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[1873]:
<matplotlib.text.Text at 0x147324710>
In [1874]:
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[1874]:
<matplotlib.text.Text at 0x1473bdf60>
In [1875]:
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[1875]:
<matplotlib.text.Text at 0x1475d0f60>
In [1876]:
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[1876]:
<matplotlib.text.Text at 0x14767a198>
In [1877]:
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[1877]:
<matplotlib.text.Text at 0x1477d1e10>
In [1878]:
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[1878]:
<matplotlib.text.Text at 0x1479f8b70>
In [1879]:
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[1879]:
<matplotlib.text.Text at 0x147a9b128>