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

Save times in trace

parent 53523576
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
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