In [1694]:
matplotlib inline
In [1695]:
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
In [1696]:
from __future__ import print_function

%matplotlib inline
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 11, 4
In [1697]:
#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 [1698]:
#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 [1699]:
#print (aniso_data['lat'])
In [1700]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [1701]:
aniso_data.describe()
Out[1701]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 463.000000 463.000000 463.000000 463.000000 463.000000 4.630000e+02 463.000000 463.000000 463.000000 463.000000 463.000000 463.000000 463.000000 463.0 463.0 463.0 463.0 463.0 463.0 463.000000
mean 41.750562 142.575343 51.892462 4.945140 0.000249 2.012424e+13 1391.778769 1454.369849 1329.187667 19.635140 107.691361 8.594773 3.056004 7.0 5.0 -1.0 0.0 1.0 15.0 -2103.682208
std 1.770620 1.584614 51.976884 1.076135 0.000247 4.990145e+10 17.366531 21.860249 20.311641 16.621228 5.514912 1.550279 2.744148 0.0 0.0 0.0 0.0 0.0 0.0 1833.551031
min 27.860800 131.064000 0.000000 3.000000 -0.000969 2.002071e+13 1323.380000 1384.960000 1250.380000 4.020000 71.430000 3.440000 0.260000 7.0 5.0 -1.0 0.0 1.0 15.0 -5901.138431
25% 41.545950 141.982500 31.675000 4.100000 0.000079 2.009022e+13 1384.475000 1443.120000 1318.875000 15.335000 105.205000 7.670000 1.580000 7.0 5.0 -1.0 0.0 1.0 15.0 -3485.759505
50% 42.319200 142.327000 40.860000 4.800000 0.000258 2.012121e+13 1392.020000 1452.860000 1329.710000 17.710000 107.590000 8.540000 2.300000 7.0 5.0 -1.0 0.0 1.0 15.0 -2098.400591
75% 42.675650 143.050500 63.035000 5.700000 0.000429 2.018086e+13 1400.110000 1462.875000 1339.745000 20.660000 110.470000 9.420000 3.605000 7.0 5.0 -1.0 0.0 1.0 15.0 -7.063037
max 49.183300 155.168000 681.710000 9.000000 0.000693 2.018122e+13 1457.830000 1590.640000 1399.950000 177.560000 126.440000 17.110000 23.600000 7.0 5.0 -1.0 0.0 1.0 15.0 108.356364
In [1702]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [1703]:
#aniso_data['azslow']
In [1704]:
statsOUT = aniso_data.describe()
In [1705]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [1706]:
statsOUT.viso
Out[1706]:
count     463.000000
mean     1391.778769
std        17.366531
min      1323.380000
1%       1336.856800
5%       1365.000000
10%      1373.894000
25%      1384.475000
50%      1392.020000
75%      1400.110000
90%      1409.334000
95%      1418.411000
99%      1443.133000
max      1457.830000
Name: viso, dtype: float64
In [1707]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
1391.778768898488 1373.894
In [1708]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [1709]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [1710]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [1711]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [1712]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [1713]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [1714]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [1715]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [1716]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [1717]:
#print(aniso_data.time)
In [1718]:
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[1718]:
<matplotlib.text.Text at 0x144204ef0>
In [1719]:
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[1719]:
<matplotlib.text.Text at 0x14442cfd0>
In [1720]:
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[1720]:
<matplotlib.text.Text at 0x14458ea58>
In [1721]:
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[1721]:
<matplotlib.text.Text at 0x144628d68>
In [1722]:
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[1722]:
<matplotlib.text.Text at 0x1446d1898>
In [1723]:
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[1723]:
<matplotlib.text.Text at 0x14477ca90>
In [1724]:
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[1724]:
<matplotlib.text.Text at 0x1449a80b8>