In [1911]:
matplotlib inline
In [1912]:
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
In [1913]:
from __future__ import print_function

%matplotlib inline
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 11, 4
In [1942]:
#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 [1915]:
#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 [1916]:
#print (aniso_data['lat'])
In [1917]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [1918]:
aniso_data.describe()
Out[1918]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 437.000000 437.000000 437.000000 437.000000 437.000000 4.370000e+02 437.000000 437.000000 437.000000 437.000000 437.000000 437.00000 437.000000 437.0 437.0 437.0 437.0 437.0 437.0 437.000000
mean 41.528512 142.852581 54.109863 4.981465 0.000261 2.011757e+13 897.547735 1024.648032 770.447574 119.891739 78.497597 23.41016 41.270046 7.0 5.0 -1.0 0.0 1.0 15.0 -2355.141575
std 2.029114 1.648143 60.059157 1.055479 0.000249 5.047290e+10 92.068455 148.905162 81.649407 65.767048 22.628147 11.99418 34.788997 0.0 0.0 0.0 0.0 0.0 0.0 1846.662928
min 27.860800 134.755000 0.000000 2.800000 -0.000969 2.002112e+13 726.000000 755.210000 620.590000 0.000000 2.400000 3.47000 0.280000 7.0 5.0 -1.0 0.0 1.0 15.0 -5771.551484
25% 41.041800 141.986000 31.420000 4.200000 0.000096 2.008070e+13 820.480000 897.670000 721.250000 59.800000 64.840000 12.57000 8.290000 7.0 5.0 -1.0 0.0 1.0 15.0 -3716.713851
50% 42.080300 142.536000 43.250000 4.900000 0.000276 2.011112e+13 899.640000 1034.970000 749.410000 153.790000 77.400000 22.78000 31.140000 7.0 5.0 -1.0 0.0 1.0 15.0 -2477.321164
75% 42.623300 143.387000 63.190000 5.700000 0.000447 2.017023e+13 955.050000 1129.770000 809.060000 166.690000 90.250000 33.00000 77.030000 7.0 5.0 -1.0 0.0 1.0 15.0 -555.854139
max 49.183300 155.052000 681.710000 9.000000 0.000693 2.018122e+13 1209.680000 1439.430000 1160.050000 179.590000 179.130000 47.15000 99.880000 7.0 5.0 -1.0 0.0 1.0 15.0 108.356364
In [1919]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [1920]:
#aniso_data['azslow']
In [1921]:
statsOUT = aniso_data.describe()
In [1922]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [1923]:
statsOUT.viso
Out[1923]:
count     437.000000
mean      897.547735
std        92.068455
min       726.000000
1%        746.007600
5%        767.324000
10%       777.432000
25%       820.480000
50%       899.640000
75%       955.050000
90%      1010.306000
95%      1048.980000
99%      1167.798000
max      1209.680000
Name: viso, dtype: float64
In [1924]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
897.5477345537757 777.432
In [1925]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [1926]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [1927]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [1928]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [1929]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [1930]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [1931]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [1932]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [1933]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [1934]:
#print(aniso_data.time)
In [1935]:
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[1935]:
<matplotlib.text.Text at 0x148b742e8>
In [1936]:
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[1936]:
<matplotlib.text.Text at 0x148c1deb8>
In [1937]:
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[1937]:
<matplotlib.text.Text at 0x148d79550>
In [1938]:
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[1938]:
<matplotlib.text.Text at 0x148e15da0>
In [1939]:
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[1939]:
<matplotlib.text.Text at 0x148eb8860>
In [1940]:
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[1940]:
<matplotlib.text.Text at 0x148f62198>
In [1941]:
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[1941]:
<matplotlib.text.Text at 0x1490b7828>