Skip to content

Commit

Permalink
finish comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneweiqiang committed Feb 17, 2022
1 parent ee0db42 commit 5cbad5e
Show file tree
Hide file tree
Showing 6 changed files with 187 additions and 193 deletions.
52 changes: 26 additions & 26 deletions docs/example_phasenet.ipynb

Large diffs are not rendered by default.

23 changes: 11 additions & 12 deletions tests/comparison/real/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@

start=datetime.datetime(2019, 1, 1, 0, 0)
end=datetime.datetime(2019, 1, 2, 0, 0)

#make pick inputfile
# picks = pd.read_csv('synthetic_picks.csv',header = None, sep = ',', names=['timestamp', 'type','jk1','jk2','sta','jk3'])
# picks = pd.read_csv('synthetic_picks.csv',header = None, sep = '\t', names=['timestamp', 'type','jk1','jk2','sta','jk3'])
picks = pd.read_csv('../synthetic_picks.csv',sep = '\t')
picks.rename(columns={"station_id": "sta"}, inplace=True)
picks['date'] = picks['timestamp']
Expand All @@ -34,12 +33,13 @@
pick = picks.iloc[ii]
phase_type = pick['type']
phase_arrival = UTCDateTime(pick['timestamp']) - (UTCDateTime(start) + i * 86400)
if phase_type == 'p':
output_name = dateid+"/"+pick['sta'].split('.')[0] + '.' + pick['sta'].split('.')[1] + ".P.txt"
else:
output_name = dateid+"/"+pick['sta'].split('.')[0] + '.' + pick['sta'].split('.')[1] + ".S.txt"
with open(output_name, 'a') as file:
file.write('{} 1.0 0\n'.format(phase_arrival))
if phase_arrival< 1000:
if phase_type == 'p':
output_name = dateid+"/"+pick['sta'].split('.')[0] + '.' + pick['sta'].split('.')[1] + ".P.txt"
else:
output_name = dateid+"/"+pick['sta'].split('.')[0] + '.' + pick['sta'].split('.')[1] + ".S.txt"
with open(output_name, 'a') as file:
file.write('{} 1.0 0\n'.format(phase_arrival))

#make station inputfile
# stations = pd.read_csv('stations.csv', header = None, sep = ',', names = ['jk1', 'sta', 'stlo', 'stla', 'stev', 'jk2', 'jk3', 'jk4', 'jk5', 'jk6','jk7','jk8','jk9'])
Expand All @@ -54,11 +54,10 @@
start_time = time.time()
for i in range((end-start).days):
D = (start + datetime.timedelta(i)).strftime("%Y/%m/%d")+"/35.705"
R = "0.6/20/0.03/2/5/360/200/35.705/-117.504"
R = "0.6/20/0.03/2/5"
G = "1/20/0.01/1"
V = "6/3.428"
S = "3/3/8/2/0.5/0.1/1.8/0.35"
S = "0/0/10/0/1/0/2/0.2"
command_line = "./REAL -D" + D + " -R" + R + " -S" + S + " -G" + G + " -V" + V + " staton.dat ./" + (start + datetime.timedelta(i)).strftime("%Y%m%d") + " ./tt_db/ttdb.txt"
print(command_line)
os.system(command_line)
print(f"--- {time.time() - start_time} seconds ---")
print(f"--- {time.time() - start_time} seconds ---")
81 changes: 6 additions & 75 deletions tests/comparison/real/tt_db/itvel.nd
Original file line number Diff line number Diff line change
Expand Up @@ -2,80 +2,11 @@
45.00 6.00000 3.42800 2.60000 1456.0 600.0
265.00 6.00000 3.42800 2.60000 1456.0 600.0
mantle
265.00 8.64552 4.67540 3.46264 365.0 143.0
310.00 8.73209 4.70690 3.48951 367.0 143.0
355.00 8.81867 4.73840 3.51639 370.0 143.0
400.00 8.90522 4.76989 3.54325 372.0 143.0
400.00 9.13397 4.93259 3.72378 366.0 143.0
450.00 9.38990 5.07842 3.78678 365.0 143.0
500.00 9.64588 5.22428 3.84980 364.0 143.0
550.00 9.90185 5.37014 3.91282 363.0 143.0
600.00 10.15782 5.51602 3.97584 362.0 143.0
635.00 10.21203 5.54311 3.98399 362.0 143.0
670.00 10.26622 5.57020 3.99214 362.0 143.0
670.00 10.75131 5.94508 4.38071 759.0 312.0
721.00 10.91005 6.09418 4.41241 744.0 312.0
771.00 11.06557 6.24046 4.44317 730.0 312.0
871.00 11.24490 6.31091 4.50372 737.0 312.0
971.00 11.41560 6.37813 4.56307 743.0 312.0
1071.00 11.57828 6.44232 4.62129 750.0 312.0
1171.00 11.73357 6.50370 4.67844 755.0 312.0
1271.00 11.88209 6.56250 4.73460 761.0 312.0
1371.00 12.02445 6.61891 4.78983 766.0 312.0
1471.00 12.16126 6.67317 4.84422 770.0 312.0
1571.00 12.29316 6.72548 4.89783 775.0 312.0
1671.00 12.42075 6.77606 4.95073 779.0 312.0
1771.00 12.54466 6.82512 5.00299 784.0 312.0
1871.00 12.66550 6.87289 5.05469 788.0 312.0
1971.00 12.78389 6.91957 5.10590 792.0 312.0
2071.00 12.90045 6.96538 5.15669 795.0 312.0
2171.00 13.01579 7.01053 5.20713 799.0 312.0
2271.00 13.13055 7.05525 5.25729 803.0 312.0
2371.00 13.24532 7.09974 5.30724 807.0 312.0
2471.00 13.36074 7.14423 5.35706 811.0 312.0
2571.00 13.47742 7.18892 5.40681 815.0 312.0
2671.00 13.59597 7.23403 5.45657 819.0 312.0
2741.00 13.68041 7.26597 5.49145 822.0 312.0
2771.00 13.68753 7.26575 5.50642 823.0 312.0
2871.00 13.71168 7.26486 5.55641 826.0 312.0
2891.00 13.71660 7.26466 5.56645 826.0 312.0
265.00 6.00000 3.42800 2.60000 1456.0 600.0
2891.00 6.00000 3.42800 5.56645 826.0 312.0
outer-core
2891.00 8.06482 0.00000 9.90349 57822.0 0.0
2971.00 8.19939 0.00000 10.02940 57822.0 0.0
3071.00 8.36019 0.00000 10.18134 57822.0 0.0
3171.00 8.51298 0.00000 10.32726 57822.0 0.0
3271.00 8.65805 0.00000 10.46727 57822.0 0.0
3371.00 8.79573 0.00000 10.60152 57822.0 0.0
3471.00 8.92632 0.00000 10.73012 57822.0 0.0
3571.00 9.05015 0.00000 10.85321 57822.0 0.0
3671.00 9.16752 0.00000 10.97091 57822.0 0.0
3771.00 9.27867 0.00000 11.08335 57822.0 0.0
3871.00 9.38418 0.00000 11.19067 57822.0 0.0
3971.00 9.48409 0.00000 11.29298 57822.0 0.0
4071.00 9.57881 0.00000 11.39042 57822.0 0.0
4171.00 9.66865 0.00000 11.48311 57822.0 0.0
4271.00 9.75393 0.00000 11.57119 57822.0 0.0
4371.00 9.83496 0.00000 11.65478 57822.0 0.0
4471.00 9.91206 0.00000 11.73401 57822.0 0.0
4571.00 9.98554 0.00000 11.80900 57822.0 0.0
4671.00 10.05572 0.00000 11.87990 57822.0 0.0
4771.00 10.12291 0.00000 11.94682 57822.0 0.0
4871.00 10.18743 0.00000 12.00989 57822.0 0.0
4971.00 10.24959 0.00000 12.06924 57822.0 0.0
5071.00 10.30971 0.00000 12.12500 57822.0 0.0
5149.50 10.35568 0.00000 12.16634 57822.0 0.0
2891.00 6.00000 3.42800 9.90349 57822.0 0.0
5149.50 6.00000 3.42800 12.16634 57822.0 0.0
inner-core
5149.50 11.02827 3.50432 12.76360 445.0 85.0
5171.00 11.03643 3.51002 12.77493 445.0 85.0
5271.00 11.07249 3.53522 12.82501 443.0 85.0
5371.00 11.10542 3.55823 12.87073 440.0 85.0
5471.00 11.13521 3.57905 12.91211 439.0 85.0
5571.00 11.16186 3.59767 12.94912 437.0 85.0
5671.00 11.18538 3.61411 12.98178 436.0 85.0
5771.00 11.20576 3.62835 13.01009 434.0 85.0
5871.00 11.22301 3.64041 13.03404 433.0 85.0
5971.00 11.23712 3.65027 13.05364 432.0 85.0
6071.00 11.24809 3.65794 13.06888 432.0 85.0
6171.00 11.25593 3.66342 13.07977 431.0 85.0
6271.00 11.26064 3.66670 13.08630 431.0 85.0
6371.00 11.26220 3.66780 13.08848 431.0 85.0
5149.50 6.00000 3.42800 12.76360 445.0 85.0
6371.00 6.00000 3.42800 13.08848 431.0 85.0
Loading

0 comments on commit 5cbad5e

Please sign in to comment.