There are instances where L0tx transmission messages require cp850 decoding. Usually, the first character is dropped from the transmission as this is the payload format indicator. However, in the instance of cp850 decoding, the first character is part of the transmission message. Therefore, this causes the first character to be dropped - this is always the "2" in the year part of the timestamp (i.e. returning "023" instead of "2023").
The current de-bug just adds the first "2" character onto the string, but really we should restructure this so that the first character is retained. This may be simple and only require L559 to be moved to after the if statement, it just hasn't been tested.
from pypromice.tx import L0tx, loadMsg
# Load transmission message
f = "SBD Msg From Unit: 300034012256830_1500013.msg"
msg = loadMsg(f)
# Extract L0tx data from message
tx = L0tx(msg)
# Print the original payload and the outputted L0tx data
print(tx.payload)
print(tx.msg)
The pypromice.tx.L0tx.getDataLine() is where the decoding occurs.
There are instances where L0tx transmission messages require cp850 decoding. Usually, the first character is dropped from the transmission as this is the payload format indicator. However, in the instance of cp850 decoding, the first character is part of the transmission message. Therefore, this causes the first character to be dropped - this is always the "2" in the year part of the timestamp (i.e. returning "023" instead of "2023").
https://github.com/GEUS-Glaciology-and-Climate/pypromice/blob/c5613a942d7e79089865f4f5837313bf6abe3461/src/pypromice/tx/tx.py#L559
https://github.com/GEUS-Glaciology-and-Climate/pypromice/blob/c5613a942d7e79089865f4f5837313bf6abe3461/src/pypromice/tx/tx.py#L633
The current de-bug just adds the first "2" character onto the string, but really we should restructure this so that the first character is retained. This may be simple and only require L559 to be moved to after the if statement, it just hasn't been tested.
Recreating the current de-bug
Download and unzip this example transmission messages from KAN_B: SBD Msg From Unit: 300034012256830_1500013.zip
The
pypromice.tx.L0tx.getDataLine()
is where the decoding occurs.