Comments (11)
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.
from pyasdf.
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.
from pyasdf.
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.
from pyasdf.
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.
from pyasdf.
I agree.
So two things?
- Check the data type for the array during conversion.
- fix the
UnicodeDecodeError
in error handling.
from pyasdf.
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...
from pyasdf.
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.
from pyasdf.
I am going to test it now.
from pyasdf.
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!
from pyasdf.
Nice catch.
from pyasdf.
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.
from pyasdf.
Related Issues (20)
- parallel I/O and python 3 HOT 2
- Why are tag paths validated against r"^[a-zA-Z0-9][a-zA-Z0-9_]*[a-zA-Z0-9]$"? HOT 7
- Slow performance when adding gappy data to ASDF HOT 3
- adding an existing StationXML throws TypeError HOT 1
- setup broken between 0.5.1 and 0.6.1 HOT 4
- How to make pyasdf to support multi-date-range station inventory + custom tags? HOT 6
- Calling parallel process() for a very large file gets stuck HOT 7
- Why the differences between input station XML file to ASDF and the output station XML file HOT 5
- Problem with hdf5 1.10 and _add_trace_write_collective_information during process() HOT 2
- SUGGESTION: adding public APIs for parallel writing functions HOT 1
- pkg_resources deprecated? HOT 1
- newer versions h5py > 2.1 will break pyasdf events HOT 2
- Error @opening after copying pyasdf-archive HOT 2
- Renaming a tag HOT 1
- Increasingly slow to add events to ASDF dataset HOT 3
- use dense attribute storage for large attributes
- Citation?
- Rounding start times to nearest sample rather than previous sample
- Issue in tutorial
- Whether each event can be associated with part of the waveform in ASDFDataset.h5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyasdf.