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

In StationXML, the Country element gets written as a list for no good reason #202

Closed akelbert closed 8 months ago

akelbert commented 8 months ago

This seems like a relatively new issue, but in the StationXML the Site gets written as, e.g.,

Hualapai Valley, AZ, USA ['USA']

There's no reason for the Country to be a list. I've tried to fix/change this but couldn't. In metadata.py, the function from_dict() copies the (str) country element from meta_dict into the (str) country element in the Survey class (self) and this initiates a list. It doesn't happen with any of the other string elements in the Survey class.

I'm about to resubmit a large number of StationXMLs to EarthScope (updating some of the filters, declination and elevation values) and I would prefer to create StationXMLs that don't have obvious issues. If you could help me fix this soon enough, that will result in better StationXMLs. Thanks a lot!

akelbert commented 8 months ago

`

Hualapai Valley, AZ, USA ['USA']

`

(example above)

kujaku11 commented 8 months ago

@akelbert Fixed with PR #203. Hopefully you can pull from main. I don't have time to release this into Pypi until this weekend. Let me know if the fix doesn't work.