gimli-org / gimli

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

Issue on importing a filtered ERT dataset #665

Closed IsabellaLorenzen closed 2 months ago

IsabellaLorenzen commented 2 months ago

Problem description

I wish to import a filtered ERT dataset so that i can visualize the datapoints removed. However i have trouble importing the dataset.

On an issue posted on this page earlier on this date i succesfully imported raw ERT data with the following code: dataset=pg.physics.ert.load("/Users/Isabe/Desktop/Procesering af ERT/1. felttur/Gradient XL_2-2023-06-29-172138.dat")

However i get an error message when i try to import the filtered data with this code: datafiltered=pg.physics.ert.load("/Users/Isabe/Desktop/Filtrering af ERT data/Check filter 1.txt")

It is very possible that there is some issue with the data files themselves, as the filtered data file is not 100% similar to the original datafile. I have e.g. removed the IP-columns. In the two following pictures you can see the differance.

I am a fairly inexperienced programmer, and I am attepting to make the filtered datafile as similar to the original as possible, but I could use a hand to understand why the .txt file are not able to import, so I can figure out what changes to make.

A screenshot of the .dat file of the raw data that was succesfully imported

image

A screenshot of the .txt. file of the filtered data that was not able to import

image

Your environment

OS : Windows CPU(s) : 8 Machine : AMD64 Architecture : 64bit RAM : 7.8 GiB Environment : IPython

Python 3.9.18 | packaged by conda-forge | (main, Dec 23 2023, 16:29:04) [MSC v.1929 64 bit (AMD64)]

       pygimli : 1.4.6
        pgcore : 1.4.0
         numpy : 1.26.4
    matplotlib : 3.7.2
         scipy : 1.11.2
       IPython : 8.15.0
       pyvista : 0.43.3

Steps to reproduce

import pygimli as pg import pybert as pb

datafiltered=pg.physics.ert.load("/Users/Isabe/Desktop/Filtrering af ERT data/Check filter 1.txt")


### Expected behavior

I expected the data to be imported succesfully like with the unfiltered data. 

### Actual behavior

The filtered data was not imported succesfully, as the following error message was given. 

04/03/24 - 15:51:58 - pyGIMLi - INFO - could not read unified data format for ERT ... try res2dinv 04/03/24 - 15:51:58 - pyGIMLi - INFO - could not read res2dinv ... try Ascii columns 04/03/24 - 15:51:58 - pyGIMLi - INFO - Failed importing Ascii column file. Consider using pybert. 04/03/24 - 15:51:58 - pyGIMLi - INFO - No electrode positions found! Traceback (most recent call last):

File ~\anaconda3\envs\pg\lib\site-packages\spyder_kernels\py3compat.py:356 in compat_exec exec(code, globals, locals)

File c:\users\isabe\desktop\filtrering af ert data\visualisering af datafiltrering i pygimli.py:27 datafiltered=pg.physics.ert.load("/Users/Isabe/Desktop/Filtrering af ERT data/Check filter 1.txt")

File ~\anaconda3\envs\pg\lib\site-packages\pygimli\physics\ert\importData.py:48 in load data = pb.importData(fileName)

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



> 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".
halbmy commented 2 months ago

Strange indeed, maybe at the end of the file, probably just a little bug. Can you attach the data file?