Changeset 338e792 in ammosreader
- Timestamp:
- 05/18/23 13:30:15 (2 years ago)
- Branches:
- AmmosSource, guix
- Children:
- 19f5ce5
- Parents:
- 25c80a7
- Location:
- ammosreader
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ammosreader/AmmosGlobalFrameHeader.py
r25c80a7 r338e792 18 18 magic_word = elements[0].hex() 19 19 20 logger.debug("Header created") 20 21 if magic_word != cls.MAGIC_WORD: 21 22 return None … … 37 38 """I return a new instance of myself initialized with above parameters.""" 38 39 if magic_word != type(self).MAGIC_WORD: 39 logg ing.error("Wrong magic word found")40 logger.error("Wrong magic word found") 40 41 self.magic_word = magic_word 41 42 else: -
ammosreader/PDW.py
r25c80a7 r338e792 25 25 """ 26 26 if (len(byte_string) != 32): 27 raise TypeError(" Too many bytes")27 raise TypeError("Byte count invalid") 28 28 29 29 parts = struct.unpack('<Q4s4s4s4s4s4s', byte_string) 30 30 31 nanoseconds = (parts[0]) 31 print("Nanoseconds", nanoseconds)32 32 unix_time = np.datetime64('now', 'ns').astype(int) 33 print("Unix time", unix_time)34 33 if nanoseconds >= unix_time: 35 34 raise OverflowError("Timestamp invalid")
Note:
See TracChangeset
for help on using the changeset viewer.