emerald-geomodelling / libaarhusxyz

Parser for the Aarhus Workbench XYZ format
MIT License
2 stars 0 forks source link

`libaarhusxys` fails to properly read data exported from aarhus workbench #11

Closed mp-emrld closed 2 years ago

mp-emrld commented 2 years ago

The xyz-ascii file with data exported from Aarhus workbench might have EM data in columns named like: DBDT_Ch1GT1 DBDT_Ch1GT2 DBDT_Ch1GT3 DBDT_Ch1GT4 DBDT_Ch1GT5 DBDT_Ch1GT6 DBDT_Ch1GT7 DBDT_Ch1GT8 DBDT_Ch1GT9 DBDT_Ch1GT10

the regex expression in xyz.py: ´_RE_LAYERCOL = re.compile(r"^(.*?)[([]([0-9]+)[)]]?$")´

dose only find data columns which have the follwing naming pattern:

... needs update, should also support

here DBDT_Ch1GTcould also be rho_i or resistivity any other prefix

example data file for testing:

/Volumes/GoogleDrive/Shared drives/PROJECTS/Projects/21041_NO_multiconsult_Grimstad-Sarpsborg_ReInterp/02_Interim/02_AEM-data/02_Pro-and-inv/05_inv-results/d20150717_20220525proc20150717_ManProcForMartin_AVG_export.xyz

eddjharrison commented 2 years ago

Ali will take a look today

MetalnAlloys commented 2 years ago

You can try the regex ^(.*?)[(_\[]?([0-9]+)[)\]]?$ i.e. a '?' character after [] in the second group

mp-emrld commented 2 years ago

hint from @MetalnAlloys:

You can try this one ^(.*?)[(_[]?([0-9]+)[)]]?$

redhog commented 2 years ago

@mp-emrld did this get resolved, or does the library still need updating?

Duke-of-Lizard commented 2 years ago

@MetalnAlloys, did you work on this at all? If you don't have uncommitted changes, I can attempt to solve this issue. I need to do so in order to tackle this ticket: https://github.com/emerald-geomodelling/Admin/issues/130

MetalnAlloys commented 2 years ago

@Duke-of-Lizard I have done some work on it. FIgured out two different regex however It would be nice if someone could test it because other than the columns mentioned by @mp-emrld , my knowledge of an xyz file is limited.

MetalnAlloys commented 2 years ago

Either this ^(.*?)[(_\[]?([0-9]+)[)\]]?$ or ^(.*?)[(_\[]?([0-9]?+)[)\]]?$ would work. Second one works actually very well but fails on a python error i.e. needs some other code changes

MetalnAlloys commented 2 years ago

* Correction: Second one = `^(.?)[(_[]?([0-9]?)[)]]?$`

Duke-of-Lizard commented 2 years ago

I made a commit to fix this: 858a7bd6304f81359d6f23e53f85cf097a3b27ec

https://github.com/emerald-geomodelling/libaarhusxyz/commit/858a7bd6304f81359d6f23e53f85cf097a3b27ec

However, I see some in a comment about how this change may affect parsing of ALC files. Does someone have an example ALC file to do a test with? @redhog or @mp-emrld or @burningsage ?

NOTE: this repo is public and open source, so please contact me directly about example files rather than pasting a link here, please.