kujaku11 / mt_metadata

Tools for standardizing metadata, geared towards magnetotelluric (MT) data but is general enough to accommodate "any" type of metadata.
https://mt-metadata.readthedocs.io/en/latest/
MIT License
19 stars 5 forks source link

Fix a bug that prevents correct StationXMLs for stations with "EX" "EY" in their names #199

Closed akelbert closed 8 months ago

akelbert commented 8 months ago

There's a very subtle bug that caused the Ex or Ey channels to be overwritten (with the other one) and therefore never recorded in StationXML for sites with names such as REX11, REY12 etc containing "EX" and "EY" in their names. In principle this can also happen to sites with "HX" "HY" "HZ" in their names but that hasn't happened yet. Took me a full day of debugging to locate this problem.

In from_many_mt_files.py, line 185: fn.name.lower() needs to be replaced with fn.name[len(station):].lower()

kujaku11 commented 8 months ago

@akelbert Good find, bummer it took so long to find. Do you need this to be in a release that can be installed by pip or conda-forge? I added your proposed fix to the main branch and will create a release later, but if you need it sooner I can prioritize a release.

akelbert commented 8 months ago

Thanks for fixing it! Yes, would be great to merge it into a pip release. No urgency since I'm working with my local copy where I have this fixed, but the sooner the better, of course!