Skip to content
Snippets Groups Projects
Commit dd9ae08b authored by Kien Le's avatar Kien Le
Browse files

Fix SOH plot for RT130 data

parent 49014bf2
No related branches found
No related tags found
No related merge requests found
......@@ -18,15 +18,22 @@ import numpy as np
from obspy import Trace, Stream, UTCDateTime
from obspy.core.util.obspy_types import ObsPyException
from obspy.io.reftek.util import _decode_ascii
from obspy.io.reftek.util import _decode_ascii, _parse_long_time
from sohstationviewer.model.reftek.from_rt2ms import packet
from sohstationviewer.model.reftek.from_rt2ms.soh_packet import Packet
eh_et_payload_last_field_start = 88
eh_et_payload_last_field_size = 16
eh_et_payload_end = eh_et_payload_last_field_start + eh_et_payload_last_field_size
EH_PAYLOAD = {
"station_name_extension": (35, 1, _decode_ascii),
"station_name": (36, 4, _decode_ascii),
"sampling_rate": (64, 4, float),
"trigger_time": (72, 16, _parse_long_time),
"first_sample_time": (eh_et_payload_last_field_start, eh_et_payload_last_field_size, _parse_long_time),
}
......@@ -151,8 +158,6 @@ class Reftek130(obspy_rt130_core.Reftek130):
# channel number is not included in the EH/ET packet
# payload, so add it to stats as well..
tr.stats.reftek130['channel_number'] = channel_number
if headonly:
tr.stats.npts = npts
tr.stats.starttime = UTCDateTime(ns=starttime)
"""
if component codes were explicitly provided, use them
......
......@@ -2,10 +2,10 @@ import dataclasses
from sohstationviewer.model.mseed.read_mseed_experiment.mseed_helper import \
Unpacker
from sohstationviewer.model.reftek.from_rt2ms.core import eh_et_payload_end
from sohstationviewer.model.reftek.rt130_experiment.reftek_helper import \
PacketHeader
eh_et_payload_end = 92
def read_eh_et_packet(packet: bytes, unpacker: Unpacker):
event_number = int(packet[16:18].hex())
......
......@@ -6,10 +6,6 @@ import numpy
import numpy as np
from obspy import UTCDateTime
from obspy.io.reftek.packet import PACKET_FINAL_DTYPE
from obspy.io.reftek.util import (
bcd, bcd_hex,
bcd_julian_day_string_to_nanoseconds_of_year, bcd_16bit_int, bcd_8bit_hex,
)
from sohstationviewer.model.mseed.read_mseed_experiment.mseed_helper import \
Unpacker
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment