In [1943]:
matplotlib inline
In [1944]:
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.dates as mdates
In [1945]:
from __future__ import print_function

%matplotlib inline
import matplotlib.pyplot as plt
#plt.style.use('ggplot')
plt.rcParams['figure.figsize'] = 11, 4
In [1946]:
#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 [1947]:
#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 [1948]:
#print (aniso_data['lat'])
In [1949]:
aniso_data['time'] = pd.to_datetime(aniso_data['time'])
In [1950]:
aniso_data.describe()
Out[1950]:
lat long depth mag elapse_diff evid viso vfast vslow azfast azslow azcoeff rms_coeff leng ddeg ns ne f1 f2 elapse_days
count 557.000000 557.000000 557.000000 557.000000 557.000000 5.570000e+02 557.000000 557.000000 557.000000 557.000000 557.000000 557.000000 557.000000 557.0 557.0 557.0 557.0 557.0 557.0 557.000000
mean 41.850257 143.071610 52.582065 5.015619 0.000254 2.011356e+13 1141.957810 1230.188312 1053.726912 130.370610 41.018169 14.256338 7.292298 7.0 5.0 -1.0 0.0 1.0 15.0 -2497.711386
std 1.744925 1.770014 50.946579 0.988999 0.000249 5.094432e+10 40.174569 54.660341 36.939486 9.526988 8.142686 3.197605 5.406796 0.0 0.0 0.0 0.0 0.0 0.0 1862.455150
min 27.860800 131.064000 0.000000 3.300000 -0.000969 2.002071e+13 1056.210000 1108.890000 948.870000 21.240000 0.920000 2.730000 0.650000 7.0 5.0 -1.0 0.0 1.0 15.0 -5901.138431
25% 41.720000 142.084000 31.700000 4.200000 0.000079 2.007120e+13 1118.550000 1198.040000 1032.080000 127.390000 37.420000 12.460000 4.300000 7.0 5.0 -1.0 0.0 1.0 15.0 -3931.069365
50% 42.320500 142.839000 46.790000 4.900000 0.000265 2.011092e+13 1136.500000 1221.250000 1050.040000 131.240000 41.260000 14.060000 6.210000 7.0 5.0 -1.0 0.0 1.0 15.0 -2545.810651
75% 42.637700 143.592000 62.730000 5.700000 0.000431 2.016082e+13 1157.400000 1249.480000 1067.730000 134.400000 44.460000 15.880000 8.630000 7.0 5.0 -1.0 0.0 1.0 15.0 -746.379591
max 49.183300 155.168000 681.710000 9.000000 0.000692 2.018122e+13 1484.790000 1663.680000 1305.900000 166.010000 112.360000 35.540000 77.380000 7.0 5.0 -1.0 0.0 1.0 15.0 108.356364
In [1951]:
#print(aniso_data[aniso_data['vslow'] < 100])
In [1952]:
#aniso_data['azslow']
In [1953]:
statsOUT = aniso_data.describe()
In [1954]:
statsOUT = aniso_data.describe(percentiles=[0.01, 0.05, 0.1, 0.25, 0.75, 0.9, 0.95, 0.99])
In [1955]:
statsOUT.viso
Out[1955]:
count     557.000000
mean     1141.957810
std        40.174569
min      1056.210000
1%       1081.006000
5%       1093.300000
10%      1103.902000
25%      1118.550000
50%      1136.500000
75%      1157.400000
90%      1181.880000
95%      1199.728000
99%      1271.146800
max      1484.790000
Name: viso, dtype: float64
In [1956]:
print (statsOUT.viso['mean'], statsOUT.viso['10%'])
1141.9578096947935 1103.902
In [1957]:
viso_minplot = statsOUT.viso['10%']
viso_maxplot = statsOUT.viso['90%']
In [1958]:
viso_minplot = statsOUT.viso['5%']
viso_maxplot = statsOUT.viso['95%']
In [1959]:
viso_minplot = statsOUT.viso['1%']
viso_maxplot = statsOUT.viso['99%']
In [1960]:
azcoeff_minplot = statsOUT.azcoeff['5%']
azcoeff_maxplot = statsOUT.azcoeff['95%']
In [1961]:
rms_coeff_minplot = statsOUT.rms_coeff['5%']
rms_coeff_maxplot = statsOUT.rms_coeff['95%']
In [1962]:
azfast_minplot = statsOUT.azfast['5%']
azfast_maxplot = statsOUT.azfast['95%']
In [1963]:
azslow_minplot = statsOUT.azslow['5%']
azslow_maxplot = statsOUT.azslow['95%']
In [1964]:
vslow_minplot = statsOUT.vslow['5%']
vslow_maxplot = statsOUT.vslow['95%']
In [1965]:
vfast_minplot = statsOUT.vfast['5%']
vfast_maxplot = statsOUT.vfast['95%']
In [1966]:
#print(aniso_data.time)
In [1967]:
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[1967]:
<matplotlib.text.Text at 0x1492430b8>
In [1968]:
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[1968]:
<matplotlib.text.Text at 0x14946e518>
In [1969]:
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[1969]:
<matplotlib.text.Text at 0x149689b00>
In [1970]:
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[1970]:
<matplotlib.text.Text at 0x149728e10>
In [1971]:
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[1971]:
<matplotlib.text.Text at 0x1497d5518>
In [1972]:
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[1972]:
<matplotlib.text.Text at 0x1499406a0>
In [1973]:
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[1973]:
<matplotlib.text.Text at 0x1499e5e80>