In [2036]:
matplotlib inline
In [2037]:
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
In [2038]:
from __future__ import print_function

%matplotlib inline
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 11, 4
In [2039]:
#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 [2040]:
#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 [2041]:
#print (aniso_data['lat'])
In [2042]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [2043]:
aniso_data.describe()
Out[2043]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 396.000000 396.000000 396.000000 396.000000 396.000000 3.960000e+02 396.000000 396.000000 396.000000 396.000000 396.000000 396.000000 396.000000 396.0 396.0 396.0 396.0 396.0 396.0 396.000000
mean 41.816558 142.650336 52.209116 4.937121 0.000255 2.011023e+13 221.433838 226.594773 216.272172 68.797753 112.434697 4.200051 1.984798 7.0 5.0 -1.0 0.0 1.0 15.0 -2620.182824
std 1.492781 1.731649 44.464417 0.898725 0.000242 5.283271e+10 8.230027 18.925731 7.269605 43.431668 48.913441 5.081038 5.851233 0.0 0.0 0.0 0.0 0.0 0.0 1937.761820
min 31.428000 131.064000 0.000000 2.800000 -0.000959 2.002062e+13 199.820000 201.790000 141.200000 0.650000 0.000000 0.180000 0.010000 7.0 5.0 -1.0 0.0 1.0 15.0 -5924.483602
25% 41.482900 141.988750 31.812500 4.300000 0.000088 2.007049e+13 218.615000 223.950000 211.885000 36.480000 88.740000 1.780000 0.210000 7.0 5.0 -1.0 0.0 1.0 15.0 -4141.576248
50% 42.047900 142.427500 45.110000 4.800000 0.000263 2.011012e+13 221.490000 225.850000 217.485000 60.125000 124.450000 3.265000 0.580000 7.0 5.0 -1.0 0.0 1.0 15.0 -2789.026156
75% 42.630825 143.033750 63.842500 5.500000 0.000431 2.017031e+13 223.927500 227.225000 221.750000 90.935000 149.310000 5.592500 2.482500 7.0 5.0 -1.0 0.0 1.0 15.0 -545.460098
max 47.127700 155.168000 411.180000 9.000000 0.000693 2.018122e+13 357.940000 574.680000 228.420000 179.540000 179.490000 75.430000 79.800000 7.0 5.0 -1.0 0.0 1.0 15.0 106.120111
In [2044]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [2045]:
#aniso_data['azslow']
In [2046]:
statsOUT = aniso_data.describe()
In [2047]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [2048]:
statsOUT.viso
Out[2048]:
count    396.000000
mean     221.433838
std        8.230027
min      199.820000
1%       211.215000
5%       213.827500
10%      215.575000
25%      218.615000
50%      221.490000
75%      223.927500
90%      225.385000
95%      226.147500
99%      230.935000
max      357.940000
Name: viso, dtype: float64
In [2049]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
221.43383838383843 215.575
In [2050]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [2051]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [2052]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [2053]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [2054]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [2055]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [2056]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [2057]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [2058]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [2059]:
#print(aniso_data.time)
In [2060]:
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[2060]:
<matplotlib.text.Text at 0x14ae60630>
In [2061]:
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[2061]:
<matplotlib.text.Text at 0x14b155ac8>
In [2062]:
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[2062]:
<matplotlib.text.Text at 0x14b370518>
In [2063]:
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[2063]:
<matplotlib.text.Text at 0x14b41a278>
In [2064]:
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[2064]:
<matplotlib.text.Text at 0x14b4be7f0>
In [2065]:
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[2065]:
<matplotlib.text.Text at 0x14b564320>
In [2066]:
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[2066]:
<matplotlib.text.Text at 0x14b6c8588>