Module: sarpyx.processor.core.decode

File: sarpyx/processor/core/decode.py

No module docstring available; module purpose is inferred from implementation.

Exported Symbols (__all__)

No explicit __all__ list. Public symbols inferred from implementation.

Public Functions (6)

extract_echo_bursts function

Extract echo bursts from radar records and return burst data with indexes.

File location: sarpyx/processor/core/decode.py:55

Signature

extract_echo_bursts(records: List[Any]) -> Tuple[List[List[Any]], List[int]]

Parameters

ParameterTypeRequiredDefaultDescription
recordsList[Any]yes-List of records from ISP decoder containing radar data. Each record should have radar_configuration_support.ses.signal_type and radar_sample_count.number_of_quads attributes.

Return Type

Tuple[List[List[Any]], List[int]]

Tuple[List[List[Any]], List[int]]: A tuple containing: - List of echo burst sublists grouped by number of quads - List of indexes indicating burst start/end positions in original records

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.decode import extract_echo_bursts

result = extract_echo_bursts(records=<records>)

Edge Cases

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

save_pickle_file function

Save data to a pickle file with robust error handling.

File location: sarpyx/processor/core/decode.py:130

Signature

save_pickle_file(file_path: Union[str, Path], data: Any) -> None

Parameters

ParameterTypeRequiredDefaultDescription
file_pathUnion[str, Path]yes-Path where to save the pickle file.
dataAnyyes-Data object to be pickled and saved.

Return Type

None

inferred from implementation.

Exceptions

  • ValueError

Side Effects

  • filesystem

Example Usage

from sarpyx.processor.core.decode import save_pickle_file

result = save_pickle_file(file_path=<file_path>, data=<data>)

Edge Cases

May raise: ValueError.

extract_headers function

Extract metadata headers from radar file using specified decoding mode.

File location: sarpyx/processor/core/decode.py:158

Signature

extract_headers(file_path: Union[str, Path], mode: str='s1isp', apply_transformations: bool=False) -> pd.DataFrame

Parameters

ParameterTypeRequiredDefaultDescription
file_pathUnion[str, Path]yes-Path to the radar data file.
modestrno's1isp'Extraction mode. Currently only 's1isp' is fully supported.
apply_transformationsboolnoFalseWhether to apply parameter transformations to convert raw values to physical units.

Return Type

pd.DataFrame

pd.DataFrame: DataFrame containing the extracted metadata headers with optional transformations.

Exceptions

  • FileNotFoundError
  • NotImplementedError
  • RuntimeError
  • ValueError

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.decode import extract_headers

result = extract_headers(file_path=<file_path>)

Edge Cases

May raise: FileNotFoundError, NotImplementedError, RuntimeError, ValueError. Includes optional parameters with implementation-defined fallback behavior.

decode_radar_file_old function

Decode Sentinel-1 Level 0 radar file and extract burst data with ephemeris.

File location: sarpyx/processor/core/decode.py:214

Signature

decode_radar_file_old(input_file: Union[str, Path], apply_transformations: bool=False) -> Tuple[List[Dict[str, Any]], List[int]]

Parameters

ParameterTypeRequiredDefaultDescription
input_fileUnion[str, Path]yes-Path to the input Level 0 radar file.
apply_transformationsboolnoFalseWhether to apply parameter transformations to convert raw values to physical units.

Return Type

Tuple[List[Dict[str, Any]], List[int]]

Tuple[List[Dict[str, Any]], List[int]]: A tuple containing: - List of dictionaries with 'echo', 'metadata', and 'ephemeris' keys - List of indexes indicating burst positions in the original data

Exceptions

  • FileNotFoundError
  • RuntimeError

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.decode import decode_radar_file_old

result = decode_radar_file_old(input_file=<input_file>)

Edge Cases

May raise: FileNotFoundError, RuntimeError. Includes optional parameters with implementation-defined fallback behavior.

decode_radar_file function

Decode Sentinel-1 Level 0 radar file and extract burst data with ephemeris.

File location: sarpyx/processor/core/decode.py:301

Signature

decode_radar_file(input_file: Union[str, Path], apply_transformations: bool=True) -> Tuple[List[Dict[str, Any]], List[int]]

Parameters

ParameterTypeRequiredDefaultDescription
input_fileUnion[str, Path]yes-Path to the input Level 0 radar file.
apply_transformationsboolnoTrueWhether to apply parameter transformations to convert raw values to physical units.

Return Type

Tuple[List[Dict[str, Any]], List[int]]

Dict

Exceptions

  • FileNotFoundError
  • RuntimeError

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.decode import decode_radar_file

result = decode_radar_file(input_file=<input_file>)

Edge Cases

May raise: FileNotFoundError, RuntimeError. Includes optional parameters with implementation-defined fallback behavior.

main function

Main entry point for the radar file decoder.

File location: sarpyx/processor/core/decode.py:887

Signature

main() -> int

Parameters

ParameterTypeRequiredDefaultDescription
--no-No explicit public parameters; behavior inferred from implementation.

Return Type

int

int: Exit code - 0 for success, 1 for failure.

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.decode import main

result = main()

Edge Cases

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

Public Classes (1)

S1L0Decoder class

Minimal API for decoding Sentinel-1 Level 0 data files.

File location: sarpyx/processor/core/decode.py:405

Class Signature

class S1L0Decoder

Constructor Parameters

Return Type

S1L0Decoder instances.

Exceptions

Construction/runtime exceptions are inferred from implementation and method-level documentation.

Side Effects

See method-level side effects below.

Example Usage

from sarpyx.processor.core.decode import S1L0Decoder

obj = S1L0Decoder(...)  # inferred from implementation

Edge Cases

No class-level edge-case section is explicitly documented; rely on method-level checks and raised exceptions.

Public Methods (1)

S1L0Decoder.decode_file method

Decode a Sentinel-1 Level 0 .dat file.

File location: sarpyx/processor/core/decode.py:417

Signature

decode_file(self, input_file: Path | str, output_dir: Optional[Path | str]=None, headers_only: bool=False, save_to_zarr: bool=False, apply_transformations: bool=True) -> Dict[str, Any]

Parameters

ParameterTypeRequiredDefaultDescription
input_filePath | stryes-Path to the input .dat file
output_dirOptional[Path | str]noNoneDirectory to save processed data (optional)
headers_onlyboolnoFalseIf True, extract only headers for quick preview
save_to_zarrboolnoFalseIf True, save output in Zarr format with compression
apply_transformationsboolnoTrueIf True, apply parameter transformations to convert raw values to physical units

Return Type

Dict[str, Any]

Dictionary containing decoded data with keys: - 'burst_data': List of burst dictionaries (if headers_only=False) - 'headers': DataFrame with header information (if headers_only=True) - 'file_info': Basic file information

Exceptions

  • FileNotFoundError
  • ValueError

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.processor.core.decode import S1L0Decoder

# Constructor arguments are inferred from implementation.
obj = S1L0Decoder(...)  # inferred from implementation
result = obj.decode_file(input_file=<input_file>)

Edge Cases

May raise: FileNotFoundError, ValueError. Includes optional parameters with implementation-defined fallback behavior.