iris-edu / stationxml-seed-converter

Station XML/Seed converter
GNU General Public License v3.0
15 stars 11 forks source link

Not mapping vertical channels to an <Azimuth> element breaks some loaders #41

Closed seismopaul closed 4 years ago

seismopaul commented 4 years ago

The recent removal of Azimuth tags if the channel is vertical is going to break a lot of things.

It has already broken loading of StationXML converted from your tool into some databases which do not allow Azimuth to be null. People are not going to change their schema's to accommodate Station XML changes. Please reverse course on having azimuth being null for vertical sensors in this converter....otherwise we just have to add it in by hand to keep using your tool and that is going to get old fast.

timronan commented 4 years ago

Hello,

I am not sure what this message is describing. Can you please provide a specific example and a file so we can discuss/solve this issue. Which version of the validator is being used?

Attached is a test file, XXZ_Azimuth.txt, which successfully converts an azimuth from stationxml

   <Channel code="BDZ" endDate="2500-12-31T23:59:59" locationCode="00" restrictedStatus="open" startDate="2018-08-06T00:00:00">
 ...
    <Azimuth>359</Azimuth>
... 

to dataless seed:

052014900BDZ0000002~001002+47.661570-122.313320+0225.9000.0359.0

back to stationxml:

 <Channel locationCode="00" code="BDZ" startDate="2018-08-06T00:00:00Z" endDate="2500-12-31T23:59:59Z">
...
                <Azimuth>359.0</Azimuth>
...

Thanks for working with us on this issue.

XXZ_Azimuth.txt

seismopaul commented 4 years ago

I am not talking about the stationXML validator....I am discussing the converter.

I have a dataless that has all of the Vertical channels with Dip set to -90 and Azimuth set to 0.

When I convert this dataless to StationXML, the Dip element gets transferred but the Azimuth is not set at all for any of the Vertical channels. The 2.0.5 version did this correctly. Most database schema's for earthquake station metadata expect an Azimuth and the tradition has been that Azimuth 0 is used for verticals. It seems the converter recognizes that the orientation vector is straight up or down and leaves the Azimuth element out.

yazan-iris commented 4 years ago

Can you please attach the file you are describing, this may be a bug, the file will help us identify the issue. Thanks

seismopaul commented 4 years ago

Sadly, I cannot attach the file I am using as it is a proprietary network. Let me make a dummy station dataless and show you what I see.

seismopaul commented 4 years ago

See attached file. I just picked a dataless from Ohio...Note that all EHZ components when this is run through the 2.0.7 version of the converter have no Azimuth element.

seismopaul commented 4 years ago

Okay, that attachment did not work..Not sure why I cannot drag a seed dataless into github.......just go to the dataless repo at IRIS, pick the OH.dataless and run that through the converter. Every station that has EHZ or HHZ components has only a element and no element, despite the Azimuth being set to 0 in the dataless. Please fix this as this will break a lot of StationXML to database loaders. Thanks.

timronan commented 4 years ago

I just confirmed that the converter exhibits the behavior you are describing. This behavior only occurs when the dip is assigned +/- 90 and the azimuth is assigned 0. An example dataless is attached. @seismopaul thank you very much for bring this edge case to our attention. We will work on getting a fix for it promptly.

Also, dataless and stationxml files can be posted to github issues but need to be labeled with the file extension .txt. Once the metadata are downloaded, the file extension can be corrected.

AzimuthConversion.txt

chad-earthscope commented 4 years ago

Also, dataless and stationxml files can be posted to github issues but need to be labeled with the file extension .txt. Once the metadata are downloaded, the file extension can be corrected.

Much better is to zip what you want to attach if it's not supported natively.

Allowed attachments are noted here: https://help.github.com/en/github/managing-your-work-on-github/file-attachments-on-issues-and-pull-requests

timronan commented 4 years ago

This issue has been fixed by commit 2e9a2845d25667bf8f7ca65b9787b6ad0fc4ae55 and has been published as release stationxml-seed-converter-2.0.8-SNAPSHOT. Please pull or build the jar, test the converter, and close the issue if satisfied.

seismopaul commented 4 years ago

I confirm that this is fixed in 2.0.8. Thanks folks!!!