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

Fix time precision issue

Fix time precision issue by getting nanosecond directly from stored
UTCDateTime instead of UTC timestamp
parent a2a2119c
No related branches found
No related tags found
1 merge request!139Change the way RT130 data is read for better performance
......@@ -160,8 +160,7 @@ def convert_packet_to_obspy_format(packet: Union[EHETPacket, DTPacket], unpacker
# Obspy only stores the last two digits of the year.
converted_packet['year'] = packet.header.time.year % 100
converted_packet['unit_id'] = packet.header.unit_id
# We need to convert the stored time from second to nanosecond
converted_packet['time'] = packet.header.time.timestamp * 10**9
converted_packet['time'] = packet.header.time.ns
converted_packet['byte_count'] = packet.header.byte_count
converted_packet['packet_sequence'] = packet.header.packet_sequence
converted_packet['event_number'] = packet.extended_header.event_number
......
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