Closed wjlei1990 closed 8 years ago
Haha :-) Oh well...yea i did not test that. I'll have a look.
What actually happens when you store the above mentioned data in an ASDF file? Is it stored as single bytes? As mentioned in the obspy issue: you should really fix the file - whatever ends up in the ASDF file is likely garbage.
In asdf file, it stores as byte:
In [4]: ds.waveforms.XA_SA71.raw_observed[0].data
Out[4]:
array(['\x0c', '\r', '\x05', ..., '\x07', '\n', '\n'],
dtype='|S1')
My current plan for this is: just throw those file away during processing...So if pyasdf now can catch the error and run through, I feel OK.
You can probably fix them with this tool: https://seiscode.iris.washington.edu/projects/msmod
Just change the encoding to whatever it really is - likely STEIM1 or STEIM2.
I'll make pyasdf raise an exception if one tries to add non-numeric arrays - that does not really make sense for waveforms in ASDF - the auxiliary data should be used for that.
I agree.
So two things?
UnicodeDecodeError
in error handling.I strip the code out to form a simple test, but couldn't really reproduce the error.
I have attached my code and data here. test_read.py.txt XA.SA72.mseed.txt
Not sure if I am doing the right thing...
The encoding issue should be fixed - can you check? You will likely no longer be able to test once the check for the data type is implemented.
I am going to test it now.
You may forget to delete this line. https://github.com/SeismicData/pyasdf/blob/master/pyasdf/asdf_data_set.py#L1772
Otherwise, it is fixed :)
Thanks!
Nice catch.
Alright - should be all fixed. You are no longer allowed to use a datatype that is not valid ASDF. Is will raise a TypeError
if you attempt to do it.
Hi Lion,
I found there is a issue related to the traceback print.
First, our asdf data contains a file like I mentioned here: https://github.com/obspy/obspy/issues/1371
Pyasdf first gives out a error like this:
It is because the data array is string, but not float. Then this error should be catched here: https://github.com/SeismicData/pyasdf/blob/master/pyasdf/asdf_data_set.py#L1751
However, when executing this line, there is an error coming out:
The error log is: