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

Joint inversion module missing #714

Open
zmd142536 opened this issue May 9, 2024 · 3 comments
Open

Joint inversion module missing #714

zmd142536 opened this issue May 9, 2024 · 3 comments

Comments

@zmd142536
Copy link

Problem description

AttributeError: module 'pybert' has no attribute 'Resistivity'

Your environment

Please provide the output of print(pygimli.Report()) here. If that does not
work, please give provide some additional information on your:

Linux: e.g.Linux
Python 3.11: e.g. 3.11
pyGIMLi 1.5.0: Output of print(pygimli.1.5)

Steps to reproduce

I attempted to perform joint inversion using data from both the three-level device and the dipole device, but encountered an error message: AttributeError: module 'pybert' has no attribute 'Resistivity'

Expected behavior

First, I'd like to know if it's a version issue causing this. Secondly, is what I'm doing now correct? Lastly, could you please provide me with an example of joint inversion using ERT three-level device data and dipole device data? Sending my warmest wishes.

Actual behavior

Tell us what happens instead and/or provide the output of your script.

import pybert as pb
from pybert.importer import importRes2dInv
data = importRes2dInv('/media/zmd/C512-DE536/py联合反演/三级和四级装置联合反演/RESDATA/230318-1-ouji/230318-1-ouji_rd.dat')
pb.show(data)

# %% load ert data
from pybert.importer import importRes2dInv
data = importRes2dInv('/media/zmd/C512-DE536/py联合反演/三级和四级装置联合反演/RESDATA/230318-1-sj/230318-1-sj_rd.dat')
pb.show(data)
# %% do ERT inversion
ert = pb.Resistivity(data)
ert.invert()  # maxIter=0 to speed things up
# %% use ERT mesh for SRT inversion
pd = ert.paraDomain
for c in pd.cells():
    c.setMarker(1)
data = importRes2dInv('/media/zmd/C512-DE536/py联合反演/三级和四级装置联合反演/RESDATA/230318-1-ouji/230318-1-ouji_rd.dat')
ert.setMesh(pd)
ert.invert()
pb.show(data)
 

If possible, please add one or more labels to your issue, e.g. if you expect that your issue is rather a question than a problem with the code, please add the label "question".

@zmd142536
Copy link
Author

Sorry, it seems that I can't upload files in .dat format, so I've converted it to a .txt file。
230318-1-ouji_rd.txt
230318-1-sj_rd.txt

@halbmy
Copy link
Contributor

halbmy commented May 13, 2024

The pybert.Resistivity class is outdated and has been replaced by the ERTManager class contained in the ERT module (pygimli.physics.ert). Also the importer for res2dinv files is part of that module and you should be able to process your data without using pybert at all.

@halbmy
Copy link
Contributor

halbmy commented Jun 7, 2024

It seems the data files are just two ERT data sets with different arrays (Wenner-beta and pole-dipole) that should be easily inverted together but just adding the data

from pygimli.physics import ert
data1 = ert.load("wenner.dat")
data2 = ert.load("pole-dipole.dat")
data1.estimateError()
data2.estimateError()
mgr1 = ert.Manager(data1)
mgr1.invert(...)  # single inversion
mgr2 = ert.Manager(data1)
mgr2.invert(...)  # single inversion
data1.add(data2)
mgr1 = ert.Manager(data1)
mgr1.invert(...)  # inversion of both

I would not even call this joint inversion as it is common to combine different data sets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants