In [1756]:
matplotlib inline
In [1757]:
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
In [1758]:
from __future__ import print_function

%matplotlib inline
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 11, 4
In [1759]:
#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 [1760]:
#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 [1761]:
#print (aniso_data['lat'])
In [1762]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [1763]:
aniso_data.describe()
Out[1763]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 261.000000 261.000000 261.000000 261.00000 261.000000 2.610000e+02 261.000000 261.000000 261.000000 261.000000 261.000000 261.000000 261.000000 261.0 261.0 261.0 261.0 261.0 261.0 261.000000
mean 41.890218 142.688368 52.728736 5.19387 0.000216 2.011010e+13 859.110038 873.341686 844.878812 33.085709 121.705326 3.248774 0.929693 7.0 5.0 -1.0 0.0 1.0 15.0 -2621.155980
std 1.649364 1.878604 44.049173 1.01153 0.000244 4.893273e+10 8.298844 11.554408 7.066852 13.598857 9.465635 1.031280 0.944045 0.0 0.0 0.0 0.0 0.0 0.0 1793.852245
min 31.428000 131.064000 0.230000 3.00000 -0.000959 2.002071e+13 844.520000 847.180000 827.990000 7.030000 45.760000 0.630000 0.110000 7.0 5.0 -1.0 0.0 1.0 15.0 -5901.138431
25% 41.738500 141.986000 31.790000 4.50000 0.000048 2.008051e+13 854.990000 867.460000 840.720000 27.700000 117.640000 2.710000 0.550000 7.0 5.0 -1.0 0.0 1.0 15.0 -3773.057460
50% 42.323800 142.506000 45.840000 5.00000 0.000221 2.011012e+13 857.560000 870.720000 844.030000 32.140000 122.040000 3.150000 0.740000 7.0 5.0 -1.0 0.0 1.0 15.0 -2783.513193
75% 42.680200 143.097000 64.000000 5.80000 0.000399 2.015110e+13 860.730000 874.830000 848.150000 36.750000 126.240000 3.640000 1.030000 7.0 5.0 -1.0 0.0 1.0 15.0 -1039.596675
max 46.995700 155.168000 397.260000 9.00000 0.000681 2.018121e+13 925.930000 967.440000 884.420000 177.890000 166.770000 9.620000 10.990000 7.0 5.0 -1.0 0.0 1.0 15.0 93.895069
In [1764]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [1765]:
#aniso_data['azslow']
In [1766]:
statsOUT = aniso_data.describe()
In [1767]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [1768]:
statsOUT.viso
Out[1768]:
count    261.000000
mean     859.110038
std        8.298844
min      844.520000
1%       848.794000
5%       850.940000
10%      852.190000
25%      854.990000
50%      857.560000
75%      860.730000
90%      867.590000
95%      873.320000
99%      882.886000
max      925.930000
Name: viso, dtype: float64
In [1769]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
859.1100383141763 852.19
In [1770]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [1771]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [1772]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [1773]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [1774]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [1775]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [1776]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [1777]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [1778]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [1779]:
#print(aniso_data.time)
In [1780]:
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[1780]:
<matplotlib.text.Text at 0x14558aeb8>
In [1781]:
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[1781]:
<matplotlib.text.Text at 0x1456dc048>
In [1782]:
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[1782]:
<matplotlib.text.Text at 0x1457818d0>
In [1783]:
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[1783]:
<matplotlib.text.Text at 0x14599d7f0>
In [1784]:
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[1784]:
<matplotlib.text.Text at 0x145a3c128>
In [1785]:
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[1785]:
<matplotlib.text.Text at 0x145c573c8>
In [1786]:
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[1786]:
<matplotlib.text.Text at 0x145cfa630>