groundmotion-processing
groundmotion-processing copied to clipboard
Extracting data from ASDF bug
This was first identified by @jrekoske-usgs. It seems sometimes when we load an ASDF file, grab the StationStream, and then write it to a file using the ObsPy writers, we get nonsense results (e.g., values like -5.32860174e-298). @mhearne-usgs found that the data in memory after the ASDF file is loaded is correct, and the incorrect data only occurs after it is written to a file. It seems that the problem is that the numpy array data type is single precision after being loaded from the ASDF file, and this creates a problem for at least some of the ObsPy writers.
I think the plan is for @mhearne-usgs to check the data type of the arrays when a StreamCollection is created from the ASDF file and recast the datatype to double precision if necessary.
I think this will fix the problems as it is encountered in our code, but I wonder if this could be an issue for others that are using ObsPy and ASDF. @baagaard-usgs, Do you think we should report this to the ObsPy folks? We would probably need to come up with minimal working example that doesn't use gmprocess code.