gimli-org / gimli

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

Petrophysical joint inversion: smooth the output result #742

Closed makeabhishek closed 4 months ago

makeabhishek commented 5 months ago

It can be seen in Petrophysical joint inversion example, the results are quite coarse. How can we smooth the output result or interpolate to make it smoother, so that we cannot see the triangular mesh features.

halbmy commented 4 months ago

If you want a finer mesh, you should specify a higher mesh quality or a maximum cell size. There are plenty of examples on this on pygimli.org

But they triangles represent the underlying discretization, so I see no point in post smoothing a result as this model would not fit the data anymore.

makeabhishek commented 4 months ago

Thanks, I meant if a smooth inverted results can be post processed without using finer mesh. Also to avoid seething mesh triangles. May be something like interpolation like in plt.imshow()

florian-wagner commented 4 months ago

Hi @makeabhishek,

you could interpolate the cell values to the nodes. As a consequence, the show function will recognize it as a field and not show the underlying mesh. But in most cases, showing the mesh is more beneficial as it shows the real discretizaiton used. So do not overdo it with interpolating your results just for "smooth visiualization" purposes.

Here a minimal example.

import pygimli as pg
mesh = pg.createGrid(30,30)
celldata = pg.x(mesh.cellCenters())
pg.show(mesh, pg.meshtools.cellDataToNodeData(mesh, celldata))