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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
records | List[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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
file_path | Union[str, Path] | yes | - | Path where to save the pickle file. |
data | Any | yes | - | 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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
file_path | Union[str, Path] | yes | - | Path to the radar data file. |
mode | str | no | 's1isp' | Extraction mode. Currently only 's1isp' is fully supported. |
apply_transformations | bool | no | False | Whether 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
FileNotFoundErrorNotImplementedErrorRuntimeErrorValueError
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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
input_file | Union[str, Path] | yes | - | Path to the input Level 0 radar file. |
apply_transformations | bool | no | False | Whether 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
FileNotFoundErrorRuntimeError
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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
input_file | Union[str, Path] | yes | - | Path to the input Level 0 radar file. |
apply_transformations | bool | no | True | Whether to apply parameter transformations to convert raw values to physical units. |
Return Type
Tuple[List[Dict[str, Any]], List[int]]
Dict
Exceptions
FileNotFoundErrorRuntimeError
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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
- | - | 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
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
input_file | Path | str | yes | - | Path to the input .dat file |
output_dir | Optional[Path | str] | no | None | Directory to save processed data (optional) |
headers_only | bool | no | False | If True, extract only headers for quick preview |
save_to_zarr | bool | no | False | If True, save output in Zarr format with compression |
apply_transformations | bool | no | True | If 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
FileNotFoundErrorValueError
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.