from __future__ import annotations import numpy as np from galileo_rx.navigation.inav_deinterleaver import deinterleave_inav # Independent numerical example from OS SIS ICD 2.2 Annex D.2. ENCODED = ( "1000110000011010101010100111001100110001010110100110111101011001" "0111100010010101010101011000110011001110101001011001000010100110" "1000010000000010000000100001101110011001111010110101110000011000" "101110111111110111111101111001000101001100100010" ) INTERLEAVED = ( "1010000001011111100011001111000001011110101000000001100111100011" "1010100001010000010011110101011101111000100001101111101011100111" "1001100000011111111000100000100111110110000010011100011101100000" "100101110100100011000110110110010000011100111010" ) def test_icd_annex_d2_deinterleaving_vector() -> None: output = deinterleave_inav(np.fromiter(map(int, INTERLEAVED), dtype=np.int8)) assert "".join(map(str, output)) == ENCODED