initial upload

This commit is contained in:
2025-12-17 10:53:43 +08:00
commit f3f1778f77
308 changed files with 129940 additions and 0 deletions

View File

@@ -0,0 +1,136 @@
0.000, 5.8000
20.000, 5.8000
20.000, 6.5000
35.000, 6.5000
35.000, 8.0400
77.500, 8.0450
120.000, 8.0500
165.000, 8.1750
210.000, 8.3000
210.000, 8.3000
260.000, 8.4825
310.000, 8.6650
360.000, 8.8475
410.000, 9.0300
410.000, 9.3600
460.000, 9.5280
510.000, 9.6960
560.000, 9.8640
610.000, 10.0320
660.000, 10.2000
660.000, 10.7900
710.000, 10.9229
760.000, 11.0558
809.500, 11.1353
859.000, 11.2221
908.500, 11.3068
958.000, 11.3896
1007.500, 11.4705
1057.000, 11.5495
1106.500, 11.6269
1156.000, 11.7026
1205.500, 11.7766
1255.000, 11.8491
1304.500, 11.9200
1354.000, 11.9895
1403.500, 12.0577
1453.000, 12.1245
1502.500, 12.1912
1552.000, 12.2550
1601.500, 12.3185
1651.000, 12.3819
1700.500, 12.4426
1750.000, 12.5031
1799.500, 12.5631
1849.000, 12.6221
1898.500, 12.6804
1948.000, 12.7382
1997.500, 12.7956
2047.000, 12.8526
2096.500, 12.9096
2146.000, 12.9668
2195.500, 13.0222
2245.000, 13.0783
2294.500, 13.1336
2344.000, 13.1894
2393.500, 13.2465
2443.000, 13.3018
2492.500, 13.3585
2542.000, 13.4156
2591.500, 13.4741
2640.000, 13.5312
2690.000, 13.5900
2740.000, 13.6494
2740.000, 13.6494
2789.670, 13.6530
2839.330, 13.6566
2891.500, 13.6602
2891.500, 8.0000
2939.330, 8.0382
2989.660, 8.1283
3039.990, 8.2213
3090.320, 8.3122
3140.660, 8.4001
3190.990, 8.4861
3241.320, 8.5692
3291.650, 8.6496
3341.980, 8.7283
3392.310, 8.8036
3442.640, 8.8761
3492.970, 8.9461
3543.300, 9.0138
3593.640, 9.0792
3643.970, 9.1426
3694.300, 9.2042
3744.630, 9.2634
3794.960, 9.3205
3845.290, 9.3760
3895.620, 9.4297
3945.950, 9.4814
3996.280, 9.5306
4046.620, 9.5777
4096.950, 9.6232
4147.280, 9.6673
4197.610, 9.7100
4247.940, 9.7513
4298.270, 9.7914
4348.600, 9.8304
4398.930, 9.8682
4449.260, 9.9051
4499.600, 9.9410
4549.930, 9.9761
4600.260, 10.0103
4650.590, 10.0439
4700.920, 10.0768
4801.580, 10.1415
4851.910, 10.1739
4902.240, 10.2049
4952.580, 10.2329
5002.910, 10.2565
5053.240, 10.2745
5103.570, 10.2854
5153.500, 10.2890
5153.500, 11.0427
5204.610, 11.0585
5255.320, 11.0718
5306.040, 11.0850
5356.750, 11.0983
5407.460, 11.1166
5458.170, 11.1316
5508.890, 11.1457
5559.600, 11.1590
5610.310, 11.1715
5661.020, 11.1832
5711.740, 11.1941
5813.160, 11.2134
5863.870, 11.2219
5914.590, 11.2295
5965.300, 11.2364
6016.010, 11.2424
6066.720, 11.2477
6117.440, 11.2521
6168.150, 11.2557
6218.860, 11.2586
6269.570, 11.2606
6320.290, 11.2618
6371.000, 11.2622

View File

@@ -0,0 +1,789 @@
5463, 11.3081
5465, 11.3046
5467, 11.3012
5469, 11.2978
5471, 11.2944
5473, 11.291
5475, 11.2876
5477, 11.2842
5479, 11.2807
5481, 11.2773
5483, 11.2739
5485, 11.2705
5487, 11.2671
5489, 11.2637
5491, 11.2603
5493, 11.2568
5495, 11.2534
5497, 11.25
5499, 11.2466
5501, 11.2431
5503, 11.2395
5505, 11.2359
5507, 11.2323
5509, 11.2288
5511, 11.2252
5513, 11.2216
5515, 11.218
5517, 11.2144
5519, 11.2108
5521, 11.2072
5523, 11.2037
5525, 11.2001
5527, 11.1965
5529, 11.1929
5531, 11.1893
5533, 11.1857
5535, 11.1821
5537, 11.1785
5539, 11.175
5541, 11.1714
5543, 11.1678
5545, 11.1642
5547, 11.1606
5549, 11.157
5551, 11.1534
5553, 11.1499
5555, 11.1463
5557, 11.1427
5559, 11.1391
5561, 11.1355
5563, 11.1319
5565, 11.1283
5567, 11.1247
5569, 11.1212
5571, 11.1176
5573, 11.114
5575, 11.1104
5577, 11.1068
5579, 11.1032
5581, 11.0996
5583, 11.0961
5585, 11.0925
5587, 11.0889
5589, 11.0853
5591, 11.0817
5593, 11.0781
5595, 11.0745
5597, 11.0709
5599, 11.0674
5601, 11.0625
5603, 11.0562
5605, 11.05
5607, 11.0438
5609, 11.0376
5611, 11.0314
5613, 11.0251
5615, 11.0189
5617, 11.0127
5619, 11.0065
5621, 11.0003
5623, 10.994
5625, 10.9878
5627, 10.9816
5629, 10.9754
5631, 10.9691
5633, 10.9629
5635, 10.9567
5637, 10.9505
5639, 10.9443
5641, 10.938
5643, 10.9318
5645, 10.9256
5647, 10.9194
5649, 10.9132
5651, 10.9069
5653, 10.9007
5655, 10.8945
5657, 10.8883
5659, 10.882
5661, 10.8758
5663, 10.8696
5665, 10.8634
5667, 10.8571
5669, 10.8509
5671, 10.8447
5673, 10.8385
5675, 10.8322
5677, 10.826
5679, 10.8198
5681, 10.8136
5683, 10.8073
5685, 10.8011
5687, 10.7949
5689, 10.7887
5691, 10.7824
5693, 10.7762
5695, 10.77
5697, 10.7638
5699, 10.7575
5701, 10.7513
5703, 10.2631
5705, 10.26
5707, 10.2569
5709, 10.2538
5711, 10.2507
5713, 10.2476
5715, 10.2445
5717, 10.2414
5719, 10.2384
5721, 10.2353
5723, 10.2322
5725, 10.2291
5727, 10.226
5729, 10.2229
5731, 10.2198
5733, 10.2167
5735, 10.2136
5737, 10.2105
5739, 10.2074
5741, 10.2043
5743, 10.2012
5745, 10.1981
5747, 10.195
5749, 10.1919
5751, 10.1888
5753, 10.1857
5755, 10.1826
5757, 10.1795
5759, 10.1764
5761, 10.1733
5763, 10.1702
5765, 10.1671
5767, 10.164
5769, 10.1609
5771, 10.1578
5773, 10.1476
5775, 10.1373
5777, 10.1271
5779, 10.1169
5781, 10.1066
5783, 10.0964
5785, 10.0861
5787, 10.0759
5789, 10.0657
5791, 10.0554
5793, 10.0452
5795, 10.035
5797, 10.0247
5799, 10.0145
5801, 10.0042
5803, 9.994
5805, 9.98376
5807, 9.97352
5809, 9.96328
5811, 9.95304
5813, 9.94281
5815, 9.93257
5817, 9.92233
5819, 9.91209
5821, 9.90185
5823, 9.89161
5825, 9.88137
5827, 9.87113
5829, 9.86089
5831, 9.85066
5833, 9.84042
5835, 9.83018
5837, 9.81994
5839, 9.8097
5841, 9.79946
5843, 9.78922
5845, 9.77898
5847, 9.76875
5849, 9.75851
5851, 9.74827
5853, 9.73803
5855, 9.72779
5857, 9.71755
5859, 9.70731
5861, 9.69707
5863, 9.68684
5865, 9.6766
5867, 9.66636
5869, 9.65612
5871, 9.64588
5873, 9.63564
5875, 9.6254
5877, 9.61516
5879, 9.60492
5881, 9.59468
5883, 9.58444
5885, 9.57421
5887, 9.56397
5889, 9.55373
5891, 9.54349
5893, 9.53325
5895, 9.52301
5897, 9.51277
5899, 9.50253
5901, 9.49229
5903, 9.48205
5905, 9.47181
5907, 9.46157
5909, 9.45134
5911, 9.4411
5913, 9.43086
5915, 9.42062
5917, 9.41038
5919, 9.40014
5921, 9.3899
5923, 9.37966
5925, 9.36943
5927, 9.35919
5929, 9.34895
5931, 9.33871
5933, 9.32848
5935, 9.31824
5937, 9.308
5939, 9.29777
5941, 9.28753
5943, 9.27729
5945, 9.26705
5947, 9.25682
5949, 9.24658
5951, 9.23634
5953, 9.2261
5955, 9.21587
5957, 9.20563
5959, 9.19539
5961, 9.18516
5963, 9.17492
5965, 9.16468
5967, 9.15444
5969, 9.14421
5971, 9.13397
5973, 8.90137
5975, 8.89753
5977, 8.89368
5979, 8.88983
5981, 8.88599
5983, 8.88214
5985, 8.87829
5987, 8.87445
5989, 8.8706
5991, 8.86675
5993, 8.86291
5995, 8.85906
5997, 8.85521
5999, 8.85137
6001, 8.84752
6003, 8.84367
6005, 8.83983
6007, 8.83598
6009, 8.83213
6011, 8.82829
6013, 8.82444
6015, 8.82059
6017, 8.81675
6019, 8.8129
6021, 8.80905
6023, 8.8052
6025, 8.80135
6027, 8.79751
6029, 8.79366
6031, 8.78981
6033, 8.78596
6035, 8.78211
6037, 8.77827
6039, 8.77442
6041, 8.77057
6043, 8.76672
6045, 8.76287
6047, 8.75903
6049, 8.75518
6051, 8.75133
6053, 8.74748
6055, 8.74363
6057, 8.73979
6059, 8.73594
6061, 8.73209
6063, 8.72824
6065, 8.72439
6067, 8.72055
6069, 8.7167
6071, 8.71285
6073, 8.709
6075, 8.70516
6077, 8.70131
6079, 8.69746
6081, 8.69361
6083, 8.68977
6085, 8.68592
6087, 8.68207
6089, 8.67822
6091, 8.67438
6093, 8.67053
6095, 8.66668
6097, 8.66283
6099, 8.65899
6101, 8.65514
6103, 8.65129
6105, 8.64744
6107, 8.6436
6109, 8.63975
6111, 8.6359
6113, 8.63206
6115, 8.62821
6117, 8.62436
6119, 8.62051
6121, 8.61667
6123, 8.61282
6125, 8.60897
6127, 8.60513
6129, 8.60128
6131, 8.59743
6133, 8.59358
6135, 8.58974
6137, 8.58589
6139, 8.58204
6141, 8.5782
6143, 8.57435
6145, 8.5705
6147, 8.56665
6149, 8.56281
6151, 8.55896
6153, 7.99096
6155, 7.99223
6157, 7.99349
6159, 7.99475
6161, 7.99601
6163, 7.99728
6165, 7.99854
6167, 7.9998
6169, 8.00107
6171, 8.00233
6173, 8.00359
6175, 8.00485
6177, 8.00612
6179, 8.00738
6181, 8.00864
6183, 8.00991
6185, 8.01117
6187, 8.01243
6189, 8.01368
6191, 8.01493
6193, 8.01618
6195, 8.01743
6197, 8.01868
6199, 8.01993
6201, 8.02119
6203, 8.02244
6205, 8.02369
6207, 8.02494
6209, 8.02619
6211, 8.02744
6213, 8.02869
6215, 8.02995
6217, 8.0312
6219, 8.03245
6221, 8.0337
6223, 8.03494
6225, 8.03618
6227, 8.03742
6229, 8.03866
6231, 8.0399
6233, 8.04114
6235, 8.04238
6237, 8.04362
6239, 8.04486
6241, 8.0461
6243, 8.04734
6245, 8.04858
6247, 8.04982
6249, 8.05106
6251, 8.0523
6253, 8.05354
6255, 8.05478
6257, 8.05601
6259, 8.05724
6261, 8.05847
6263, 8.0597
6265, 8.06092
6267, 8.06215
6269, 8.06338
6271, 8.06461
6273, 8.06583
6275, 8.06706
6277, 8.06829
6279, 8.06952
6281, 8.07074
6283, 8.07197
6285, 8.0732
6287, 8.07443
6289, 8.07565
6291, 8.07688
6293, 8.0781
6295, 8.07932
6297, 8.08054
6299, 8.08176
6301, 8.08297
6303, 8.08419
6305, 8.08541
6307, 8.08663
6309, 8.08785
6311, 8.08907
6313, 8.09028
6315, 8.09149
6317, 8.09271
6319, 8.09392
6321, 8.09513
6323, 8.09634
6325, 8.09755
6327, 8.09877
6329, 8.09998
6331, 8.10119
6333, 8.1024
6335, 8.10361
6337, 8.10481
6339, 8.10602
6341, 8.10723
6343, 8.10844
6345, 8.10964
6347, 6.8
6349, 6.8
6351, 6.8
6353, 6.8
6355, 6.8
6357, 5.8
6359, 5.8
6361, 5.8
6363, 5.8
6365, 5.8
6367, 5.8
6369, 5.8
6371, 5.8
6373, 5.8
6375, 5.8
6377, 5.8
6379, 5.8
6381, 5.8
6383, 5.8
6385, 5.8
6387, 5.8
6389, 5.8
6391, 5.8
6393, 5.8
6395, 5.8
6397, 5.8
6399, 5.8
6401, 5.8
6403, 5.8
6405, 5.8
6407, 5.8
6409, 5.8
6411, 5.8
6413, 5.8
6415, 5.8
6417, 5.8
6419, 5.8
6421, 5.8
6423, 5.8
6425, 5.8
6427, 5.8
6429, 5.8
6431, 5.8
6433, 5.8
6435, 5.8
6437, 5.8
6439, 5.8
6441, 5.8
6443, 5.8
6445, 5.8
6447, 5.8
6449, 5.8
6451, 5.8
6453, 5.8
6455, 5.8
6457, 5.8
6459, 5.8
6461, 5.8
6463, 5.8
6465, 5.8
6467, 5.8
6469, 5.8
6471, 5.8
6473, 5.8
6475, 5.8
6477, 5.8
6479, 5.8
6481, 5.8
6483, 5.8
6485, 5.8
6487, 5.8
6489, 5.8
6491, 5.8
6493, 5.8
6495, 5.8
6497, 5.8
6499, 5.8
6501, 5.8
6503, 5.8
6505, 5.8
6507, 5.8
6509, 5.8
6511, 5.8
6513, 5.8
6515, 5.8
6517, 5.8
6519, 5.8
6521, 5.8
6523, 5.8
6525, 5.8
6527, 5.8
6529, 5.8
6531, 5.8
6533, 5.8
6535, 5.8
6537, 5.8
6539, 5.8
6541, 5.8
6543, 5.8
6545, 5.8
6547, 5.8
6549, 5.8
6551, 5.8
6553, 5.8
6555, 5.8
6557, 5.8
6559, 5.8
6561, 5.8
6563, 5.8
6565, 5.8
6567, 5.8
6569, 5.8
6571, 5.8
6573, 5.8
6575, 5.8
6577, 5.8
6579, 5.8
6581, 5.8
6583, 5.8
6585, 5.8
6587, 5.8
6589, 5.8
6591, 5.8
6593, 5.8
6595, 5.8
6597, 5.8
6599, 5.8
6601, 5.8
6603, 5.8
6605, 5.8
6607, 5.8
6609, 5.8
6611, 5.8
6613, 5.8
6615, 5.8
6617, 5.8
6619, 5.8
6621, 5.8
6623, 5.8
6625, 5.8
6627, 5.8
6629, 5.8
6631, 5.8
6633, 5.8
6635, 5.8
6637, 5.8
6639, 5.8
6641, 5.8
6643, 5.8
6645, 5.8
6647, 5.8
6649, 5.8
6651, 5.8
6653, 5.8
6655, 5.8
6657, 5.8
6659, 5.8
6661, 5.8
6663, 5.8
6665, 5.8
6667, 5.8
6669, 5.8
6671, 5.8
6673, 5.8
6675, 5.8
6677, 5.8
6679, 5.8
6681, 5.8
6683, 5.8
6685, 5.8
6687, 5.8
6689, 5.8
6691, 5.8
6693, 5.8
6695, 5.8
6697, 5.8
6699, 5.8
6701, 5.8
6703, 5.8
6705, 5.8
6707, 5.8
6709, 5.8
6711, 5.8
6713, 5.8
6715, 5.8
6717, 5.8
6719, 5.8
6721, 5.8
6723, 5.8
6725, 5.8
6727, 5.8
6729, 5.8
6731, 5.8
6733, 5.8
6735, 5.8
6737, 5.8
6739, 5.8
6741, 5.8
6743, 5.8
6745, 5.8
6747, 5.8
6749, 5.8
6751, 5.8
6753, 5.8
6755, 5.8
6757, 5.8
6759, 5.8
6761, 5.8
6763, 5.8
6765, 5.8
6767, 5.8
6769, 5.8
6771, 5.8
6773, 5.8
6775, 5.8
6777, 5.8
6779, 5.8
6781, 5.8
6783, 5.8
6785, 5.8
6787, 5.8
6789, 5.8
6791, 5.8
6793, 5.8
6795, 5.8
6797, 5.8
6799, 5.8
6801, 5.8
6803, 5.8
6805, 5.8
6807, 5.8
6809, 5.8
6811, 5.8
6813, 5.8
6815, 5.8
6817, 5.8
6819, 5.8
6821, 5.8
6823, 5.8
6825, 5.8
6827, 5.8
6829, 5.8
6831, 5.8
6833, 5.8
6835, 5.8
6837, 5.8
6839, 5.8
6841, 5.8
6843, 5.8
6845, 5.8
6847, 5.8
6849, 5.8
6851, 5.8
6853, 5.8
6855, 5.8
6857, 5.8
6859, 5.8
6861, 5.8
6863, 5.8
6865, 5.8
6867, 5.8
6869, 5.8
6871, 5.8
6873, 5.8
6875, 5.8
6877, 5.8
6879, 5.8
6881, 5.8
6883, 5.8
6885, 5.8
6887, 5.8
6889, 5.8
6891, 5.8
6893, 5.8
6895, 5.8
6897, 5.8
6899, 5.8
6901, 5.8
6903, 5.8
6905, 5.8
6907, 5.8
6909, 5.8
6911, 5.8
6913, 5.8
6915, 5.8
6917, 5.8
6919, 5.8
6921, 5.8
6923, 5.8
6925, 5.8
6927, 5.8
6929, 5.8
6931, 5.8
6933, 5.8
6935, 5.8
6937, 5.8
6939, 5.8
6941, 5.8
6943, 5.8
6945, 5.8
6947, 5.8
6949, 5.8
6951, 5.8
6953, 5.8
6955, 5.8
6957, 5.8
6959, 5.8
6961, 5.8
6963, 5.8
6965, 5.8
6967, 5.8
6969, 5.8
6971, 5.8
6973, 5.8
6975, 5.8
6977, 5.8
6979, 5.8
6981, 5.8
6983, 5.8
6985, 5.8
6987, 5.8
6989, 5.8
6991, 5.8
6993, 5.8
6995, 5.8
6997, 5.8
6999, 5.8
7001, 5.8
7003, 5.8
7005, 5.8
7007, 5.8
7009, 5.8
7011, 5.8
7013, 5.8
7015, 5.8
7017, 5.8
7019, 5.8
7021, 5.8
7023, 5.8
7025, 5.8
7027, 5.8
7029, 5.8
7031, 5.8
7033, 5.8
7035, 5.8
7037, 5.8
7039, 5.8

View File

@@ -0,0 +1,2 @@
1
50.0 40.0 67.5

View File

@@ -0,0 +1,19 @@
# Inversion test
This is a test setup for inversion calculation.
1. Run all cells of `make_test_model.ipynb` for creating
- source, receiver file
- true model
- initial model
2. then run TOMOATT forward with `input_params_pre.yml` for calculating the true arrival times at the stations
-> this will output src_rec_result.dat file which includes the arrival time at each station
3. run TOMOATT in inversion mode with `input_params.yml`.
4. at first, TOMOATT calculates 2d traveltime field for each teleseismic event.
TOMOATT will find the event source is teleseismic if the event origin is outside of the simulation domain.
Calculated 2d traveltime field is saved in OUTPUT_FILES directory with 2d_travel_time_field_{src_id}.h5
2D solver run will be skipped if this file is found by TOMOATT.

View File

@@ -0,0 +1,51 @@
50
0.0 39.48283902145424 29.281513864182138
0.0 43.998782050303745 37.19643899137363
0.0 37.30760565117001 33.11401338760367
0.0 41.68653979748724 35.934639928020964
0.0 36.61537788634567 23.78498599183464
0.0 39.53372622366508 23.841070463667265
0.0 40.35236327081236 19.52357011656586
0.0 40.521021601341126 15.382805946506043
0.0 40.652338638485574 15.43974831654911
0.0 36.06181789303116 31.492644232896822
0.0 40.220383199721056 30.131592405768828
0.0 32.690556139214564 29.12155270260603
0.0 41.38557105851774 21.887079844236876
0.0 31.5803169410531 15.828284584124932
0.0 39.72076150617663 29.444060586520337
0.0 39.153291824326395 15.348344308914173
0.0 37.3196743759749 24.882795770531047
0.0 45.38532464248119 31.54872211314764
0.0 35.027710629652205 20.71225367598449
0.0 34.73430718282967 30.761114486702205
0.0 41.62771310002017 20.964465183242254
0.0 41.96541753785979 22.638041556854436
0.0 34.18819520502442 31.526202657153434
0.0 33.289630995715136 26.11544195974523
0.0 44.99003971165912 31.18999369792465
0.0 43.71764805530941 27.09889711083143
0.0 39.149408331767305 24.672389827246107
0.0 40.94054916696042 19.539882515019904
0.0 39.55054219303491 17.883860634990157
0.0 45.51670367081901 35.889274144396786
0.0 45.09106334932971 23.658196610348384
0.0 45.3510270418072 33.647693941540325
0.0 38.04870033400669 25.845480891830285
0.0 40.2502568580665 27.674022408814878
0.0 38.91110035012384 23.488821700130032
0.0 33.038736736209884 31.45966132466628
0.0 45.13288373382176 32.43630443882502
0.0 38.95996799830328 24.837368712391495
0.0 43.491229999719096 29.79312700226344
0.0 35.465004203274056 33.62459653703114
0.0 40.21403161430093 17.72710938876384
0.0 39.55239238847392 19.234971464234178
0.0 35.94933583184151 22.513051849149996
0.0 44.119556199620654 20.89644919626955
0.0 35.522471813078226 19.309847752271143
0.0 41.32129208930305 29.532291144989525
0.0 38.64267131605151 25.351066793111908
0.0 34.925624689463994 33.227497100537946
0.0 33.199759796131325 22.212825309023625
0.0 34.47881106709583 28.51463648501263

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
1
50.0 40.0 67.5

View File

@@ -0,0 +1,51 @@
50
0 39.48283902145424 29.281513864182138
0 43.998782050303745 37.19643899137363
0 37.30760565117001 33.11401338760367
0 41.68653979748724 35.934639928020964
0 36.61537788634567 23.78498599183464
0 39.53372622366508 23.841070463667265
0 40.35236327081236 19.52357011656586
0 40.521021601341126 15.382805946506043
0 40.652338638485574 15.43974831654911
0 36.06181789303116 31.492644232896822
0 40.220383199721056 30.131592405768828
0 32.690556139214564 29.12155270260603
0 41.38557105851774 21.887079844236876
0 31.5803169410531 15.828284584124932
0 39.72076150617663 29.444060586520337
0 39.153291824326395 15.348344308914173
0 37.3196743759749 24.882795770531047
0 45.38532464248119 31.54872211314764
0 35.027710629652205 20.71225367598449
0 34.73430718282967 30.761114486702205
0 41.62771310002017 20.964465183242254
0 41.96541753785979 22.638041556854436
0 34.18819520502442 31.526202657153434
0 33.289630995715136 26.11544195974523
0 44.99003971165912 31.18999369792465
0 43.71764805530941 27.09889711083143
0 39.149408331767305 24.672389827246107
0 40.94054916696042 19.539882515019904
0 39.55054219303491 17.883860634990157
0 45.51670367081901 35.889274144396786
0 45.09106334932971 23.658196610348384
0 45.3510270418072 33.647693941540325
0 38.04870033400669 25.845480891830285
0 40.2502568580665 27.674022408814878
0 38.91110035012384 23.488821700130032
0 33.038736736209884 31.45966132466628
0 45.13288373382176 32.43630443882502
0 38.95996799830328 24.837368712391495
0 43.491229999719096 29.79312700226344
0 35.465004203274056 33.62459653703114
0 40.21403161430093 17.72710938876384
0 39.55239238847392 19.234971464234178
0 35.94933583184151 22.513051849149996
0 44.119556199620654 20.89644919626955
0 35.522471813078226 19.309847752271143
0 41.32129208930305 29.532291144989525
0 38.64267131605151 25.351066793111908
0 34.925624689463994 33.227497100537946
0 33.199759796131325 22.212825309023625
0 34.47881106709583 28.51463648501263

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,89 @@
88
0.00 5.80000 3.20000 2.60000 1456.0 600.0
15.00 5.80000 3.20000 2.60000 1456.0 600.0
15.00 6.80000 3.90000 2.90000 1350.0 600.0
24.40 6.80000 3.90000 2.90000 1350.0 600.0
24.40 8.11061 4.49094 3.38076 1446.0 600.0
40.00 8.10119 4.48486 3.37906 1446.0 600.0
60.00 8.08907 4.47715 3.37688 1447.0 600.0
80.00 8.07688 4.46953 3.37471 195.0 80.0
115.00 8.05540 4.45643 3.37091 195.0 80.0
150.00 8.03370 4.44361 3.36710 195.0 80.0
185.00 8.01180 4.43108 3.36330 195.0 80.0
220.00 7.98970 4.41885 3.35950 195.0 80.0
220.00 8.55896 4.64391 3.43578 362.0 143.0
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
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
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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,47 @@
version : 2
domain :
#min_max_dep : [-21.863,308.8137] # depth in km
min_max_dep : [-29.0, 301.0] # depth in km with R = 6371.0
min_max_lat : [28.5,51.5] # latitude in degree
min_max_lon : [13.5,41.5] # longitude in degree
n_rtp : [55,55,55] # number of nodes
source :
#src_dep_lat_lon : [5.0,40.0,24.0] # source depth in km, latitude, longitude in degree
#src_dep_lat_lon : [5750.6370,46.0,36.0] # source depth in km, latitude, longitude in degree
src_rec_file : 'OUTPUT_FILES/src_rec_file_forward.dat' # source receiver file (if found, src_dep_lat_lon is ignored)
swap_src_rec : 0 # swap source and receiver
model :
init_model_type : '' # 'fd' (input file) or '1d_ak135'
init_model_path : './test_model_init.h5' # path to initial model file (ignored if init_model_type is '1d_*')
inversion :
run_mode : 1 # 0 for forward simulation only, 1 for inversion
n_inversion_grid : 5 # number of inversion grid sets
n_inv_dep_lat_lon : [11,10,10] # number of the base inversion grid points
min_max_dep_inv : [-29.0, 301.0] # depth in km with R = 6371.0
min_max_lat_inv : [30.0,50.0] # latitude in degree
min_max_lon_inv : [15.0,40.0] # longitude in degree
#smooth_method : 1 # 0: multigrid parametrization, 1: laplacian smoothing with CG
#l_smooth_rtp : [0.9,0.9,0.9] # smoothing coefficients for each direction
max_iterations_inv : 100 # maximum number of inversion iterations
step_size : 0.01 # step size for inversion
parallel :
n_sims : 1 # number of simultaneous run
ndiv_rtp : [1,2,2] # number of subdomains
nproc_sub : 2 # number of subprocess used for each subdomain
use_gpu : 0
calculation :
convergence_tolerance : 1e-5
max_iterations : 100
stencil_order : 3 # 1 or 3
sweep_type : 1 # 0: legacy, 1: cuthill-mckee with shm parallelization
output_file_format : 0 # 0: hdf5, 1: ascii

View File

@@ -0,0 +1,34 @@
version : 2
domain :
#min_max_dep : [-21.863,308.8137] # depth in km
min_max_dep : [-29.0, 301.0] # depth in km with R = 6371.0
min_max_lat : [28.5,51.5] # latitude in degree
min_max_lon : [13.5,41.5] # longitude in degree
n_rtp : [55,55,55] # number of nodes
source :
src_rec_file : 'src_rec_test.dat' # source receiver file (if found, src_dep_lat_lon is ignored)
swap_src_rec : 0 # swap source and receiver
model :
init_model_path : './test_model_true.h5' # path to initial model file (ignored if init_model_type is '1d_*')
inversion :
run_mode : 0 # 0 for forward simulation only, 1 for inversion
n_inversion_grid : 1
parallel :
n_sims : 1 # number of simultaneous run
ndiv_rtp : [1,2,2] # number of subdomains
nproc_sub : 2 # number of subprocess used for each subdomain
calculation :
convergence_tolerance : 1e-5
max_iterations : 1000
stencil_order : 3 # 1 or 3
sweep_type : 1 # 0: legacy, 1: cuthill-mckee with shm parallelization
output_file_format : 0 # 0: hdf5, 1: ascii

View File

@@ -0,0 +1,412 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# notebook for create init and true test model"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import math\n",
"\n",
"# grid\n",
"R_earth = 6371.0 #6378.1370\n",
"\n",
"rr1=6070\n",
"rr2=6400\n",
"tt1=(30.0-1.5)/180*math.pi\n",
"tt2=(50.0+1.5)/180*math.pi\n",
"pp1=(15.0-1.5)/180*math.pi\n",
"pp2=(40.0+1.5)/180*math.pi\n",
"\n",
"n_rtp = [55,55,55]\n",
"dr = (rr2-rr1)/(n_rtp[0]-1)\n",
"dt = (tt2-tt1)/(n_rtp[1]-1)\n",
"dp = (pp2-pp1)/(n_rtp[2]-1)\n",
"rr = np.array([rr1 + x*dr for x in range(n_rtp[0])])\n",
"tt = np.array([tt1 + x*dt for x in range(n_rtp[1])])\n",
"pp = np.array([pp1 + x*dp for x in range(n_rtp[2])])\n",
"\n",
"# initial model\n",
"gamma = 0.0\n",
"#s0 = 1.0/6.0\n",
"slow_p=0.04\n",
"ani_p=0.03\n",
"\n",
"eta_init = np.zeros(n_rtp)\n",
"xi_init = np.zeros(n_rtp)\n",
"zeta_init = np.zeros(n_rtp)\n",
"fun_init = np.zeros(n_rtp)\n",
"vel_init = np.zeros(n_rtp)\n",
"\n",
"# true model\n",
"eta_true = np.zeros(n_rtp)\n",
"xi_true = np.zeros(n_rtp)\n",
"zeta_true = np.zeros(n_rtp)\n",
"fun_true = np.zeros(n_rtp)\n",
"vel_true = np.zeros(n_rtp)\n",
"\n",
"c=0\n",
"for ir in range(n_rtp[2]):\n",
" for it in range(n_rtp[1]):\n",
" for ip in range(n_rtp[0]):\n",
" #eta_init[ir,it,ip] = 0.0\n",
" #xi_init[ir,it,ip] = 0.0\n",
" zeta_init[ir,it,ip] = gamma*math.sqrt(eta_init[ir,it,ip]**2 + xi_init[ir,it,ip]**2)\n",
" \n",
" if (rr[ir]>6351):\n",
" fun_init[ir,it,ip] = 1.0/(5.8+(6371-rr[ir])/20.0*0.7)\n",
" elif (rr[ir]>6336):\n",
" fun_init[ir,it,ip] = 1.0/(6.5+(6351-rr[ir])/15.0*0.6)\n",
" elif (rr[ir]>5961):\n",
" fun_init[ir,it,ip] = 1.0/(8.0+(6336-rr[ir])/375.0*1) \n",
" else:\n",
" fun_init[ir,it,ip] = 1.0/9.0\n",
"\n",
" vel_init[ir,it,ip] = 1.0/fun_init[ir,it,ip]\n",
"\n",
" # true model\n",
" if (tt[it] >= 30.0/180.0*math.pi and tt[it] <= 50.0/180.0*math.pi \\\n",
" and pp[ip] >= 15.0/180.0*math.pi and pp[ip] <= 40.0/180.0*math.pi \\\n",
" and rr[ir] >= 6211.0 and rr[ir] <= 6371.0):\n",
" c+=1\n",
" sigma = math.sin(4.0*math.pi*(tt[it]-30.0/180.0*math.pi)/(20.0/180.0*math.pi)) \\\n",
" *math.sin(4.0*math.pi*(pp[ip]-15.0/180.0*math.pi)/(25.0/180.0*math.pi)) \\\n",
" *math.sin(2.0*math.pi*(rr[ir]-6211.0)/160.0)\n",
" else:\n",
" sigma = 0.0\n",
"\n",
" if sigma < 0:\n",
" psi = 60.0/180.0*math.pi\n",
" elif sigma > 0:\n",
" psi = 150.0/180.0*math.pi\n",
" else:\n",
" psi = 0.0\n",
"\n",
" eta_true[ir,it,ip] = ani_p*abs(sigma)*math.sin(2.0*psi)\n",
" xi_true[ir,it,ip] = ani_p*abs(sigma)*math.cos(2.0*psi)\n",
" zeta_true[ir,it,ip] = gamma*math.sqrt(eta_true[ir,it,ip]**2 + xi_true[ir,it,ip]**2)\n",
" fun_true[ir,it,ip] = fun_init[ir,it,ip]/(1.0+sigma*slow_p)\n",
" vel_true[ir,it,ip] = 1.0/fun_true[ir,it,ip] \n",
"\n",
"\n",
"\n",
"r_earth = R_earth #6378.1370\n",
"print(\"depminmax {} {}\".format(r_earth-rr1,r_earth-rr2))\n",
"print(c)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# write out\n",
"import h5py\n",
"\n",
"fout_init = h5py.File('test_model_init.h5', 'w')\n",
"fout_true = h5py.File('test_model_true.h5', 'w')\n",
"\n",
"# write out the arrays eta_init, xi_init, zeta_init, fun_init, a_init, b_init, c_init, f_init\n",
"fout_init.create_dataset('eta', data=eta_init)\n",
"fout_init.create_dataset('xi', data=xi_init)\n",
"fout_init.create_dataset('zeta',data=zeta_init)\n",
"fout_init.create_dataset('vel', data=vel_init)\n",
"\n",
"# writeout the arrays eta_true, xi_true, zeta_true, fun_true, a_true, b_true, c_true, f_true\n",
"fout_true.create_dataset('eta', data=eta_true)\n",
"fout_true.create_dataset('xi', data=xi_true)\n",
"fout_true.create_dataset('zeta',data=zeta_true)\n",
"fout_true.create_dataset('vel', data=vel_true)\n",
"\n",
"fout_init.close()\n",
"fout_true.close()\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# prepare src station file\n",
"\n",
"```\n",
" 26 1992 1 1 2 43 56.900 1.8000 98.9000 137.00 2.80 8 305644 <- src  : id_src year month day hour min sec lat lon dep_km mag num_recs id_event\n",
" 26 1 PCBI 1.8900 98.9253 1000.0000 P 10.40 18.000 <- arrival : id_src id_rec name_rec lat lon elevation_m phase epicentral_distance_km arrival_time_sec\n",
" 26 2 MRPI 1.6125 99.3172 1100.0000 P 50.84 19.400\n",
" 26 3 HUTI 2.3153 98.9711 1600.0000 P 57.84 19.200\n",
"\n",
"```"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import random\n",
"random.seed(123456789)\n",
"\n",
"# dummys\n",
"year_dummy = 1998\n",
"month_dummy = 1\n",
"day_dummy = 1\n",
"hour_dummy = 0\n",
"minute_dummy = 0\n",
"second_dummy = 0\n",
"mag_dummy = 3.0\n",
"id_dummy = 1000\n",
"st_name_dummy = 'AAAA'\n",
"phase_dummy = 'P'\n",
"dist_dummy = 100.0\n",
"arriv_t_dummy = 0.0\n",
"\n",
"tt1deg = tt1 * 180.0/math.pi\n",
"tt2deg = tt2 * 180.0/math.pi\n",
"pp1deg = pp1 * 180.0/math.pi\n",
"pp2deg = pp2 * 180.0/math.pi\n",
"\n",
"\n",
"n_src = 1\n",
"n_rec = [1 for x in range(n_src)]\n",
"\n",
"\n",
"lines = []\n",
"\n",
"pos_src=[]\n",
"pos_rec=[]\n",
"\n",
"# teleseismic events\n",
"n_src_tele = 1\n",
"center_lon = (pp2deg+pp1deg)/2.0\n",
"center_lat = (tt2deg+tt1deg)/2.0\n",
"r_src = 40 # deg\n",
"d_r = 360.0/n_src_tele\n",
"\n",
"# use fixed coordinate for test\n",
"dep_srcs = [50.0]\n",
"lon_srcs = [67.5]\n",
"lat_srcs = [40.0]\n",
"\n",
"elev_recs = []\n",
"lon_recs = []\n",
"lat_recs = []\n",
"\n",
"# read STATIONS\n",
"f = open('fortran_code/ega5/input/STATIONS', 'r')\n",
"for line in f:\n",
" lines.append(line)\n",
"f.close()\n",
"\n",
"n_rec_tmp=0\n",
"for l in lines:\n",
" if l[0] == '#':\n",
" continue\n",
" else:\n",
" items = l.split()\n",
" if (len(items) == 3):\n",
" elev_recs.append(float(items[0]))\n",
" lat_recs.append(float(items[1]))\n",
" lon_recs.append(float(items[2]))\n",
" n_rec_tmp += 1\n",
"\n",
"n_rec[0] = n_rec_tmp\n",
"\n",
"#for i in range(n_src_tele):\n",
"# dep = 50.0\n",
"# lon = math.cos(d_r*i/180.0*math.pi)*r_src + center_lon\n",
"# lat = math.sin(d_r*i/180.0*math.pi)*r_src + center_lat\n",
"# dep_srcs.append(dep)\n",
"# lon_srcs.append(lon)\n",
"# lat_srcs.append(lat)\n",
"#\n",
"## regional events\n",
"#n_src_reg = 0\n",
"#for i in range(n_src_reg):\n",
"# dep = random.uniform(r_earth-rr1,r_earth-rr2)\n",
"# lon = random.uniform(pp1deg,pp2deg)\n",
"# lat = random.uniform(tt1deg,tt2deg)\n",
"# dep_srcs.append(dep)\n",
"# lon_srcs.append(lon)\n",
"# lat_srcs.append(lat)\n",
"#\n",
"#n_src = n_src_tele + n_src_reg\n",
"#\n",
"## create receiver coordinates\n",
"#n_rec = [50 for i in range(n_src)]\n",
"#elev_recs=[]\n",
"#lon_recs=[]\n",
"#lat_recs=[]\n",
"#rec_names=[]\n",
"#for i in range(n_rec[0]):\n",
"# #elev_recs.append(random.uniform(-100.0,-100.0)) # elevation in m\n",
"# elev_recs.append(0) # elevation in m\n",
"# lon_recs .append(random.uniform(pp1deg*1.1,pp2deg*0.9))\n",
"# lat_recs .append(random.uniform(tt1deg*1.1,tt2deg*0.9))\n",
"# rec_names.append(i)\n",
"\n",
"\n",
"\n",
"# create dummy src\n",
"lines=[]\n",
"for i_src in range(n_src):\n",
" # define one point in the domain (rr1 bottom, rr2 top)\n",
" dep = dep_srcs[i_src]\n",
" lon = lon_srcs[i_src]\n",
" lat = lat_srcs[i_src]\n",
"\n",
" src = [i_src, year_dummy, month_dummy, day_dummy, hour_dummy, minute_dummy, second_dummy, lat, lon, dep, mag_dummy, n_rec[i_src], id_dummy]\n",
" lines.append(src)\n",
"\n",
" pos_src.append([lon,lat,dep])\n",
"\n",
" # create dummy station\n",
" for i_rec in range(n_rec[i_src]):\n",
" #elev_rec = random.uniform(0.0,-10.0) # elevation in m\n",
" #lon_rec = random.uniform(pp1deg,pp2deg)\n",
" #lat_rec = random.uniform(tt1deg,tt2deg)\n",
"\n",
" rec = [i_src, i_rec, st_name_dummy+\"_\"+str(i_rec), lat_recs[i_rec], lon_recs[i_rec], elev_recs[i_rec], phase_dummy, dist_dummy, arriv_t_dummy]\n",
" lines.append(rec)\n",
"\n",
" pos_rec.append([lon_recs[i_rec],lat_recs[i_rec],elev_recs[i_rec]])\n",
"\n",
"# write out ev_arrivals file\n",
"fname = 'src_rec_test.dat'\n",
"\n",
"with open(fname, 'w') as f:\n",
" for line in lines:\n",
" for elem in line:\n",
" f.write('{} '.format(elem))\n",
" f.write('\\n')\n",
" "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# draw src and rec positions\n",
"import matplotlib.pyplot as plt\n",
"\n",
"for i_src in range(n_src):\n",
" plt.scatter(pos_src[i_src][1],pos_src[i_src][0],c='r',marker='o')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# plot receivers\n",
"for i_rec in range(n_rec[0]):\n",
" plt.scatter(pos_rec[i_rec][1],pos_rec[i_rec][0],c='b',marker='o')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# output source and receiver file for fortran code\n",
"fname_source = \"EARTHQUAKES_tele\"\n",
"fname_station=\"STATIONS\"\n",
"\n",
"# write out number of sources\n",
"with open(fname_source, 'w') as f:\n",
" f.write('{}\\n'.format(n_src))\n",
" # write out depth lat lon \n",
" for i_src in range(n_src):\n",
" f.write('{} {} {}\\n'.format(dep_srcs[i_src],lat_srcs[i_src],lon_srcs[i_src]))\n",
"\n",
"\n",
"# write out number of stations\n",
"with open(fname_station, 'w') as f:\n",
" f.write('{}\\n'.format(n_rec[0]))\n",
" # write out depth lat lon (convert elevation to depth)\n",
" for i_rec in range(n_rec[0]):\n",
" f.write('{} {} {}\\n'.format(elev_recs[i_rec],lat_recs[i_rec],lon_recs[i_rec]))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# write out in ASCIII\n",
"\n",
"#\n",
"\n",
"fname_init = 'test_model_init.dat'\n",
"fname_true = 'test_model_true.dat'\n",
"\n",
"\n",
"# write init model\n",
"with open(fname_init, 'w') as f:\n",
" # write nodes in rtp\n",
" for ir in range(n_rtp[2]):\n",
" for it in range(n_rtp[1]):\n",
" for ip in range(n_rtp[0]):\n",
" # write out eta xi zeta fun fac_a fac_b fac_c fac_f\n",
" f.write(\"{:.16f} {:.16f} {:.16f} {:.16f} {:.16f} {:.16f} {:.16f} {:.16f} {:.16f}\\n\".format(eta_init[ir,it,ip],xi_init[ir,it,ip],zeta_init[ir,it,ip],fun_init[ir,it,ip],vel_init[ir,it,ip],a_init[ir,it,ip],b_init[ir,it,ip],c_init[ir,it,ip],f_init[ir,it,ip]))\n",
"\n",
"\n",
"# write true model\n",
"with open(fname_true, 'w') as f:\n",
" # write nodes in rtp\n",
" for ir in range(n_rtp[2]):\n",
" for it in range(n_rtp[1]):\n",
" for ip in range(n_rtp[0]):\n",
" # write out eta xi zeta fun fac_a fac_b fac_c fac_f\n",
" f.write(\"{:.16f} {:.16f} {:.16f} {:.16f} {:.16f} {:.16f} {:.16f} {:.16f} {:.16f}\\n\".format(eta_true[ir,it,ip],xi_true[ir,it,ip],zeta_true[ir,it,ip],fun_true[ir,it,ip],vel_true[ir,it,ip],a_true[ir,it,ip],b_true[ir,it,ip],c_true[ir,it,ip],f_true[ir,it,ip]))\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3.9.1 64-bit ('3.9.1')",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.1"
},
"vscode": {
"interpreter": {
"hash": "fbd0b2a7df497f398d93ab2f589d8a5daa3108cfb7ff2b90736653cca3aeadc0"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}

View File

@@ -0,0 +1,331 @@
# %% [markdown]
# # notebook for create init and true test model
# %%
import numpy as np
import math
# grid
R_earth = 6371.0 #6378.1370
rr1=6070
rr2=6400
tt1=(30.0-1.5)/180*math.pi
tt2=(50.0+1.5)/180*math.pi
pp1=(15.0-1.5)/180*math.pi
pp2=(40.0+1.5)/180*math.pi
n_rtp = [55,55,55]
dr = (rr2-rr1)/(n_rtp[0]-1)
dt = (tt2-tt1)/(n_rtp[1]-1)
dp = (pp2-pp1)/(n_rtp[2]-1)
rr = np.array([rr1 + x*dr for x in range(n_rtp[0])])
tt = np.array([tt1 + x*dt for x in range(n_rtp[1])])
pp = np.array([pp1 + x*dp for x in range(n_rtp[2])])
# initial model
gamma = 0.0
#s0 = 1.0/6.0
slow_p=0.04
ani_p=0.03
eta_init = np.zeros(n_rtp)
xi_init = np.zeros(n_rtp)
zeta_init = np.zeros(n_rtp)
fun_init = np.zeros(n_rtp)
vel_init = np.zeros(n_rtp)
# true model
eta_true = np.zeros(n_rtp)
xi_true = np.zeros(n_rtp)
zeta_true = np.zeros(n_rtp)
fun_true = np.zeros(n_rtp)
vel_true = np.zeros(n_rtp)
c=0
for ir in range(n_rtp[2]):
for it in range(n_rtp[1]):
for ip in range(n_rtp[0]):
#eta_init[ir,it,ip] = 0.0
#xi_init[ir,it,ip] = 0.0
zeta_init[ir,it,ip] = gamma*math.sqrt(eta_init[ir,it,ip]**2 + xi_init[ir,it,ip]**2)
if (rr[ir]>6351):
fun_init[ir,it,ip] = 1.0/(5.8+(6371-rr[ir])/20.0*0.7)
elif (rr[ir]>6336):
fun_init[ir,it,ip] = 1.0/(6.5+(6351-rr[ir])/15.0*0.6)
elif (rr[ir]>5961):
fun_init[ir,it,ip] = 1.0/(8.0+(6336-rr[ir])/375.0*1)
else:
fun_init[ir,it,ip] = 1.0/9.0
vel_init[ir,it,ip] = 1.0/fun_init[ir,it,ip]
# true model
if (tt[it] >= 30.0/180.0*math.pi and tt[it] <= 50.0/180.0*math.pi \
and pp[ip] >= 15.0/180.0*math.pi and pp[ip] <= 40.0/180.0*math.pi \
and rr[ir] >= 6211.0 and rr[ir] <= 6371.0):
c+=1
sigma = math.sin(4.0*math.pi*(tt[it]-30.0/180.0*math.pi)/(20.0/180.0*math.pi)) \
*math.sin(4.0*math.pi*(pp[ip]-15.0/180.0*math.pi)/(25.0/180.0*math.pi)) \
*math.sin(2.0*math.pi*(rr[ir]-6211.0)/160.0)
else:
sigma = 0.0
if sigma < 0:
psi = 60.0/180.0*math.pi
elif sigma > 0:
psi = 150.0/180.0*math.pi
else:
psi = 0.0
eta_true[ir,it,ip] = ani_p*abs(sigma)*math.sin(2.0*psi)
xi_true[ir,it,ip] = ani_p*abs(sigma)*math.cos(2.0*psi)
zeta_true[ir,it,ip] = gamma*math.sqrt(eta_true[ir,it,ip]**2 + xi_true[ir,it,ip]**2)
fun_true[ir,it,ip] = fun_init[ir,it,ip]/(1.0+sigma*slow_p)
vel_true[ir,it,ip] = 1.0/fun_true[ir,it,ip]
r_earth = R_earth #6378.1370
print("depminmax {} {}".format(r_earth-rr1,r_earth-rr2))
print(c)
# %%
# write out
import h5py
fout_init = h5py.File('test_model_init.h5', 'w')
fout_true = h5py.File('test_model_true.h5', 'w')
# write out the arrays eta_init, xi_init, zeta_init, fun_init, a_init, b_init, c_init, f_init
fout_init.create_dataset('eta', data=eta_init)
fout_init.create_dataset('xi', data=xi_init)
fout_init.create_dataset('zeta',data=zeta_init)
fout_init.create_dataset('vel', data=vel_init)
# writeout the arrays eta_true, xi_true, zeta_true, fun_true, a_true, b_true, c_true, f_true
fout_true.create_dataset('eta', data=eta_true)
fout_true.create_dataset('xi', data=xi_true)
fout_true.create_dataset('zeta',data=zeta_true)
fout_true.create_dataset('vel', data=vel_true)
fout_init.close()
fout_true.close()
# %% [markdown]
# # prepare src station file
#
# ```
# 26 1992 1 1 2 43 56.900 1.8000 98.9000 137.00 2.80 8 305644 <- src  : id_src year month day hour min sec lat lon dep_km mag num_recs id_event
# 26 1 PCBI 1.8900 98.9253 1000.0000 P 10.40 18.000 <- arrival : id_src id_rec name_rec lat lon elevation_m phase epicentral_distance_km arrival_time_sec
# 26 2 MRPI 1.6125 99.3172 1100.0000 P 50.84 19.400
# 26 3 HUTI 2.3153 98.9711 1600.0000 P 57.84 19.200
#
# ```
# %%
import random
random.seed(123456789)
# dummys
year_dummy = 1998
month_dummy = 1
day_dummy = 1
hour_dummy = 0
minute_dummy = 0
second_dummy = 0
mag_dummy = 3.0
id_dummy = 1000
st_name_dummy = 'AAAA'
phase_dummy = 'P'
arriv_t_dummy = 0.0
tt1deg = tt1 * 180.0/math.pi
tt2deg = tt2 * 180.0/math.pi
pp1deg = pp1 * 180.0/math.pi
pp2deg = pp2 * 180.0/math.pi
n_src = 1
n_rec = [1 for x in range(n_src)]
lines = []
pos_src=[]
pos_rec=[]
# teleseismic events
n_src_tele = 1
center_lon = (pp2deg+pp1deg)/2.0
center_lat = (tt2deg+tt1deg)/2.0
r_src = 40 # deg
d_r = 360.0/n_src_tele
# use fixed coordinate for test
dep_srcs = [50.0]
lon_srcs = [67.5]
lat_srcs = [40.0]
elev_recs = []
lon_recs = []
lat_recs = []
# read STATIONS
f = open('fortran_code/ega5/input/STATIONS', 'r')
for line in f:
lines.append(line)
f.close()
n_rec_tmp=0
for l in lines:
if l[0] == '#':
continue
else:
items = l.split()
if (len(items) == 3):
elev_recs.append(float(items[0]))
lat_recs.append(float(items[1]))
lon_recs.append(float(items[2]))
n_rec_tmp += 1
n_rec[0] = n_rec_tmp
#for i in range(n_src_tele):
# dep = 50.0
# lon = math.cos(d_r*i/180.0*math.pi)*r_src + center_lon
# lat = math.sin(d_r*i/180.0*math.pi)*r_src + center_lat
# dep_srcs.append(dep)
# lon_srcs.append(lon)
# lat_srcs.append(lat)
#
## regional events
#n_src_reg = 0
#for i in range(n_src_reg):
# dep = random.uniform(r_earth-rr1,r_earth-rr2)
# lon = random.uniform(pp1deg,pp2deg)
# lat = random.uniform(tt1deg,tt2deg)
# dep_srcs.append(dep)
# lon_srcs.append(lon)
# lat_srcs.append(lat)
#
#n_src = n_src_tele + n_src_reg
#
## create receiver coordinates
#n_rec = [50 for i in range(n_src)]
#elev_recs=[]
#lon_recs=[]
#lat_recs=[]
#rec_names=[]
#for i in range(n_rec[0]):
# #elev_recs.append(random.uniform(-100.0,-100.0)) # elevation in m
# elev_recs.append(0) # elevation in m
# lon_recs .append(random.uniform(pp1deg*1.1,pp2deg*0.9))
# lat_recs .append(random.uniform(tt1deg*1.1,tt2deg*0.9))
# rec_names.append(i)
# create dummy src
lines=[]
for i_src in range(n_src):
# define one point in the domain (rr1 bottom, rr2 top)
dep = dep_srcs[i_src]
lon = lon_srcs[i_src]
lat = lat_srcs[i_src]
src = [i_src, year_dummy, month_dummy, day_dummy, hour_dummy, minute_dummy, second_dummy, lat, lon, dep, mag_dummy, n_rec[i_src], id_dummy]
lines.append(src)
pos_src.append([lon,lat,dep])
# create dummy station
for i_rec in range(n_rec[i_src]):
#elev_rec = random.uniform(0.0,-10.0) # elevation in m
#lon_rec = random.uniform(pp1deg,pp2deg)
#lat_rec = random.uniform(tt1deg,tt2deg)
rec = [i_src, i_rec, st_name_dummy+"_"+str(i_rec), lat_recs[i_rec], lon_recs[i_rec], elev_recs[i_rec], phase_dummy, arriv_t_dummy]
lines.append(rec)
pos_rec.append([lon_recs[i_rec],lat_recs[i_rec],elev_recs[i_rec]])
# write out ev_arrivals file
fname = 'src_rec_test.dat'
with open(fname, 'w') as f:
for line in lines:
for elem in line:
f.write('{} '.format(elem))
f.write('\n')
# %%
# draw src and rec positions
import matplotlib.pyplot as plt
for i_src in range(n_src):
plt.scatter(pos_src[i_src][1],pos_src[i_src][0],c='r',marker='o')
# %%
# plot receivers
for i_rec in range(n_rec[0]):
plt.scatter(pos_rec[i_rec][1],pos_rec[i_rec][0],c='b',marker='o')
# %%
# output source and receiver file for fortran code
fname_source = "EARTHQUAKES_tele"
fname_station="STATIONS"
# write out number of sources
with open(fname_source, 'w') as f:
f.write('{}\n'.format(n_src))
# write out depth lat lon
for i_src in range(n_src):
f.write('{} {} {}\n'.format(dep_srcs[i_src],lat_srcs[i_src],lon_srcs[i_src]))
# write out number of stations
with open(fname_station, 'w') as f:
f.write('{}\n'.format(n_rec[0]))
# write out depth lat lon (convert elevation to depth)
for i_rec in range(n_rec[0]):
f.write('{} {} {}\n'.format(elev_recs[i_rec],lat_recs[i_rec],lon_recs[i_rec]))
# %%
# write out in ASCIII
#
fname_init = 'test_model_init.dat'
fname_true = 'test_model_true.dat'
# write init model
with open(fname_init, 'w') as f:
# write nodes in rtp
for ir in range(n_rtp[2]):
for it in range(n_rtp[1]):
for ip in range(n_rtp[0]):
# write out eta xi zeta fun fac_a fac_b fac_c fac_f
f.write("{:.16f} {:.16f} {:.16f} {:.16f} {:.16f} {:.16f} {:.16f} {:.16f} {:.16f}\n".format(eta_init[ir,it,ip],xi_init[ir,it,ip],zeta_init[ir,it,ip],fun_init[ir,it,ip],vel_init[ir,it,ip],a_init[ir,it,ip],b_init[ir,it,ip],c_init[ir,it,ip],f_init[ir,it,ip]))
# write true model
with open(fname_true, 'w') as f:
# write nodes in rtp
for ir in range(n_rtp[2]):
for it in range(n_rtp[1]):
for ip in range(n_rtp[0]):
# write out eta xi zeta fun fac_a fac_b fac_c fac_f
f.write("{:.16f} {:.16f} {:.16f} {:.16f} {:.16f} {:.16f} {:.16f} {:.16f} {:.16f}\n".format(eta_true[ir,it,ip],xi_true[ir,it,ip],zeta_true[ir,it,ip],fun_true[ir,it,ip],vel_true[ir,it,ip],a_true[ir,it,ip],b_true[ir,it,ip],c_true[ir,it,ip],f_true[ir,it,ip]))
# %%