gimli-org / gimli

Geophysical Inversion and Modeling Library :earth_africa:
https://www.pygimli.org
Other
344 stars 131 forks source link

Pass the sgt file #657

Closed ZHR0623 closed 2 months ago

ZHR0623 commented 2 months ago

When I have the forward file and want to invert it, do I have to place the file in a specific location and pass it using the data = pg.getExampleData() function? I don't really want to do that, can there be another way?

ZHR0623 commented 2 months ago

For example, some methods that use relative paths

halbmy commented 2 months ago

The function pg.getExampleData() is exclusively for loading data from the repository https://github.com/gimli-org/example-data so that the examples can be run by everyone.

For loading data on your local filesystem, you can use pg.load(filename) or in your case tt.load(), where from pygimli.physics import traveltime as tt, the filename can be global or relative to the path where you run the script or notebook.

ZHR0623 commented 2 months ago

反演结果200-2000 模型250-700-1500-2000 Here's my model and the inversion results. Obviously, the height is too big in the output, how can I change it? ax, _ = mgr.showResult(cMin=200, cMax=2000, logScale=False)

halbmy commented 2 months ago

I assume you mean the size of the modelling domain. You can set it by passing mgr.invert(paraDepth=60). By default it is determined by the maximum offset / 3. If you just want to control the image, you can use

ax, cb = mgr.showResult()
ax.set_ylim(-60, 0)
ZHR0623 commented 2 months ago

image Thank you for your reply to my question, it really solved the problem! This is the result of my rays, in fact, there are too many rays because it shows them all. Is there a function that enables to show only the rays of a certain excitation point or points, not all of them?

halbmy commented 2 months ago

It is a good idea to pass a list of source positions to showRayPaths in the future. Right now, you can retrieve the ray paths by

raypaths = mgr.getRayPaths() 

and then pass these to drawRayPaths, e.g.

mgr.drawRayPaths(ax, rayPaths=raypaths[5:7])

See https://www.pygimli.org/pygimliapi/_generated/pygimli.physics.traveltime.html#pygimli.physics.traveltime.TravelTimeManager.drawRayPaths

halbmy commented 2 months ago

In the pyGIMLi data container, there is only one list of sensors that can, however, flexibly used as shotpoints, geophones or both.

Please have a look at the documentation https://www.pygimli.org/pygimliapi/_generated/pygimli.physics.traveltime.html#pygimli.physics.traveltime.createRAData

The keyword shotDistance defines which sensors (by default every, but if using 5 only every fifth) are used as shotpoints. If you want to be more flexible, you are free to define the s and g fields.

I would like to close this issue as the original problem is solved and the discussion proceeded. Feel free to open a new issue or discussion with a changed title.