Closed NoteboomM closed 1 month ago
I would always prefer original instrument files as they bear more information (e.g. errors, current and voltage and not just apparent resistivity like in res2dinv). About the SuperSting import, there is an import routine in the pyBERT project (https://gitlab.com/resistivity-net/bert): https://gitlab.com/resistivity-net/bert/-/blob/master/python/pybert/importer/importData.py?ref_type=heads#L1845
Please try pb.importData('myfile.stg)
and report any error by raising an issue in the BERT project, attaching your file, so that we can fix it.
The problem in your file is the following: the unified BERT/GIMLi format consists of a list of electrodes and then the ABMN columns are just indices into the electrode list, so instead of
890
# a b m n r ip/ms err/%
0 20 40 60 -5.01792E-01 1.20190E-02 5.00000E-01
0 20 60 80 -9.18413E-02 1.64594E-02 2.00000E-01
0 20 80 100 -4.80586E-02 7.63345E-03 5.00000E-01
you would have
6
#x y
0 0
20 0
40 0
60 0
80 0
100 0
890
# a b m n r ip/ms err/%
1 2 3 4 -5.01792E-01 1.20190E-02 5.00000E-01
1 2 4 5 -9.18413E-02 1.64594E-02 2.00000E-01
1 3 5 6 -4.80586E-02 7.63345E-03 5.00000E-01
I copied the specified 8 lines into a file test.stg
and read it successfully with
import pybert as pb
data = pb.importData("test.stg")
print(data)
with the result
Data: Sensors: 8 data: 5, nonzero entries: ['a', 'b', 'err', 'i', 'ip', 'ip1', 'ip2', 'ip3', 'ip4', 'ip5', 'ip6', 'm', 'n', 'rhoa', 'u', 'valid']
Thanks @halbmy. After a break for lunch, I re-read the BERT site and worked out what I had wrong there. And I agree, it's always good to go to the original where possible, but in my script to make my own BERT file, I carried over a few of those extra fields.
After fixing the BERT format, and with using pybert for the stg file, both import and seem to work with anything I try, thanks!
But maybe it's a separate issue, for both import approaches, I still only get this from print(data):
Data: Electrodes: 42 data: 889
I don't know that it is critical for other functions, but it's useful to have that list of nonzero fields.
Can you attach your stg file?
Here it is (zipped as github rejected the stg file). I've been trying a few more things, and different approaches/inversion settings, and everything seems fine with it practically speaking.
I did
import pybert as pb
data = pb.importData("DD4384(1-3).stg")
print(data, data.tokenList())
data.show()
and it works well
Data: Electrodes: 42 data: 889 SensorIdx: a b m n Data: err i ip ip1 ip2 ip3 ip4 ip5 ip6 iperr k r rhoa u valid
I realized that pyBERT was overwriting the DataContainerERT.__repr__
function so that the included tokens were not shown. This is now corrected in the pyBERT code.
Thanks Thomas - can I pull that update from git or somewhere? I think I installed pybert from an anaconda prompt.
You don't really need this update if you print(data.tokenList())
which was just not included in print(data)
when importing from pyBERT. Just a detail. But of course it is generally better to update pyBERT by git instead of conda (https://gitlab.com/resistivity-net/bert)
Problem description
I've had some success with ERT import and inversion when I have Res2dInv formatted .dat files, but I'm hoping to be able to use pygimli as an alternative. The current source I have from the field is in .stg files from a Supersting instrument, but import is not working properly, and when I convert to what (to me) looks like the unified data format, import doesn't work at all.
Your environment
Steps to reproduce
The code is probably not very helpful, as the issue is simply with:
However, sample input may be helpful? My attempt at the UDF-ERT looks like this:
and the supersting file looks like this:
Expected behavior
I'm trying to produce a data container that I can use for inversion, but what I'm getting has issues
Actual behavior
From the file that I think is UDF-ERT, I get the following response:
followed by a wave of:
for every line/column combination, and then a wave of hundreds of:
and at the end, there is no data container. Even if this is not proper UDF-ERT, it is clearly ASCII in columns...but doesn't read as that either.
If I try to import the supersting file, I get this response:
and I then have a data container that appears to have the electrode positions and resistivity, but if I do a print(data), I don't get the information about which valid columns are there, and I can't do ert.show(data['??']) for any parameter except rhoa.