Module: sarpyx.cli.focus
File: sarpyx/cli/focus.py
Focus CLI Tool for SARPyX. This module provides a command-line interface for focusing SAR data using the CoarseRDA (Range-Doppler Algorithm) processor.
Exported Symbols (__all__)
No explicit __all__ list. Public symbols inferred from implementation.
Public Functions (6)
create_parser function
Create the argument parser for focus command.
File location: sarpyx/cli/focus.py:71
Signature
create_parser() -> argparse.ArgumentParser
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
- | - | no | - | No explicit public parameters; behavior inferred from implementation. |
Return Type
argparse.ArgumentParser
Configured ArgumentParser instance.
Exceptions
None explicitly documented; inferred from implementation.
Side Effects
- inferred from implementation
Example Usage
from sarpyx.cli.focus import create_parser
result = create_parser()
Edge Cases
No explicit edge-case section found; behavior is inferred from implementation.
setup_directories function
Setup output and temporary directories.
File location: sarpyx/cli/focus.py:168
Signature
setup_directories(output_dir: Path) -> tuple[Path, Path]
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
output_dir | Path | yes | - | Base output directory path |
Return Type
tuple[Path, Path]
Tuple of (output_dir, tmp_dir) paths
Exceptions
None explicitly documented; inferred from implementation.
Side Effects
- inferred from implementation
Example Usage
from sarpyx.cli.focus import setup_directories
result = setup_directories(output_dir=<output_dir>)
Edge Cases
No explicit edge-case section found; behavior is inferred from implementation.
focalize_slice function
Process a single slice of raw SAR data.
File location: sarpyx/cli/focus.py:185
Signature
focalize_slice(raw_data: Dict[str, Any], verbose: bool=False) -> Dict[str, Any]
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
raw_data | Dict[str, Any] | yes | - | Raw data dictionary containing 'echo', 'metadata', and 'ephemeris' |
verbose | bool | no | False | Enable verbose output |
Return Type
Dict[str, Any]
Processed data dictionary containing 'raw', 'rc', 'rcmc', 'az', 'metadata', and 'ephemeris'
Exceptions
None explicitly documented; inferred from implementation.
Side Effects
- inferred from implementation
Example Usage
from sarpyx.cli.focus import focalize_slice
result = focalize_slice(raw_data=<raw_data>)
Edge Cases
Includes optional parameters with implementation-defined fallback behavior.
process_sar_slice function
Process a single SAR data slice.
File location: sarpyx/cli/focus.py:230
Signature
process_sar_slice(handler: ZarrManager, slice_idx: int, slice_info: Dict[str, Any], tmp_dir: Path, verbose: bool=True, unique_slice: bool=True, output_chunks: Optional[Union[str, Tuple[int, ...]]]='auto', compression_level: int=5) -> Path
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
handler | ZarrManager | yes | - | Zarr data handler |
slice_idx | int | yes | - | Index of the slice to process |
slice_info | Dict[str, Any] | yes | - | Slice information dictionary |
tmp_dir | Path | yes | - | Temporary directory for saving results |
verbose | bool | no | True | Enable verbose output |
unique_slice | bool | no | True | Whether this is the only slice to process |
output_chunks | Optional[Union[str, Tuple[int, ...]]] | no | 'auto' | Chunking strategy passed to Zarr saver |
compression_level | int | no | 5 | Compression level passed to Zarr saver |
Return Type
Path
Path to saved slice file
Exceptions
None explicitly documented; inferred from implementation.
Side Effects
- inferred from implementation
Example Usage
from sarpyx.cli.focus import process_sar_slice
result = process_sar_slice(handler=<handler>, slice_idx=<slice_idx>, slice_info=<slice_info>, tmp_dir=<tmp_dir>)
Edge Cases
Includes optional parameters with implementation-defined fallback behavior.
cleanup_tmp_directory function
Clean up temporary directory and all its contents recursively.
File location: sarpyx/cli/focus.py:309
Signature
cleanup_tmp_directory(tmp_dir: Path) -> None
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
tmp_dir | Path | yes | - | Temporary directory to clean up |
Return Type
None
inferred from implementation.
Exceptions
None explicitly documented; inferred from implementation.
Side Effects
- inferred from implementation
Example Usage
from sarpyx.cli.focus import cleanup_tmp_directory
result = cleanup_tmp_directory(tmp_dir=<tmp_dir>)
Edge Cases
No explicit edge-case section found; behavior is inferred from implementation.
main function
Main entry point for focus CLI.
File location: sarpyx/cli/focus.py:321
Signature
main() -> None
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
- | - | no | - | No explicit public parameters; behavior inferred from implementation. |
Return Type
None
inferred from implementation.
Exceptions
ValueError
Side Effects
- io
Example Usage
from sarpyx.cli.focus import main
result = main()
Edge Cases
May raise: ValueError.
Public Classes (0)
No public classes detected.