crotwell / seisFile

A library for reading and writing seismic file formats in java.
GNU Lesser General Public License v3.0
27 stars 20 forks source link

SeisFile having issues parsing StationXML (1.1) files produced from SIS #17

Closed amkearns-usgs closed 4 years ago

amkearns-usgs commented 4 years ago

Example file from SIS: https://files.anss-sis.scsn.org/production/FDSNStationXML1.1/N4/N4_735B.xml

Produces the following stack trace: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at edu.sc.seis.seisFile.fdsnws.stationxml.Equipment.parseSubElement(Equipment.java:72) at edu.sc.seis.seisFile.fdsnws.stationxml.Equipment.(Equipment.java:28) at edu.sc.seis.seisFile.fdsnws.stationxml.Sensor.(Sensor.java:15) at edu.sc.seis.seisFile.fdsnws.stationxml.Channel.(Channel.java:59) at edu.sc.seis.seisFile.fdsnws.stationxml.Station.(Station.java:57) at edu.sc.seis.seisFile.fdsnws.stationxml.StationIterator.next(StationIterator.java:25)

Not sure if this is a flaw in the XML or in SeisFile.

amkearns-usgs commented 4 years ago

N4_735B.xml.txt

Have attached file (with added .txt extension) in case the SIS data somehow changes

crotwell commented 4 years ago

Believe this is fixed. Can you test using: http://www.seis.sc.edu/downloads/seisFile/seisFile-1.8.5-SNAPSHOT.tgz

Will push out a new release once you have verified.

amkearns-usgs commented 4 years ago

That release doesn't seem to have a buildscript, and using the buildscript from the latest repo commits seems to be causing issues (creates a BuildVersion.java file whose package is edu.sc.seis.seisFile.1.8.5.SNAPSHOT). How should we go about building that?

crotwell commented 4 years ago

Not sure I understand why you are trying to rebuild. The tar file has the jar in the lib directory, along with all dependency jars. Can you just use it without recompiling?

lib/seisFile-1.8.5-SNAPSHOT.jar

amkearns-usgs commented 4 years ago

Ah, did not see that the library was already compiled in that folder.

amkearns-usgs commented 4 years ago

OK. The XML appears to load correctly.