gimli-org / gimli

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

Please help me, I'm new to this. Provide me with the code for Schlumberger VES inversion with field data #673

Closed ferryatm closed 2 months ago

ferryatm commented 2 months ago

Datasheet TA.xlsx

Discussed in https://github.com/gimli-org/gimli/discussions/672

Originally posted by **ferryatm** March 15, 2024 Please help me, I'm new to this. Provide me with the code for Schlumberger VES inversion with field data. | MN/2 (m) | AB/2 (m) | Rho Apparent (Ohm.m) | |----------|----------|-------------------------| | 0.5 | 1.5 | 5.635211 | | 0.5 | 2.0 | 4.612248 | | 0.5 | 2.5 | 4.513198 | | 0.5 | 3.0 | 4.17725 | | 0.5 | 4.0 | 5.30145 | | 0.5 | 5.0 | 4.7350773 | | 0.5 | 6.0 | 4.3606916 | | 1.0 | 6.0 | 4.3606916 | | 1.0 | 7.0 | 4.614735575 | | 1.0 | 8.0 | 5.28781021 | | 1.0 | 9.0 | 5.463961275 | | 1.0 | 10.0 | 5.334367416 | | 1.0 | 12.0 | 5.871748295 | | 1.0 | 15.0 | 6.864989891 | | 5.0 | 15.0 | 6.864989891 | | 5.0 | 20.0 | 8.31374329 | | 5.0 | 25.0 | 10.45239054 | | 5.0 | 30.0 | 11.65316963 | | 10.0 | 30.0 | 11.65316963 | | 10.0 | 40.0 | 13.94573528 | | 10.0 | 50.0 | 16.34242351 | | 10.0 | 60.0 | 17.40842728 | | 20.0 | 60.0 | 17.40842728 | | 20.0 | 70.0 | 20.31610704 | | 20.0 | 80.0 | 19.13295652 | | 20.0 | 90.0 | 20.17732947 | | 20.0 | 100.0 | 20.20464984 |
ferryatm commented 2 months ago

Please help me just this once

halbmy commented 2 months ago

Here's some code. Most things are, however, about reading and filtering data using numpy and pandas.

import pygimli as pg
from pygimli.physics import ves
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
xls = pd.read_excel("Datasheet.TA.xlsx", skiprows=9)
print(xls)
xls = xls.dropna(subset="Rho (Ohm.m)")
ab2 = xls["AB/2 (m)"].array
mn2 = xls["MN/2 (m)"].array
rhoa = xls["Rho (Ohm.m)"].array
mgr = ves.VESManager()
mgr.fop.setDataSpace(ab2=ab2, mn2=mn2)
mgr.invert(rhoa, err=np.ones_like(rhoa)*0.05, verbose=True)
fig, ax = plt.subplots()
ax.loglog(rhoa, ab2, "x", label="data")
ax.loglog(mgr.inv.response, ab2, "+-", label="response")
ax.grid()
ax.legend()
ax.invert_yaxis()

image

fig, ax = plt.subplots()
pg.viewer.mpl.drawModel1D(ax, model=model)

image

ferryatm commented 2 months ago

Thank you very much. May I ask for one more assistance? Can this VES data be used for 2D modeling? If so, please kindly provide the code. I truly apologize if this causes any inconvenience.

ferryatm commented 2 months ago

image

please I have an error regarding this, same with np.bool, np.long and others, it's like an outdated version of numpy, is there any solution?

ferryatm commented 2 months ago

This is related to the code you provided

halbmy commented 2 months ago

This seems to be an outdated numpy version, which one do you have?

halbmy commented 2 months ago

Can this VES data be used for 2D modeling?

Generally, of course. However, it makes only sense for a couple of (overlapping) soundings. You would have to collect the data in a DataContainerERT. In case of separated soundings, an LCI inversion is more appropriate.

ferryatm commented 2 months ago

Numpy version 1.24.4

halbmy commented 2 months ago

This is a quite modern version. It seems like you are using an outdated pyGIMLi version (which one?) that is no more compatible with modern numpy. The problem was solved with v1.3.1. Try update pyGIMLi (or downgrade numpy).

ferryatm commented 2 months ago

Thank you in advance, I might give it a try first, but please don't close it temporarily because I really need guidance and assistance as a newcomer


Dari: Thomas Günther @.> Dikirim: Jumat, 15 Maret 2024 15.54 Kepada: gimli-org/gimli @.> Cc: FERRY ATH THAARIQ MUDHOFIR @.>; Author @.> Subjek: Re: [gimli-org/gimli] Please help me, I'm new to this. Provide me with the code for Schlumberger VES inversion with field data (Issue #673)

This is a quite modern version. It seems like you are using an outdated pyGIMLi version (which one?) that is no more compatible with modern numpy. The problem was solved with v1.3.1. Try update pyGIMLi (or downgrade numpy).

— Reply to this email directly, view it on GitHubhttps://github.com/gimli-org/gimli/issues/673#issuecomment-1999199150, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AYMQCYRRCQJK2XZG6SNW2MLYYKZNXAVCNFSM6AAAAABEWV75MWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJZGE4TSMJVGA. You are receiving this because you authored the thread.Message ID: @.***>

halbmy commented 2 months ago

As the original issue had been solved and the last problems are not related to the title and are probably due to an outdated pyGIMLi version, I am closing the issue. In case of any problem with a modern version, please raise a new issue.