-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XML -> DATALESS sample rate format glitch? (2.1.0) #63
Comments
@filefolder I cannot reproduce your result with the provided test case. Can you please provide a different test case so your issue can be reproduced and inspected? |
It's literally every test case I can find at IRIS, AUSPASS, GFZ, etc. I'll attach an example anyway, from GFZ. I've also personally tested on OSX with java 17+35-LTS-2724, linux with java 11.0.11+9-Ubuntu-0ubuntu2.20.04, and the user who initially reported this to me was on windows I think. Note that it works if the inventory is "station" level but fails for either channel or response, which makes sense as there isn't any SR information. |
How's this going? I take it there still no error on your end? If so could you post a copy of the compiled binary you are using? Unfortunately it seems like some of the source java (e.g. dmc.io, dmc.seed, dmc.station.model, etc) is missing from github here (?) so I can't really see what's happening or attempt a new compile myself. |
Here is a test: curl -sJLO 'https://github.com/iris-edu/stationxml-seed-converter/releases/download/stationxml-seed-converter-2.1.0/stationxml-seed-converter-2.1.0.jar'
curl -so anmo.xml 'https://service.iris.edu/fdsnws/station/1/query?net=IU&sta=ANMO&loc=00&cha=BHZ&level=response&format=xml&includecomments=true&nodata=404'
java -jar stationxml-seed-converter-2.1.0.jar --input anmo.xml --output anmo.dataless This should complete quietly with a resulting anmo.dataless. On macOS (12.01), running java version "1.8.0_60": No problems. In each case the environment variable LANG is set to $ export LANG=en_AU.UTF-8
$ echo $LANG
en_AU.UTF-8 then $ java -jar stationxml-seed-converter-2.1.0.jar --input anmo.xml --output anmo.dataless
java.lang.NumberFormatException: Couldn't format number, value: 20.0 format: 0.0000E-00 pattern: 0.0000E00 actual: 2.0000e01 [10 9 ]
at edu.iris.dmc.io.SeedStringBuilder.append(SeedStringBuilder.java:267)
at edu.iris.dmc.seed.control.station.B052.toSeedString(B052.java:303)
... Bang, fireworks. Guessing your locale is different, set using the This should probably also be fixed in the converter as the format cannot use any other number formatting, and the formatting cannot be specified by the user. |
This is also covered in the main README: |
Thanks! Never would have guessed. Possibly also worth specifying that it must be US English in the readme. I'll leave this post up but feel free to close if you think it's covered in #64 now |
Thanks for finding this cause, Chad. There is a way to assert locale in the Java code, so I think that Tim and Yazan can in fact find a solution for this for all users.
-Rob
… On Nov 1, 2021, at 2:25 PM, filefolder ***@***.***> wrote:
Thanks! Never would have guessed. Possibly also worth specifying that it must be US English in the readme.
I'll leave this post up but feel free to close if you think it's covered in #64 <#64> now
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub <#63 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AFL4VN47QN3NLM57VHVT46DUJ4AVLANCNFSM5GGDJELA>.
Triage notifications on the go with GitHub Mobile for iOS <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Hi,
Seems to be a bug/mixup between the E00 and E-00 type formatting in samplerate when converting from stationXML to dataless.
I've tested various datacenters and the problem is consistent, even at IRIS e.g. IU.ANMO
$ java -jar stationxml-seed-converter-2.1.0.jar --input anmo.xml --output anmo.dataless java.lang.NumberFormatException: Couldn't format number, value: 20.0 format: 0.0000E-00 pattern: 0.0000E00 actual: 2.0000e01 [10 9 ] at edu.iris.dmc.io.SeedStringBuilder.append(SeedStringBuilder.java:267) at edu.iris.dmc.seed.control.station.B052.toSeedString(B052.java:303) at edu.iris.dmc.seed.AbstractBlockette.getSize(AbstractBlockette.java:72) at edu.iris.dmc.seed.Volume.add(Volume.java:266) at edu.iris.dmc.station.converter.XmlToSeedDocumentConverter.convert(XmlToSeedDocumentConverter.java:112) at edu.iris.dmc.station.converter.XmlToSeedDocumentConverter.convert(XmlToSeedDocumentConverter.java:48) at edu.iris.dmc.station.converter.XmlToSeedFileConverter.convert(XmlToSeedFileConverter.java:426) at edu.iris.dmc.station.converter.XmlToSeedFileConverter.convert(XmlToSeedFileConverter.java:70) at edu.iris.dmc.station.Application.convert(Application.java:189) at edu.iris.dmc.station.Application.run(Application.java:127) at edu.iris.dmc.station.Application.main(Application.java:70) edu.iris.dmc.station.mapper.MetadataConverterException: java.lang.NumberFormatException: Couldn't format number, value: 20.0 format: 0.0000E-00 pattern: 0.0000E00 actual: 2.0000e01 [10 9 ] at edu.iris.dmc.station.converter.XmlToSeedDocumentConverter.convert(XmlToSeedDocumentConverter.java:329) at edu.iris.dmc.station.converter.XmlToSeedDocumentConverter.convert(XmlToSeedDocumentConverter.java:48) at edu.iris.dmc.station.converter.XmlToSeedFileConverter.convert(XmlToSeedFileConverter.java:426) at edu.iris.dmc.station.converter.XmlToSeedFileConverter.convert(XmlToSeedFileConverter.java:70) at edu.iris.dmc.station.Application.convert(Application.java:189) at edu.iris.dmc.station.Application.run(Application.java:127) at edu.iris.dmc.station.Application.main(Application.java:70) Caused by: java.lang.NumberFormatException: Couldn't format number, value: 20.0 format: 0.0000E-00 pattern: 0.0000E00 actual: 2.0000e01 [10 9 ] at edu.iris.dmc.io.SeedStringBuilder.append(SeedStringBuilder.java:267) at edu.iris.dmc.seed.control.station.B052.toSeedString(B052.java:303) at edu.iris.dmc.seed.AbstractBlockette.getSize(AbstractBlockette.java:72) at edu.iris.dmc.seed.Volume.add(Volume.java:266) at edu.iris.dmc.station.converter.XmlToSeedDocumentConverter.convert(XmlToSeedDocumentConverter.java:112) ... 6 more [2021-10-18 20:01:40] [SEVERE] edu.iris.dmc.station.Application run: edu.iris.dmc.station.Application.exitWithError(Application.java:204) edu.iris.dmc.station.Application.convert(Application.java:194) edu.iris.dmc.station.Application.run(Application.java:127) edu.iris.dmc.station.Application.main(Application.java:70)
The text was updated successfully, but these errors were encountered: