initial upload
This commit is contained in:
136
test/old_tests/inversion_tele/1d_ak135.txt
Normal file
136
test/old_tests/inversion_tele/1d_ak135.txt
Normal 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
|
||||
158
test/old_tests/inversion_tele/1d_model.txt
Normal file
158
test/old_tests/inversion_tele/1d_model.txt
Normal file
@@ -0,0 +1,158 @@
|
||||
5463, 11.3059
|
||||
5473, 11.2888
|
||||
5483, 11.2717
|
||||
5493, 11.2546
|
||||
5503, 11.2375
|
||||
5513, 11.2203
|
||||
5523, 11.2028
|
||||
5533, 11.1853
|
||||
5543, 11.1677
|
||||
5553, 11.1502
|
||||
5563, 11.1329
|
||||
5573, 11.1168
|
||||
5583, 11.1008
|
||||
5593, 11.0847
|
||||
5603, 11.0686
|
||||
5613, 11.0505
|
||||
5623, 11.0239
|
||||
5633, 10.9973
|
||||
5643, 10.9707
|
||||
5653, 10.9442
|
||||
5663, 10.9176
|
||||
5673, 10.891
|
||||
5683, 10.8644
|
||||
5693, 10.8378
|
||||
5703, 10.8113
|
||||
5713, 10.1933
|
||||
5723, 10.1597
|
||||
5733, 10.1261
|
||||
5743, 10.0925
|
||||
5753, 10.0589
|
||||
5763, 10.0253
|
||||
5773, 9.99168
|
||||
5783, 9.95808
|
||||
5793, 9.92448
|
||||
5803, 9.89088
|
||||
5813, 9.85728
|
||||
5823, 9.82368
|
||||
5833, 9.79008
|
||||
5843, 9.75648
|
||||
5853, 9.72288
|
||||
5863, 9.68928
|
||||
5873, 9.65568
|
||||
5883, 9.62208
|
||||
5893, 9.58848
|
||||
5903, 9.55488
|
||||
5913, 9.52128
|
||||
5923, 9.48768
|
||||
5933, 9.45408
|
||||
5943, 9.42048
|
||||
5953, 9.38688
|
||||
5963, 9.0227
|
||||
5973, 8.9862
|
||||
5983, 8.9497
|
||||
5993, 8.9132
|
||||
6003, 8.8767
|
||||
6013, 8.8402
|
||||
6023, 8.8037
|
||||
6033, 8.7672
|
||||
6043, 8.7307
|
||||
6053, 8.6942
|
||||
6063, 8.6577
|
||||
6073, 8.6212
|
||||
6083, 8.5847
|
||||
6093, 8.5482
|
||||
6103, 8.5117
|
||||
6113, 8.4752
|
||||
6123, 8.4387
|
||||
6133, 8.4022
|
||||
6143, 8.3657
|
||||
6153, 8.3292
|
||||
6163, 8.29444
|
||||
6173, 8.26667
|
||||
6183, 8.23889
|
||||
6193, 8.21111
|
||||
6203, 8.18333
|
||||
6213, 8.15556
|
||||
6223, 8.12778
|
||||
6233, 8.1
|
||||
6243, 8.07222
|
||||
6253, 8.04976
|
||||
6263, 8.04859
|
||||
6273, 8.04741
|
||||
6283, 8.04624
|
||||
6293, 8.04506
|
||||
6303, 8.04388
|
||||
6313, 8.04271
|
||||
6323, 8.04153
|
||||
6333, 8.04035
|
||||
6343, 6.5
|
||||
6353, 5.8
|
||||
6363, 5.8
|
||||
6373, 5.8
|
||||
6383, 5.8
|
||||
6393, 5.8
|
||||
6403, 5.8
|
||||
6413, 5.8
|
||||
6423, 5.8
|
||||
6433, 5.8
|
||||
6443, 5.8
|
||||
6453, 5.8
|
||||
6463, 5.8
|
||||
6473, 5.8
|
||||
6483, 5.8
|
||||
6493, 5.8
|
||||
6503, 5.8
|
||||
6513, 5.8
|
||||
6523, 5.8
|
||||
6533, 5.8
|
||||
6543, 5.8
|
||||
6553, 5.8
|
||||
6563, 5.8
|
||||
6573, 5.8
|
||||
6583, 5.8
|
||||
6593, 5.8
|
||||
6603, 5.8
|
||||
6613, 5.8
|
||||
6623, 5.8
|
||||
6633, 5.8
|
||||
6643, 5.8
|
||||
6653, 5.8
|
||||
6663, 5.8
|
||||
6673, 5.8
|
||||
6683, 5.8
|
||||
6693, 5.8
|
||||
6703, 5.8
|
||||
6713, 5.8
|
||||
6723, 5.8
|
||||
6733, 5.8
|
||||
6743, 5.8
|
||||
6753, 5.8
|
||||
6763, 5.8
|
||||
6773, 5.8
|
||||
6783, 5.8
|
||||
6793, 5.8
|
||||
6803, 5.8
|
||||
6813, 5.8
|
||||
6823, 5.8
|
||||
6833, 5.8
|
||||
6843, 5.8
|
||||
6853, 5.8
|
||||
6863, 5.8
|
||||
6873, 5.8
|
||||
6883, 5.8
|
||||
6893, 5.8
|
||||
6903, 5.8
|
||||
6913, 5.8
|
||||
6923, 5.8
|
||||
6933, 5.8
|
||||
6943, 5.8
|
||||
6953, 5.8
|
||||
6963, 5.8
|
||||
6973, 5.8
|
||||
6983, 5.8
|
||||
6993, 5.8
|
||||
7003, 5.8
|
||||
7013, 5.8
|
||||
7023, 5.8
|
||||
7033, 5.8
|
||||
30
test/old_tests/inversion_tele/README.md
Normal file
30
test/old_tests/inversion_tele/README.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# Inversion test
|
||||
|
||||
This is a test setup for inversion calculation with teleseismic events.
|
||||
|
||||
1. Run all cells of `make_test_model.ipynb` for creating
|
||||
- source, receiver file (src_rec_test.dat)
|
||||
- true model (test_model_true.h5)
|
||||
- initial model (test_model_init.h5)
|
||||
|
||||
2. then run TOMOATT forward with `input_params_pre.yml` for calculating the true arrival times at the stations
|
||||
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.
|
||||
Result travel time at the stations is saved in the file `src_rec_test_out.dat`
|
||||
Following command will run the forward simulation with the true model
|
||||
``` bash
|
||||
mpirun -n 8 ../../build/TOMOATT -i input_params_pre.yml
|
||||
```
|
||||
Volumetric output data is saved in the file `OUTPUT_FILES/out_data_sim_0.h5`.
|
||||
This file may be visualized by paraview with opening the index file `OUTPUT_FILES/out_data_sim_0.xmf`.
|
||||
|
||||
3. run TOMOATT in inversion mode with `input_params.yml`, by the command
|
||||
``` bash
|
||||
mpirun -n 8 ../../build/TOMOATT -i input_params.yml
|
||||
```
|
||||
The volumetric output data is saved in the file `OUTPUT_FILES/out_data_sim_0.h5`.
|
||||
|
||||
|
||||
4. For retrieving the output data from *.h5, please use the python script `utils/tomoatt_data_retrieval.py`
|
||||
111
test/old_tests/inversion_tele/check_1d_model_and_Tfield.ipynb
Normal file
111
test/old_tests/inversion_tele/check_1d_model_and_Tfield.ipynb
Normal file
@@ -0,0 +1,111 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# plot 1d_model.txt\n",
|
||||
"fname_gen='1d_model.txt'\n",
|
||||
"fname_ori='1d_ak135.txt'\n",
|
||||
"\n",
|
||||
"r_earth = 6371.0\n",
|
||||
"\n",
|
||||
"# read file\n",
|
||||
"\n",
|
||||
"dep_gen=[]\n",
|
||||
"vp_gen=[]\n",
|
||||
"\n",
|
||||
"with open(fname_gen, 'r') as f:\n",
|
||||
" lines = f.readlines()\n",
|
||||
"\n",
|
||||
" for line in lines:\n",
|
||||
" line = line.strip()\n",
|
||||
" if line.startswith('#'):\n",
|
||||
" continue\n",
|
||||
" else:\n",
|
||||
" line = line.split(\",\")\n",
|
||||
" dep_gen.append(r_earth-float(line[0]))\n",
|
||||
" vp_gen.append(float(line[1]))\n",
|
||||
"\n",
|
||||
"dep_ori=[]\n",
|
||||
"vp_ori=[]\n",
|
||||
"\n",
|
||||
"with open(fname_ori,'r') as f:\n",
|
||||
" lines = f.readlines()\n",
|
||||
"\n",
|
||||
" for line in lines:\n",
|
||||
" line = line.strip()\n",
|
||||
" if line.startswith('#'):\n",
|
||||
" continue\n",
|
||||
" else:\n",
|
||||
" line = line.split(\",\")\n",
|
||||
" dep_ori.append(float(line[0]))\n",
|
||||
" vp_ori.append(float(line[1]))\n",
|
||||
"\n",
|
||||
"\n",
|
||||
"# plot dep and vp\n",
|
||||
"import matplotlib.pyplot as plt\n",
|
||||
"\n",
|
||||
"plt.plot(dep_gen, vp_gen, linewidth=10)\n",
|
||||
"plt.plot(dep_ori, vp_ori)"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"metadata": {},
|
||||
"outputs": [],
|
||||
"source": [
|
||||
"# read 2D traveltime field and plot\n",
|
||||
"import h5py\n",
|
||||
"import matplotlib.pyplot as plt\n",
|
||||
"\n",
|
||||
"fname_Tfield='OUTPUT_FILES/2d_travel_time_field_0.h5'\n",
|
||||
"\n",
|
||||
"with h5py.File(fname_Tfield, 'r') as f:\n",
|
||||
" T_2d = f['T'][:,:]\n",
|
||||
" t_1d = f['t'][:]\n",
|
||||
" r_1d = f['r'][:]\n",
|
||||
"\n",
|
||||
"plt.imshow(T_2d, extent=[t_1d[0], t_1d[-1], r_1d[0], r_1d[-1]], aspect='auto') \n",
|
||||
"plt.colorbar()\n",
|
||||
"#plt.imshow(T_2d)\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": "02f83e1f4cd9619657a6845405e2dd67c4de23753ba48bca5dce2ebf57b3813a"
|
||||
}
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
200
|
||||
11.802 0.000 120.430
|
||||
10.977 0.000 112.347
|
||||
14.799 0.000 116.441
|
||||
13.870 0.000 114.593
|
||||
2.238 0.000 118.621
|
||||
18.077 0.000 111.279
|
||||
15.485 0.000 128.750
|
||||
5.138 0.000 129.964
|
||||
1.021 0.000 117.016
|
||||
16.461 0.000 124.992
|
||||
12.131 0.000 127.582
|
||||
1.691 0.000 129.371
|
||||
14.213 0.000 120.983
|
||||
12.474 0.000 125.122
|
||||
10.740 0.000 129.356
|
||||
15.138 0.000 119.121
|
||||
16.849 0.000 113.748
|
||||
10.421 0.000 127.899
|
||||
8.083 0.000 113.566
|
||||
7.194 0.000 127.568
|
||||
15.695 0.000 129.820
|
||||
15.755 0.000 128.741
|
||||
4.287 0.000 119.474
|
||||
3.368 0.000 116.248
|
||||
16.400 0.000 110.836
|
||||
2.200 0.000 126.318
|
||||
8.136 0.000 128.447
|
||||
14.206 0.000 127.036
|
||||
11.432 0.000 126.942
|
||||
8.027 0.000 118.581
|
||||
2.233 0.000 126.321
|
||||
2.856 0.000 128.286
|
||||
15.194 0.000 111.542
|
||||
19.468 0.000 114.427
|
||||
18.235 0.000 116.594
|
||||
11.378 0.000 117.484
|
||||
7.172 0.000 113.442
|
||||
15.956 0.000 125.590
|
||||
2.810 0.000 114.026
|
||||
12.895 0.000 127.486
|
||||
8.131 0.000 125.399
|
||||
9.603 0.000 127.463
|
||||
9.059 0.000 127.470
|
||||
15.437 0.000 117.213
|
||||
4.344 0.000 120.949
|
||||
8.399 0.000 112.079
|
||||
6.747 0.000 114.103
|
||||
8.264 0.000 119.535
|
||||
8.660 0.000 125.041
|
||||
12.518 0.000 111.975
|
||||
1.344 0.000 115.458
|
||||
14.245 0.000 122.863
|
||||
14.446 0.000 127.582
|
||||
7.296 0.000 123.609
|
||||
15.986 0.000 118.914
|
||||
2.741 0.000 128.433
|
||||
2.776 0.000 114.310
|
||||
10.058 0.000 118.660
|
||||
4.767 0.000 112.640
|
||||
6.614 0.000 123.114
|
||||
18.459 0.000 128.929
|
||||
5.942 0.000 112.869
|
||||
9.770 0.000 123.277
|
||||
11.403 0.000 128.818
|
||||
10.440 0.000 127.002
|
||||
11.587 0.000 122.665
|
||||
13.228 0.000 127.416
|
||||
2.504 0.000 110.861
|
||||
3.837 0.000 120.637
|
||||
15.225 0.000 112.534
|
||||
12.590 0.000 123.332
|
||||
9.117 0.000 122.897
|
||||
15.230 0.000 125.084
|
||||
6.218 0.000 129.723
|
||||
17.309 0.000 125.024
|
||||
2.178 0.000 120.731
|
||||
13.611 0.000 112.946
|
||||
2.805 0.000 123.454
|
||||
4.944 0.000 115.870
|
||||
14.004 0.000 125.492
|
||||
4.209 0.000 125.665
|
||||
13.779 0.000 123.429
|
||||
2.183 0.000 118.440
|
||||
5.357 0.000 123.154
|
||||
13.240 0.000 116.284
|
||||
18.648 0.000 121.295
|
||||
19.219 0.000 115.919
|
||||
1.486 0.000 121.474
|
||||
2.457 0.000 119.333
|
||||
16.288 0.000 127.138
|
||||
5.268 0.000 121.570
|
||||
5.623 0.000 122.193
|
||||
12.494 0.000 112.512
|
||||
1.649 0.000 120.953
|
||||
18.253 0.000 113.672
|
||||
4.109 0.000 115.474
|
||||
15.850 0.000 121.814
|
||||
6.920 0.000 115.925
|
||||
3.525 0.000 127.491
|
||||
7.125 0.000 127.679
|
||||
8.291 0.000 129.702
|
||||
2.453 0.000 116.388
|
||||
10.126 0.000 114.561
|
||||
16.671 0.000 115.128
|
||||
9.499 0.000 115.955
|
||||
7.057 0.000 114.557
|
||||
9.537 0.000 118.136
|
||||
17.129 0.000 127.229
|
||||
13.159 0.000 123.202
|
||||
18.156 0.000 112.430
|
||||
12.148 0.000 127.744
|
||||
4.707 0.000 118.976
|
||||
12.066 0.000 113.261
|
||||
9.917 0.000 112.249
|
||||
4.562 0.000 115.574
|
||||
9.033 0.000 111.773
|
||||
2.664 0.000 115.781
|
||||
3.620 0.000 113.157
|
||||
8.536 0.000 124.149
|
||||
12.984 0.000 118.287
|
||||
11.377 0.000 114.723
|
||||
14.438 0.000 117.563
|
||||
6.770 0.000 117.346
|
||||
19.103 0.000 122.253
|
||||
11.890 0.000 120.057
|
||||
1.882 0.000 125.606
|
||||
6.826 0.000 120.949
|
||||
1.447 0.000 124.624
|
||||
11.237 0.000 114.481
|
||||
18.727 0.000 124.695
|
||||
16.117 0.000 125.042
|
||||
9.385 0.000 111.953
|
||||
2.156 0.000 110.976
|
||||
17.274 0.000 110.739
|
||||
11.901 0.000 116.806
|
||||
3.311 0.000 112.308
|
||||
16.118 0.000 129.010
|
||||
14.839 0.000 111.311
|
||||
14.383 0.000 114.445
|
||||
4.545 0.000 110.627
|
||||
6.887 0.000 111.142
|
||||
15.771 0.000 129.508
|
||||
16.464 0.000 111.184
|
||||
5.103 0.000 113.133
|
||||
5.517 0.000 111.094
|
||||
11.793 0.000 121.722
|
||||
9.895 0.000 127.312
|
||||
2.327 0.000 117.660
|
||||
9.218 0.000 127.343
|
||||
17.444 0.000 120.635
|
||||
13.747 0.000 115.551
|
||||
14.244 0.000 112.432
|
||||
7.793 0.000 123.270
|
||||
2.825 0.000 128.950
|
||||
17.617 0.000 127.288
|
||||
2.807 0.000 126.756
|
||||
15.653 0.000 126.819
|
||||
17.047 0.000 120.984
|
||||
5.550 0.000 128.964
|
||||
18.377 0.000 111.008
|
||||
9.899 0.000 124.873
|
||||
17.878 0.000 126.725
|
||||
9.937 0.000 121.221
|
||||
9.665 0.000 127.646
|
||||
11.705 0.000 118.606
|
||||
8.598 0.000 123.095
|
||||
9.381 0.000 112.372
|
||||
12.011 0.000 111.390
|
||||
9.745 0.000 126.383
|
||||
6.575 0.000 112.135
|
||||
1.758 0.000 125.892
|
||||
14.843 0.000 114.231
|
||||
2.378 0.000 115.137
|
||||
13.871 0.000 121.657
|
||||
17.999 0.000 127.665
|
||||
11.245 0.000 120.451
|
||||
2.764 0.000 112.762
|
||||
15.920 0.000 111.560
|
||||
12.590 0.000 115.623
|
||||
10.907 0.000 128.019
|
||||
14.613 0.000 125.835
|
||||
11.296 0.000 120.752
|
||||
5.326 0.000 115.745
|
||||
8.918 0.000 125.743
|
||||
14.636 0.000 122.201
|
||||
10.490 0.000 126.751
|
||||
13.210 0.000 129.310
|
||||
14.389 0.000 122.314
|
||||
10.010 0.000 112.866
|
||||
2.412 0.000 122.699
|
||||
10.634 0.000 129.658
|
||||
15.328 0.000 116.282
|
||||
17.949 0.000 117.036
|
||||
10.058 0.000 129.116
|
||||
10.862 0.000 126.679
|
||||
5.712 0.000 113.093
|
||||
7.001 0.000 119.322
|
||||
17.848 0.000 129.814
|
||||
2.726 0.000 123.738
|
||||
2.228 0.000 123.016
|
||||
@@ -0,0 +1,31 @@
|
||||
30
|
||||
93.754 0.000 167.742 90.000 47.742
|
||||
91.741 0.000 76.894 270.000 43.106
|
||||
28.520 0.000 192.245 90.000 72.245
|
||||
99.877 0.000 171.239 90.000 51.239
|
||||
29.960 0.000 68.069 270.000 51.931
|
||||
63.202 0.000 57.747 270.000 62.253
|
||||
25.908 0.000 199.894 90.000 79.894
|
||||
60.869 0.000 72.681 270.000 47.319
|
||||
58.767 0.000 77.051 270.000 42.949
|
||||
12.108 0.000 189.167 90.000 69.167
|
||||
46.008 0.000 43.608 270.000 76.392
|
||||
10.170 0.000 74.481 270.000 45.519
|
||||
89.800 0.000 175.250 90.000 55.250
|
||||
31.693 0.000 166.363 90.000 46.363
|
||||
93.750 0.000 68.855 270.000 51.145
|
||||
51.260 0.000 193.542 90.000 73.542
|
||||
86.110 0.000 172.078 90.000 52.078
|
||||
10.661 0.000 191.059 90.000 71.059
|
||||
22.843 0.000 56.609 270.000 63.391
|
||||
61.437 0.000 176.890 90.000 56.890
|
||||
62.972 0.000 58.230 270.000 61.770
|
||||
39.053 0.000 185.517 90.000 65.517
|
||||
32.690 0.000 167.737 90.000 47.737
|
||||
78.764 0.000 190.265 90.000 70.265
|
||||
76.323 0.000 184.958 90.000 64.958
|
||||
33.802 0.000 47.777 270.000 72.223
|
||||
25.489 0.000 62.227 270.000 57.773
|
||||
51.580 0.000 195.428 90.000 75.428
|
||||
64.127 0.000 171.087 90.000 51.087
|
||||
92.574 0.000 73.692 270.000 46.308
|
||||
@@ -0,0 +1,41 @@
|
||||
40
|
||||
0.000 0.000 110.250
|
||||
0.000 0.000 110.750
|
||||
0.000 0.000 111.250
|
||||
0.000 0.000 111.750
|
||||
0.000 0.000 112.250
|
||||
0.000 0.000 112.750
|
||||
0.000 0.000 113.250
|
||||
0.000 0.000 113.750
|
||||
0.000 0.000 114.250
|
||||
0.000 0.000 114.750
|
||||
0.000 0.000 115.250
|
||||
0.000 0.000 115.750
|
||||
0.000 0.000 116.250
|
||||
0.000 0.000 116.750
|
||||
0.000 0.000 117.250
|
||||
0.000 0.000 117.750
|
||||
0.000 0.000 118.250
|
||||
0.000 0.000 118.750
|
||||
0.000 0.000 119.250
|
||||
0.000 0.000 119.750
|
||||
0.000 0.000 120.250
|
||||
0.000 0.000 120.750
|
||||
0.000 0.000 121.250
|
||||
0.000 0.000 121.750
|
||||
0.000 0.000 122.250
|
||||
0.000 0.000 122.750
|
||||
0.000 0.000 123.250
|
||||
0.000 0.000 123.750
|
||||
0.000 0.000 124.250
|
||||
0.000 0.000 124.750
|
||||
0.000 0.000 125.250
|
||||
0.000 0.000 125.750
|
||||
0.000 0.000 126.250
|
||||
0.000 0.000 126.750
|
||||
0.000 0.000 127.250
|
||||
0.000 0.000 127.750
|
||||
0.000 0.000 128.250
|
||||
0.000 0.000 128.750
|
||||
0.000 0.000 129.250
|
||||
0.000 0.000 129.750
|
||||
File diff suppressed because one or more lines are too long
@@ -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
|
||||
1016
test/old_tests/inversion_tele/fortran_code/ega5_sphe_3d_kernel.f90
Normal file
1016
test/old_tests/inversion_tele/fortran_code/ega5_sphe_3d_kernel.f90
Normal file
File diff suppressed because it is too large
Load Diff
5333
test/old_tests/inversion_tele/fortran_code/eikon_solver_mpi.f90
Normal file
5333
test/old_tests/inversion_tele/fortran_code/eikon_solver_mpi.f90
Normal file
File diff suppressed because it is too large
Load Diff
48
test/old_tests/inversion_tele/input_params.yml
Normal file
48
test/old_tests/inversion_tele/input_params.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
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 : 'src_rec_test_out.dat' # source receiver file (if found, src_dep_lat_lon is ignored)
|
||||
swap_src_rec : 1 # 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
|
||||
optim_method : 2 # optimization method. 0 : "grad_descent", 1 : "lbfgs", 2 : "halve-stepping"
|
||||
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
|
||||
max_sub_iterations : 100 # maximum number of sub-iterations
|
||||
#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,4] # number of subdomains
|
||||
nproc_sub : 1 # number of subprocess used for each subdomain
|
||||
use_gpu : 0
|
||||
|
||||
calculation :
|
||||
convergence_tolerance : 1e-3
|
||||
max_iterations : 100
|
||||
stencil_order : 3 # 1 or 3
|
||||
sweep_type : 2 # 0: legacy, 1: cuthill-mckee with shm parallelization
|
||||
|
||||
|
||||
36
test/old_tests/inversion_tele/input_params_pre.yml
Normal file
36
test/old_tests/inversion_tele/input_params_pre.yml
Normal file
@@ -0,0 +1,36 @@
|
||||
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 : 'src_rec_test.dat' # source receiver file (if found, src_dep_lat_lon is ignored)
|
||||
swap_src_rec : 1 # swap source and receiver
|
||||
|
||||
model :
|
||||
init_model_type : '' # 'fd' (input file) or '1d_ak135'
|
||||
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 : [2,2,2] # number of subdomains
|
||||
nproc_sub : 1 # number of subprocess used for each subdomain
|
||||
|
||||
calculation :
|
||||
convergence_tolerance : 1e-4
|
||||
max_iterations : 100
|
||||
stencil_order : 3 # 1 or 3
|
||||
sweep_type : 2 # 0: legacy, 1: cuthill-mckee with shm parallelization
|
||||
|
||||
|
||||
352
test/old_tests/inversion_tele/make_test_model.ipynb
Normal file
352
test/old_tests/inversion_tele/make_test_model.ipynb
Normal file
@@ -0,0 +1,352 @@
|
||||
{
|
||||
"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",
|
||||
"a_init = np.zeros(n_rtp)\n",
|
||||
"b_init = np.zeros(n_rtp)\n",
|
||||
"c_init = np.zeros(n_rtp)\n",
|
||||
"f_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",
|
||||
"a_true = np.zeros(n_rtp)\n",
|
||||
"b_true = np.zeros(n_rtp)\n",
|
||||
"c_true = np.zeros(n_rtp)\n",
|
||||
"f_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",
|
||||
" a_init[ir,it,ip] = 1.0 + 2.0*zeta_init[ir,it,ip]\n",
|
||||
" b_init[ir,it,ip] = 1.0 - 2.0*xi_init[ir,it,ip]\n",
|
||||
" c_init[ir,it,ip] = 1.0 + 2.0*xi_init[ir,it,ip]\n",
|
||||
" f_init[ir,it,ip] = -2.0 * eta_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",
|
||||
" a_true[ir,it,ip] = 1.0 + 2.0*zeta_true[ir,it,ip]\n",
|
||||
" b_true[ir,it,ip] = 1.0 - 2.0*xi_true[ir,it,ip]\n",
|
||||
" c_true[ir,it,ip] = 1.0 + 2.0*xi_true[ir,it,ip]\n",
|
||||
" f_true[ir,it,ip] = -2.0 * eta_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('fun', data=fun_init)\n",
|
||||
"fout_init.create_dataset('fac_a', data=a_init)\n",
|
||||
"fout_init.create_dataset('fac_b', data=b_init)\n",
|
||||
"fout_init.create_dataset('fac_c', data=c_init)\n",
|
||||
"fout_init.create_dataset('fac_f', data=f_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('fun', data=fun_true)\n",
|
||||
"fout_true.create_dataset('fac_a', data=a_true)\n",
|
||||
"fout_true.create_dataset('fac_b', data=b_true)\n",
|
||||
"fout_true.create_dataset('fac_c', data=c_true)\n",
|
||||
"fout_true.create_dataset('fac_f', data=f_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",
|
||||
"# one source outside of the region\n",
|
||||
"dep_srcs=[]\n",
|
||||
"lon_srcs=[]\n",
|
||||
"lat_srcs=[]\n",
|
||||
"\n",
|
||||
"# teleseismic events\n",
|
||||
"n_src_tele = 10\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",
|
||||
"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 = [20 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",
|
||||
"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": []
|
||||
}
|
||||
],
|
||||
"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": "02f83e1f4cd9619657a6845405e2dd67c4de23753ba48bca5dce2ebf57b3813a"
|
||||
}
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 2
|
||||
}
|
||||
Reference in New Issue
Block a user