Skip to content

io.reftek: handle malformed EH packet sampling rate field gracefully#1

Open
athulpalliath wants to merge 2 commits into
masterfrom
fix-reftek130-malformed-eh-header
Open

io.reftek: handle malformed EH packet sampling rate field gracefully#1
athulpalliath wants to merge 2 commits into
masterfrom
fix-reftek130-malformed-eh-header

Conversation

@athulpalliath

Copy link
Copy Markdown
Owner

Old REFTEK DAS firmware sometimes wrote blank or scrambled
fields in the EH packet binary header, causing ObsPy to raise a
ValueError even though the DT packets containing actual waveform data
are intact.

This PR adds a fallback_sampling_rate parameter to _read_reftek130()
and to_stream() so users can specify the sampling rate when the EH
packet field cannot be parsed.

A separate fix for EHPacket.init (packet.py) to handle other
malformed fields will follow in a subsequent PR.

… add fallback_sampling_rate parameter for malformed EH headers

Added fallback_sampling_rate parameter to handle cases where the sampling rate cannot be parsed from the EH packet. Updated relevant methods to utilize this new parameter.
Old REFTEK DAS firmware  sometimes wrote blank or scrambled
fields in the EH packet binary header. This adds a try/except around
the converter call in EHPacket.__init__ so that malformed fields are
set to None with a warning instead of raising ValueError and preventing
the entire file from being read.

This is part of the same fix as the core.py change - the two together
allow reading of REFTEK files recorded with old firmware.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant