Skip to content
Snippets Groups Projects
Commit ff6f5290 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 602ebd2e
No related branches found
No related tags found
No related merge requests found
...@@ -160,8 +160,7 @@ def convert_packet_to_obspy_format(packet: Union[EHETPacket, DTPacket], unpacker ...@@ -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. # Obspy only stores the last two digits of the year.
converted_packet['year'] = packet.header.time.year % 100 converted_packet['year'] = packet.header.time.year % 100
converted_packet['unit_id'] = packet.header.unit_id 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.ns
converted_packet['time'] = packet.header.time.timestamp * 10**9
converted_packet['byte_count'] = packet.header.byte_count converted_packet['byte_count'] = packet.header.byte_count
converted_packet['packet_sequence'] = packet.header.packet_sequence converted_packet['packet_sequence'] = packet.header.packet_sequence
converted_packet['event_number'] = packet.extended_header.event_number 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