In [1974]:
matplotlib inline
In [1975]:
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
In [1976]:
from __future__ import print_function

%matplotlib inline
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 11, 4
In [1977]:
#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 [1978]:
#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 [1979]:
#print (aniso_data['lat'])
In [1980]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [1981]:
aniso_data.describe()
Out[1981]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 416.000000 416.000000 416.000000 416.000000 416.000000 4.160000e+02 416.000000 416.000000 416.000000 416.000000 416.000000 416.000000 416.000000 416.0 416.0 416.0 416.0 416.0 416.0 416.000000
mean 41.894530 142.988731 57.036683 4.906731 0.000251 2.011808e+13 453.398942 542.659063 364.138702 118.696442 49.038269 32.097861 42.178053 7.0 5.0 -1.0 0.0 1.0 15.0 -2337.191789
std 1.571511 1.669502 45.732580 0.914832 0.000248 4.469405e+10 354.141358 406.081858 322.653656 29.885624 39.039319 28.236783 36.855494 0.0 0.0 0.0 0.0 0.0 0.0 1630.639080
min 36.866000 135.105000 0.000000 2.700000 -0.000969 2.002062e+13 155.460000 170.790000 72.300000 6.070000 2.090000 0.190000 0.060000 7.0 5.0 -1.0 0.0 1.0 15.0 -5924.483602
25% 41.496525 142.086000 33.860000 4.200000 0.000070 2.009013e+13 387.300000 497.102500 219.662500 109.732500 25.537500 4.210000 2.087500 7.0 5.0 -1.0 0.0 1.0 15.0 -3508.722276
50% 42.096950 142.571000 51.655000 4.700000 0.000263 2.012031e+13 458.960000 519.180000 384.955000 121.825000 37.825000 28.405000 43.055000 7.0 5.0 -1.0 0.0 1.0 15.0 -2366.301746
75% 42.610875 143.200750 66.857500 5.400000 0.000447 2.015113e+13 486.775000 550.530000 474.727500 134.747500 54.822500 59.212500 77.595000 7.0 5.0 -1.0 0.0 1.0 15.0 -1014.292855
max 49.183300 155.168000 407.780000 9.000000 0.000681 2.018111e+13 7517.520000 8745.430000 6289.600000 177.340000 178.800000 85.600000 99.590000 7.0 5.0 -1.0 0.0 1.0 15.0 69.666328
In [1982]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [1983]:
#aniso_data['azslow']
In [1984]:
statsOUT = aniso_data.describe()
In [1985]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [1986]:
statsOUT.viso
Out[1986]:
count     416.000000
mean      453.398942
std       354.141358
min       155.460000
1%        253.137500
5%        312.750000
10%       338.275000
25%       387.300000
50%       458.960000
75%       486.775000
90%       501.650000
95%       519.465000
99%       568.613500
max      7517.520000
Name: viso, dtype: float64
In [1987]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
453.39894230769227 338.275
In [1988]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [1989]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [1990]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [1991]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [1992]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [1993]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [1994]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [1995]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [1996]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [1997]:
#print(aniso_data.time)
In [1998]:
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[1998]:
<matplotlib.text.Text at 0x149c33518>
In [1999]:
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[1999]:
<matplotlib.text.Text at 0x149e5ad30>
In [2000]:
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[2000]:
<matplotlib.text.Text at 0x149fb7978>
In [2001]:
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[2001]:
<matplotlib.text.Text at 0x14a0605f8>
In [2002]:
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[2002]:
<matplotlib.text.Text at 0x14a1b6c88>
In [2003]:
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[2003]:
<matplotlib.text.Text at 0x14a262a90>
In [2004]:
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[2004]:
<matplotlib.text.Text at 0x14a481dd8>