gimli-org / gimli

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

Issue with creating topography for 2D ERT inversion #602

Closed msnookusgs closed 7 months ago

msnookusgs commented 7 months ago

Hi all,

I'm working on inverting some ERT field data, and I'm running into issues with getting topography represented accurately.

I am reading in data from a sting file (.stg) using pybert, and these data have the x positions of the electrodes stored but do not have the z positions (elevation) as we collected these separately. Therefore, the automatically generated mesh produced by the invert function is flat and yields an inaccurate inversion.

image

I have tried creating my own mesh by making polygons based on the true electrode positions, but when I try running the inversions using my own created mesh I get the error: "There is a requested electrode that does not match the given mesh. " My thinking is this could be because there are two extra nodes introduced when I try to make the mesh a rectangle (vertices placed at the bottom left and bottom right corners of this graph).

image

So, I guess I have 2 main questions about how I should proceed.

  1. Is there a way I can add the z values for electrodes directly to the Data Container that's created when I load the data? This would be easiest as the invert function should then be able to accurately create a default mesh whenever it's run.
  2. Is there a different way I should go about creating my own mesh? Ideally, I would just want the nodes to be the electrode positions, and my goal is to see about 35m of the subsurface. I do not have a layered model or anything for these sites, so what I want is for the inversion domain to be what I produced in the previous figure, but that will work with the invert function.

Thanks for any and all suggestions. Michael

halbmy commented 7 months ago

Yes, you have to modify the electrode positions in the data container and then the mesh generation should work automatically. Say you have the electrode heights in an array ez, then you can set them by

for i, el in enumerate(data.sensors()):
    data.setSensor(i, [el.x(), ez[i]])
msnookusgs commented 7 months ago

Thank you! Worked perfectly.