Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question/Problem: Seismic inversion topography #536

Closed
skytter opened this issue May 20, 2023 · 4 comments
Closed

Question/Problem: Seismic inversion topography #536

skytter opened this issue May 20, 2023 · 4 comments
Assignees
Labels
Milestone

Comments

@skytter
Copy link

skytter commented May 20, 2023

Question/Problem description

Hi I'm trying to do seismic refraction inversion using “Koenigsee” example with my data.
There is a problem with supplying the topography of the survey - results seems to be flipped upside down.

Your environment

Date: Sat May 20 14:05:58 2023 W. Europe Daylight Time
OS : Windows
CPU(s) : 32
Machine : AMD64
Architecture : 64bit
Environment : Python
Python 3.9.16 | packaged by conda-forge | (main, Feb 1 2023, 21:28:38) [MSC
v.1929 64 bit (AMD64)]
pygimli : 1.4.0
pgcore : 1.3.0
numpy : 1.21.5
matplotlib : 3.7.1
scipy : 1.10.1
pyvista : 0.39.0
Intel(R) oneAPI Math Kernel Library Version 2023.1-Product Build 20230303
for Intel(R) 64 architecture applications

Steps to reproduce

My data file "PK2-picks.sgt":

46 # shot/geophone points
#x	z
-40.00 163.500
0.00 159.096
2.38 158.876
4.75 158.662
9.78 158.148
14.77 157.661
19.70 157.179
24.63 156.708
27.12 156.469
29.60 156.230
34.62 155.786
39.54 155.332
42.03 155.100
44.51 154.867
49.48 154.461
54.49 154.025
59.35 153.631
64.31 153.281
66.78 153.092
69.25 152.898
74.32 152.516
79.23 152.146
84.21 151.779
89.12 151.440
91.65 151.242
94.18 151.038
99.14 150.674
104.08 150.499
109.10 150.368
114.32 150.231
118.93 150.138
121.51 150.081
124.09 150.021
129.00 149.864
133.87 149.688
138.82 149.564
143.75 149.645
146.17 149.724
148.58 149.810
153.51 150.174
158.42 150.653
163.24 151.076
168.13 151.322
170.58 151.366
173.03 151.383
189.00 150.540
360 # measurements
#s	g	t
1 2 0.034038
1 4 0.037799
1 5 0.038788
1 6 0.040372
1 7 0.041955
1 8 0.043835
1 10 0.045814
1 11 0.046903
1 12 0.048684
1 14 0.049872
1 15 0.050862
1 16 0.051752
1 17 0.053435
1 18 0.054580
1 20 0.055183
1 21 0.055786
1 22 0.056130
1 23 0.057077
1 24 0.058185
1 26 0.059273
1 27 0.059867
1 28 0.060362
1 29 0.060952
1 30 0.061210
1 31 0.061296
1 33 0.062044
1 34 0.062737
1 35 0.066399
1 36 0.070258
1 37 0.071842
1 39 0.073425
1 40 0.072435
1 41 0.074316
1 42 0.076493
1 43 0.078373
1 45 0.079660
3 2 0.006478
3 4 0.006577
3 5 0.011822
3 6 0.014395
3 7 0.020135
3 8 0.024687
3 10 0.027260
3 11 0.033198
3 12 0.037454
3 14 0.040917
3 15 0.043391
3 16 0.045074
3 17 0.047152
3 18 0.049923
3 20 0.050715
3 21 0.051902
3 22 0.052793
3 23 0.052694
3 24 0.053288
3 26 0.053782
3 27 0.053980
3 28 0.054376
3 29 0.054673
3 30 0.054277
3 31 0.053980
3 33 0.055168
3 34 0.058236
3 35 0.061106
3 36 0.063085
3 37 0.064965
3 39 0.066648
3 40 0.066845
3 41 0.068330
3 42 0.069715
3 43 0.071101
3 45 0.072189
9 2 0.024700
9 4 0.023314
9 5 0.021533
9 6 0.019059
9 7 0.016387
9 8 0.007678
9 10 0.007777
9 11 0.016882
9 12 0.022720
9 14 0.026976
9 15 0.033012
9 16 0.035586
9 17 0.040138
9 18 0.041721
9 20 0.045779
9 21 0.047956
9 22 0.048846
9 23 0.049935
9 24 0.051024
9 26 0.052310
9 27 0.053003
9 28 0.053300
9 29 0.054388
9 30 0.054784
9 31 0.054982
9 33 0.053993
9 34 0.054685
9 35 0.056763
9 36 0.061415
9 37 0.063493
9 39 0.065076
9 40 0.064087
9 41 0.066363
9 42 0.069233
9 43 0.070420
9 45 0.072301
13 2 0.040175
13 4 0.037998
13 5 0.035029
13 6 0.032159
13 7 0.028893
13 8 0.026617
13 10 0.022891
13 11 0.018997
13 12 0.008111
13 14 0.008012
13 15 0.022362
13 16 0.026122
13 17 0.031268
13 18 0.036909
13 20 0.039284
13 21 0.041660
13 22 0.043738
13 23 0.046608
13 24 0.048191
13 26 0.050071
13 27 0.050170
13 28 0.049478
13 29 0.049082
13 30 0.049972
13 31 0.049873
13 33 0.051259
13 34 0.052644
13 35 0.056009
13 36 0.058582
13 37 0.060561
13 39 0.062046
13 40 0.062244
13 41 0.064619
13 42 0.066499
13 43 0.067588
13 45 0.069270
19 2 0.049240
19 4 0.048844
19 5 0.048052
19 6 0.046964
19 7 0.046172
19 8 0.044588
19 10 0.043599
19 11 0.040531
19 12 0.038453
19 14 0.034494
19 15 0.030635
19 16 0.026676
19 17 0.015197
19 18 0.008665
19 20 0.008764
19 21 0.016285
19 22 0.023479
19 23 0.028260
19 24 0.034242
19 26 0.036136
19 27 0.038375
19 28 0.040958
19 29 0.042336
19 30 0.044231
19 31 0.046642
19 33 0.048622
19 34 0.050947
19 35 0.053272
19 36 0.055683
19 37 0.058524
19 39 0.059472
19 40 0.061022
19 41 0.061969
19 42 0.062658
19 43 0.063691
19 45 0.065069
25 2 0.053409
25 4 0.053211
25 5 0.052321
25 6 0.052123
25 7 0.051727
25 8 0.051232
25 10 0.051034
25 11 0.049946
25 12 0.049451
25 14 0.047867
25 15 0.046086
25 16 0.044305
25 17 0.039313
25 18 0.035200
25 20 0.027481
25 21 0.025403
25 22 0.019249
25 23 0.013527
25 24 0.008381
25 26 0.008579
25 27 0.022435
25 28 0.026294
25 29 0.026788
25 30 0.027580
25 31 0.033122
25 33 0.035596
25 34 0.039753
25 35 0.043117
25 36 0.047472
25 37 0.051331
25 39 0.053706
25 40 0.054003
25 41 0.055784
25 42 0.056972
25 43 0.057566
25 45 0.059050
32 2 0.055488
32 4 0.054301
32 5 0.053509
32 6 0.052915
32 7 0.052421
32 8 0.052223
32 10 0.052039
32 11 0.051431
32 12 0.050639
32 14 0.050045
32 15 0.048858
32 16 0.047472
32 17 0.047389
32 18 0.046528
32 20 0.045237
32 21 0.044376
32 22 0.042309
32 23 0.038176
32 24 0.036686
32 26 0.032034
32 27 0.028274
32 28 0.023820
32 29 0.021148
32 30 0.015706
32 31 0.006106
32 33 0.005611
32 34 0.009669
32 35 0.013726
32 36 0.019268
32 37 0.024612
32 39 0.027086
32 40 0.027482
32 41 0.032232
32 42 0.035696
32 43 0.038368
32 45 0.040248
38 2 0.066667
38 4 0.066667
38 5 0.065875
38 6 0.065183
38 7 0.064985
38 8 0.064886
38 10 0.065084
38 11 0.063995
38 12 0.063698
38 14 0.062412
38 15 0.061125
38 16 0.060464
38 17 0.060119
38 18 0.059344
38 20 0.059086
38 21 0.058483
38 22 0.056933
38 23 0.055125
38 24 0.053505
38 26 0.051130
38 27 0.047171
38 28 0.043312
38 29 0.040838
38 30 0.036440
38 31 0.029809
38 33 0.025301
38 34 0.021342
38 35 0.014654
38 36 0.011641
38 37 0.006795
38 39 0.006300
38 40 0.011743
38 41 0.017186
38 42 0.021639
38 43 0.024509
38 45 0.026785
44 2 0.070814
44 4 0.069825
44 5 0.069330
44 6 0.068538
44 7 0.068043
44 8 0.068142
44 10 0.068433
44 11 0.067746
44 12 0.066757
44 14 0.066658
44 15 0.065668
44 16 0.064382
44 17 0.064472
44 18 0.064041
44 20 0.063094
44 21 0.062233
44 22 0.062233
44 23 0.060941
44 24 0.059038
44 26 0.058246
44 27 0.057355
44 28 0.054485
44 29 0.050953
44 30 0.044925
44 31 0.040017
44 33 0.037167
44 34 0.033990
44 35 0.032516
44 36 0.030438
44 37 0.026083
44 39 0.021135
44 40 0.015890
44 41 0.013020
44 42 0.009952
44 43 0.005895
44 45 0.005994
46 2 0.077236
46 4 0.077335
46 5 0.076840
46 6 0.075850
46 7 0.075356
46 8 0.075455
46 10 0.075321
46 11 0.074861
46 12 0.073970
46 14 0.072981
46 15 0.071892
46 16 0.071790
46 17 0.072135
46 18 0.071963
46 20 0.071397
46 21 0.070803
46 22 0.068949
46 23 0.067399
46 24 0.065756
46 26 0.065261
46 27 0.064371
46 28 0.064074
46 29 0.063007
46 30 0.059522
46 31 0.055068
46 33 0.050318
46 34 0.046459
46 35 0.045766
46 36 0.044281
46 37 0.040125
46 39 0.035177
46 40 0.030031
46 41 0.027161
46 42 0.024687
46 43 0.021025
46 45 0.017957

Code used:

import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
from matplotlib.colors import ListedColormap, LinearSegmentedColormap
import pygimli as pg
import pygimli.physics.traveltime as tt

seis_2 = LinearSegmentedColormap('testCmap', segmentdata=cdict, N=256)

data = tt.load('PK2-picks.sgt', verbose=True)
print(data)

fig, ax = plt.subplots()
tt.drawFirstPicks(ax, data)

mgr = tt.TravelTimeManager(data)
ax, cbar = mgr.showData(cMin=500, cMax=6000, cMap=seis_2)

mgr.invert(secNodes=3, paraMaxCellSize=10.0, zWeight=0.2, vTop=500, vBottom=5000, maxIter=15, verbose=1)
# %%
ax, cbar = mgr.showData(firstPicks=True, linewidth=0)
tt.drawFirstPicks(ax, data, mgr.inv.response, marker=None)

mgr.showResultAndFit(cMin=500, cMax=6000, cMap=seis_2)
mgr.saveResult()  # saves the results (mesh, velocity, vtk) in a folder

ax, cbar = mgr.showResult(logScale=False, cMin=500, cMax=6000, cMap=seis_2,
                          coverage=mgr.standardizedCoverage())
mgr.drawRayPaths(ax=ax, color="k", lw=0.3, alpha=0.5)

Expected behavior

This is result with no topography implemented in data file (zeroes in second column):
image

Actual behavior

This is what I'm getting, with real topography in datafile (see above):
image

The topo line (thick black) looks correct, but the inversion results and rays are upside down ... If I set in the data file all z coordinates to 0 (zero) everything looks fine (see image above).

It is unclear to me from the documentation what might be wrong

@halbmy
Copy link
Contributor

halbmy commented May 22, 2023

Indeed a strange error that I can reproduce. As a workaround, you can avoid it by using the token y instead of z in the sensor list.
image

However, the mesh is too wide for the given sensors. Need to dig into that.

@skytter
Copy link
Author

skytter commented May 22, 2023

Thank you @halbmy

@halbmy
Copy link
Contributor

halbmy commented May 24, 2023

I fixed both the problem with XY and the unnecessary boundary. It is all included in the brand-new version v1.4.1. Please check it out whether it solves your problem.

@halbmy halbmy self-assigned this Jun 1, 2023
@halbmy halbmy added the bug label Jun 1, 2023
@halbmy halbmy added this to the 1.4.1 milestone Jun 1, 2023
@halbmy
Copy link
Contributor

halbmy commented Jun 19, 2023

The issue has been solved, so I am closing it. Thank you for reporting.

P.S.: If somebody invests time to solve my problem, I would at least give a short notice whether it helps or not.

@halbmy halbmy closed this as completed Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants