NFDRS_TX_Format demonstrates SHEF reformatted to NRDRS transmission format using string comprehension

NFDRS_TX_Format.py

” This script takes in SHEF TX format and outputs NRDRS TX format. Measurements must be labeled in accordance with tx_sensor_order list. If Tx format is not already in SHEF, script will change setting to SHEF and recalculate tx string

SHEF format:

:RNIN 1 #0 12.34 :WSM 1 #0 -123 :WDD 1 #0 567 :ATF 1 #0 123 :FTF 1 #0 234 :RHP 1 #0 123 :BVV 1 #0 12.6 :FMP 1 #0 23.7 :WDDP 1 #0 123 :WSMP 1 #0 234 :SRW 1 #0 12345

NRDRS output:

12.34
-123
567
123
234
123
12.6
23.7
123
234
12345
NFDRS_TX_Format.NRDRS_format(shef)

Takes in SHEF TX format and outputs NRDRS TX format.

Parameters:shef – String containing SHEF formatted TX output.
Returns:String containing NRDRS formatted TX output.
Return type:str
NFDRS_TX_Format.sl3_round(x)

rounding is needed for SL3 since ‘float’ makes some values slightly smaller. example: 25 turns into 24.9999999 which becomes 24