Module: sarpyx.processor.core.code2physical

File: sarpyx/processor/core/code2physical.py

Sentinel-1 Parameter Transformations: From Bytecodes to Physical Values This module provides comprehensive transformation functions to convert raw bytecode values from Sentinel-1 data packets into meaningful physical parameters. All transformations follow the exact specifications from the Sentinel-1 documentation and match the implementation in the original decoder.

Exported Symbols (__all__)

No explicit __all__ list. Public symbols inferred from implementation.

Public Functions (50)

extract_packet_version_number function

Extract packet version number from primary header.

File location: sarpyx/processor/core/code2physical.py:23

Signature

extract_packet_version_number(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Primary header bytes (6 bytes)

Return Type

int

Packet version number (3 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_packet_version_number

result = extract_packet_version_number(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_packet_type function

Extract packet type from primary header.

File location: sarpyx/processor/core/code2physical.py:38

Signature

extract_packet_type(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Primary header bytes (6 bytes)

Return Type

int

Packet type (1 bit)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_packet_type

result = extract_packet_type(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_secondary_header_flag function

Extract secondary header flag from primary header.

File location: sarpyx/processor/core/code2physical.py:53

Signature

extract_secondary_header_flag(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Primary header bytes (6 bytes)

Return Type

int

Secondary header flag (1 bit)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_secondary_header_flag

result = extract_secondary_header_flag(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_process_id function

Extract process ID (PID) from primary header.

File location: sarpyx/processor/core/code2physical.py:68

Signature

extract_process_id(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Primary header bytes (6 bytes)

Return Type

int

Process ID (7 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_process_id

result = extract_process_id(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_packet_category function

Extract packet category (PCAT) from primary header.

File location: sarpyx/processor/core/code2physical.py:83

Signature

extract_packet_category(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Primary header bytes (6 bytes)

Return Type

int

Packet category (4 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_packet_category

result = extract_packet_category(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_sequence_flags function

Extract sequence flags from primary header.

File location: sarpyx/processor/core/code2physical.py:98

Signature

extract_sequence_flags(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Primary header bytes (6 bytes)

Return Type

int

Sequence flags (2 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_sequence_flags

result = extract_sequence_flags(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_packet_sequence_count function

Extract packet sequence count from primary header.

File location: sarpyx/processor/core/code2physical.py:113

Signature

extract_packet_sequence_count(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Primary header bytes (6 bytes)

Return Type

int

Packet sequence count (14 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_packet_sequence_count

result = extract_packet_sequence_count(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_packet_data_length function

Extract packet data length from primary header.

File location: sarpyx/processor/core/code2physical.py:128

Signature

extract_packet_data_length(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Primary header bytes (6 bytes)

Return Type

int

Packet data length in bytes (length is stored as N-1)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_packet_data_length

result = extract_packet_data_length(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_coarse_time function

Extract coarse time from secondary header.

File location: sarpyx/processor/core/code2physical.py:149

Signature

extract_coarse_time(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Coarse time (32 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_coarse_time

result = extract_coarse_time(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_fine_time function

Extract fine time from secondary header and convert to fractional seconds.

File location: sarpyx/processor/core/code2physical.py:163

Signature

extract_fine_time(header_bytes: bytes) -> float

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

float

Fine time in fractional seconds

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_fine_time

result = extract_fine_time(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_sync_marker function

Extract sync marker from secondary header.

File location: sarpyx/processor/core/code2physical.py:180

Signature

extract_sync_marker(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Sync marker (32 bits, expected: 0x352EF853)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_sync_marker

result = extract_sync_marker(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_data_take_id function

Extract data take ID from secondary header.

File location: sarpyx/processor/core/code2physical.py:194

Signature

extract_data_take_id(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Data take ID (32 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_data_take_id

result = extract_data_take_id(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_ecc_number function

Extract ECC number from secondary header.

File location: sarpyx/processor/core/code2physical.py:208

Signature

extract_ecc_number(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

ECC number (8 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_ecc_number

result = extract_ecc_number(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_test_mode function

Extract test mode from secondary header.

File location: sarpyx/processor/core/code2physical.py:222

Signature

extract_test_mode(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Test mode (3 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_test_mode

result = extract_test_mode(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_rx_channel_id function

Extract Rx channel ID from secondary header.

File location: sarpyx/processor/core/code2physical.py:236

Signature

extract_rx_channel_id(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Rx channel ID (4 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_rx_channel_id

result = extract_rx_channel_id(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_instrument_config_id function

Extract instrument configuration ID from secondary header.

File location: sarpyx/processor/core/code2physical.py:250

Signature

extract_instrument_config_id(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Instrument configuration ID (32 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_instrument_config_id

result = extract_instrument_config_id(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_subcom_data_word_index function

Extract sub-commutated data word index from secondary header.

File location: sarpyx/processor/core/code2physical.py:266

Signature

extract_subcom_data_word_index(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Sub-commutated data word index (8 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_subcom_data_word_index

result = extract_subcom_data_word_index(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_subcom_data_word function

Extract sub-commutated data word from secondary header.

File location: sarpyx/processor/core/code2physical.py:280

Signature

extract_subcom_data_word(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Sub-commutated data word (16 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_subcom_data_word

result = extract_subcom_data_word(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_space_packet_count function

Extract space packet count from secondary header.

File location: sarpyx/processor/core/code2physical.py:296

Signature

extract_space_packet_count(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Space packet count (32 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_space_packet_count

result = extract_space_packet_count(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_pri_count function

Extract PRI count from secondary header.

File location: sarpyx/processor/core/code2physical.py:310

Signature

extract_pri_count(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

PRI count (32 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_pri_count

result = extract_pri_count(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_error_flag function

Extract error flag from secondary header.

File location: sarpyx/processor/core/code2physical.py:326

Signature

extract_error_flag(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Error flag (1 bit)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_error_flag

result = extract_error_flag(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_baq_mode function

Extract BAQ mode from secondary header.

File location: sarpyx/processor/core/code2physical.py:340

Signature

extract_baq_mode(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

BAQ mode (5 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_baq_mode

result = extract_baq_mode(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_baq_block_length function

Extract BAQ block length from secondary header.

File location: sarpyx/processor/core/code2physical.py:354

Signature

extract_baq_block_length(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

BAQ block length (8 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_baq_block_length

result = extract_baq_block_length(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_range_decimation function

Extract range decimation from secondary header.

File location: sarpyx/processor/core/code2physical.py:368

Signature

extract_range_decimation(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Range decimation code (8 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_range_decimation

result = extract_range_decimation(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

range_dec_to_sample_rate function

Convert range decimation code to sample rate in Hz.

File location: sarpyx/processor/core/code2physical.py:382

Signature

range_dec_to_sample_rate(rgdec_code: int) -> float

Parameters

ParameterTypeRequiredDefaultDescription
rgdec_codeintyes-Range decimation code (0-11)

Return Type

float

Sample rate in Hz

Exceptions

  • ValueError

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import range_dec_to_sample_rate

result = range_dec_to_sample_rate(rgdec_code=<rgdec_code>)

Edge Cases

May raise: ValueError.

extract_rx_gain function

Extract and convert Rx gain from secondary header to dB.

File location: sarpyx/processor/core/code2physical.py:415

Signature

extract_rx_gain(header_bytes: bytes) -> float

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

float

Rx gain in dB

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_rx_gain

result = extract_rx_gain(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_tx_pulse_ramp_rate function

Extract and convert Tx pulse ramp rate (TXPRR) from secondary header.

File location: sarpyx/processor/core/code2physical.py:430

Signature

extract_tx_pulse_ramp_rate(header_bytes: bytes) -> float

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

float

Tx pulse ramp rate in Hz/s

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_tx_pulse_ramp_rate

result = extract_tx_pulse_ramp_rate(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_tx_pulse_start_frequency function

Extract and convert Tx pulse start frequency (TXPSF) from secondary header.

File location: sarpyx/processor/core/code2physical.py:455

Signature

extract_tx_pulse_start_frequency(header_bytes: bytes) -> float

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

float

Tx pulse start frequency in Hz

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_tx_pulse_start_frequency

result = extract_tx_pulse_start_frequency(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_tx_pulse_length function

Extract and convert Tx pulse length from secondary header.

File location: sarpyx/processor/core/code2physical.py:488

Signature

extract_tx_pulse_length(header_bytes: bytes) -> float

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

float

Tx pulse length in seconds

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_tx_pulse_length

result = extract_tx_pulse_length(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_rank function

Extract rank from secondary header.

File location: sarpyx/processor/core/code2physical.py:503

Signature

extract_rank(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Rank (5 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_rank

result = extract_rank(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_pri function

Extract and convert PRI (Pulse Repetition Interval) from secondary header.

File location: sarpyx/processor/core/code2physical.py:517

Signature

extract_pri(header_bytes: bytes) -> float

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

float

PRI in seconds

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_pri

result = extract_pri(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_sampling_window_start_time function

Extract and convert SWST (Sampling Window Start Time) from secondary header.

File location: sarpyx/processor/core/code2physical.py:532

Signature

extract_sampling_window_start_time(header_bytes: bytes) -> float

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

float

SWST in seconds

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_sampling_window_start_time

result = extract_sampling_window_start_time(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_sampling_window_length function

Extract and convert SWL (Sampling Window Length) from secondary header.

File location: sarpyx/processor/core/code2physical.py:547

Signature

extract_sampling_window_length(header_bytes: bytes) -> float

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

float

SWL in seconds

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_sampling_window_length

result = extract_sampling_window_length(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_sas_ssb_flag function

Extract SAS SSB flag from secondary header.

File location: sarpyx/processor/core/code2physical.py:562

Signature

extract_sas_ssb_flag(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

SAS SSB flag (1 bit)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_sas_ssb_flag

result = extract_sas_ssb_flag(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_polarisation function

Extract polarisation from secondary header.

File location: sarpyx/processor/core/code2physical.py:576

Signature

extract_polarisation(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Polarisation (3 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_polarisation

result = extract_polarisation(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_temperature_compensation function

Extract temperature compensation from secondary header.

File location: sarpyx/processor/core/code2physical.py:590

Signature

extract_temperature_compensation(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Temperature compensation (2 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_temperature_compensation

result = extract_temperature_compensation(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_calibration_mode function

Extract calibration mode from secondary header.

File location: sarpyx/processor/core/code2physical.py:604

Signature

extract_calibration_mode(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Calibration mode (2 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_calibration_mode

result = extract_calibration_mode(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_tx_pulse_number function

Extract Tx pulse number from secondary header.

File location: sarpyx/processor/core/code2physical.py:618

Signature

extract_tx_pulse_number(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Tx pulse number (5 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_tx_pulse_number

result = extract_tx_pulse_number(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_signal_type function

Extract signal type from secondary header.

File location: sarpyx/processor/core/code2physical.py:632

Signature

extract_signal_type(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Signal type (4 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_signal_type

result = extract_signal_type(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_swap_flag function

Extract swap flag from secondary header.

File location: sarpyx/processor/core/code2physical.py:646

Signature

extract_swap_flag(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Swap flag (1 bit)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_swap_flag

result = extract_swap_flag(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_swath_number function

Extract swath number from secondary header.

File location: sarpyx/processor/core/code2physical.py:660

Signature

extract_swath_number(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Swath number (8 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_swath_number

result = extract_swath_number(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_number_of_quads function

Extract number of quads from secondary header.

File location: sarpyx/processor/core/code2physical.py:674

Signature

extract_number_of_quads(header_bytes: bytes) -> int

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

int

Number of quads (16 bits)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_number_of_quads

result = extract_number_of_quads(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

ten_bit_unsigned_to_signed_int function

Convert 10-bit unsigned to signed integer using two's complement.

File location: sarpyx/processor/core/code2physical.py:692

Signature

ten_bit_unsigned_to_signed_int(ten_bit: int) -> int

Parameters

ParameterTypeRequiredDefaultDescription
ten_bitintyes-10-bit unsigned integer value (0-1023)

Return Type

int

Signed integer value (-511 to +511)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import ten_bit_unsigned_to_signed_int

result = ten_bit_unsigned_to_signed_int(ten_bit=<ten_bit>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

extract_bypass_samples function

Extract and convert 10-bit bypass mode samples from user data.

File location: sarpyx/processor/core/code2physical.py:713

Signature

extract_bypass_samples(user_data: bytes, num_samples: int) -> list[int]

Parameters

ParameterTypeRequiredDefaultDescription
user_databytesyes-Raw user data bytes
num_samplesintyes-Number of samples to extract

Return Type

list[int]

List of signed sample values

Exceptions

  • ValueError

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import extract_bypass_samples

result = extract_bypass_samples(user_data=<user_data>, num_samples=<num_samples>)

Edge Cases

May raise: ValueError.

decode_all_primary_header_parameters function

Decode all parameters from primary header in one call.

File location: sarpyx/processor/core/code2physical.py:769

Signature

decode_all_primary_header_parameters(header_bytes: bytes) -> Dict[str, Union[int, float]]

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Primary header bytes (6 bytes)

Return Type

Dict[str, Union[int, float]]

Dictionary with all primary header parameters

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import decode_all_primary_header_parameters

result = decode_all_primary_header_parameters(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

decode_all_secondary_header_parameters function

Decode all parameters from secondary header in one call.

File location: sarpyx/processor/core/code2physical.py:793

Signature

decode_all_secondary_header_parameters(header_bytes: bytes) -> Dict[str, Union[int, float]]

Parameters

ParameterTypeRequiredDefaultDescription
header_bytesbytesyes-Secondary header bytes (62 bytes)

Return Type

Dict[str, Union[int, float]]

Dictionary with all secondary header parameters

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import decode_all_secondary_header_parameters

result = decode_all_secondary_header_parameters(header_bytes=<header_bytes>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

decode_complete_packet_header function

Decode all parameters from both primary and secondary headers.

File location: sarpyx/processor/core/code2physical.py:851

Signature

decode_complete_packet_header(primary_header: bytes, secondary_header: bytes) -> Dict[str, Union[int, float]]

Parameters

ParameterTypeRequiredDefaultDescription
primary_headerbytesyes-Primary header bytes (6 bytes)
secondary_headerbytesyes-Secondary header bytes (62 bytes)

Return Type

Dict[str, Union[int, float]]

Dictionary with all header parameters

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import decode_complete_packet_header

result = decode_complete_packet_header(primary_header=<primary_header>, secondary_header=<secondary_header>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

validate_sync_marker function

Validate that the sync marker has the expected value.

File location: sarpyx/processor/core/code2physical.py:876

Signature

validate_sync_marker(sync_marker: int) -> bool

Parameters

ParameterTypeRequiredDefaultDescription
sync_markerintyes-Extracted sync marker value

Return Type

bool

True if sync marker is valid (0x352EF853)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import validate_sync_marker

result = validate_sync_marker(sync_marker=<sync_marker>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

validate_packet_version function

Validate packet version number.

File location: sarpyx/processor/core/code2physical.py:889

Signature

validate_packet_version(version: int) -> bool

Parameters

ParameterTypeRequiredDefaultDescription
versionintyes-Packet version number

Return Type

bool

True if version is valid (typically 0)

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import validate_packet_version

result = validate_packet_version(version=<version>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

validate_baq_mode function

Validate BAQ mode value.

File location: sarpyx/processor/core/code2physical.py:902

Signature

validate_baq_mode(baq_mode: int) -> bool

Parameters

ParameterTypeRequiredDefaultDescription
baq_modeintyes-BAQ mode value

Return Type

bool

True if BAQ mode is valid

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.code2physical import validate_baq_mode

result = validate_baq_mode(baq_mode=<baq_mode>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

Public Classes (0)

No public classes detected.