diff --git a/sohstationviewer/model/reftek/from_rt2ms/core.py b/sohstationviewer/model/reftek/from_rt2ms/core.py index cb612498f9837c64b30564e92e1708ade27d7fdb..a24d316d715c650b9c7a4371f8e1d9caa9ffe436 100644 --- a/sohstationviewer/model/reftek/from_rt2ms/core.py +++ b/sohstationviewer/model/reftek/from_rt2ms/core.py @@ -24,6 +24,12 @@ from sohstationviewer.model.reftek.from_rt2ms import packet from sohstationviewer.model.reftek.from_rt2ms.soh_packet import Packet +class DiscontinuousTrace(Trace): + def __init__(self, *args, times, **kwargs): + super().__init__(**kwargs) + self.times = times + + eh_et_payload_last_field_start = 88 eh_et_payload_last_field_size = 16 @@ -199,8 +205,10 @@ class Reftek130(obspy_rt130_core.Reftek130): sample_data = (packets_['payload'][:, :4]) sample_data = sample_data.view(np.dtype('>i4')).squeeze() npts = len(sample_data) - - tr = Trace(data=sample_data, header=copy.deepcopy(header)) + tr = DiscontinuousTrace( + data=sample_data, header=copy.deepcopy(header), + times=packets_['time'] + ) tr.stats.npts = packets_['number_of_samples'].sum() tr.stats.actual_npts = npts # channel number is not included in the EH/ET packet