Changeset 338e792 in ammosreader


Ignore:
Timestamp:
05/18/23 13:30:15 (2 years ago)
Author:
Enrico Schwass <ennoausberlin@…>
Branches:
AmmosSource, guix
Children:
19f5ce5
Parents:
25c80a7
Message:

more logging added

Location:
ammosreader
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ammosreader/AmmosGlobalFrameHeader.py

    r25c80a7 r338e792  
    1818        magic_word = elements[0].hex()
    1919
     20        logger.debug("Header created")
    2021        if magic_word != cls.MAGIC_WORD:
    2122            return None
     
    3738        """I return a new instance of myself initialized with above parameters."""
    3839        if magic_word != type(self).MAGIC_WORD:
    39             logging.error("Wrong magic word found")
     40            logger.error("Wrong magic word found")
    4041            self.magic_word = magic_word
    4142        else:
  • ammosreader/PDW.py

    r25c80a7 r338e792  
    2525        """
    2626        if (len(byte_string) != 32):
    27             raise TypeError("Too many bytes")
     27            raise TypeError("Byte count invalid")
    2828
    2929        parts = struct.unpack('<Q4s4s4s4s4s4s', byte_string)
     30
    3031        nanoseconds = (parts[0])
    31         print("Nanoseconds", nanoseconds)
    3232        unix_time = np.datetime64('now', 'ns').astype(int)
    33         print("Unix time", unix_time)
    3433        if nanoseconds >= unix_time:
    3534            raise OverflowError("Timestamp invalid")
Note: See TracChangeset for help on using the changeset viewer.