Skip to main content

snap_client.SNAPClient

Low-level client for SNAP GPT processing.

Usage

Source

snap_client.SNAPClient(
    file_manager,
    config=None,
)

Provides direct interface to SNAP GPT for processing Sentinel-1 bursts. For batch processing with progress tracking, use BurstProcessor instead.

Parameters

file_manager: FileManager

File manager resolving input SLC and output product paths.

config: SNAPConfig | None = None
Runtime configuration for SNAP GPT; defaults to SNAPConfig().

Methods

Name Description
create_backscatter() Compute backscatter from a burst, terrain-flattened (RTC) or geocoded (GTC).
create_coherence() Compute the coherence from a burst pair.

create_backscatter()

Compute backscatter from a burst, terrain-flattened (RTC) or geocoded (GTC).

Usage

Source

create_backscatter(self, burst: Burst, crs: CRSInput | Literal['auto'], config: RTCConfig, overwrite: bool = False) -> OperationResult[RTCProduct]
create_backscatter(self, burst: Burst, crs: CRSInput | Literal['auto'], config: GTCConfig, overwrite: bool = False) -> OperationResult[GTCProduct]

The type of config selects the product: an RTCConfig gives an RTCProduct, terrain-flattened gamma-0 backscatter; a GTCConfig a GTCProduct, beta-0 backscatter that is geocoded only.

Parameters
burst: Burst

Burst to process.

crs: CRSInput | Literal["auto"]

The coordinate reference system of the geocoded output, a WGS 84 / UTM zone, north or south, which product file names record. Given as a CRS object, an authority string such as "EPSG:32632" or an EPSG code, or "auto" to process each burst in the UTM zone that holds its footprint (utm_zone). Use "auto" for bursts processed on their own, such as a time series, and the target cell’s crs for products meant for a composite: an input in another zone than the cell raises InconsistentInputsError when composited.

config: RTCConfig | GTCConfig

Graph-shape configuration, RTCConfig or GTCConfig.

overwrite: bool = False
Whether to overwrite an existing product. Without it, an existing product is returned as skipped, after checking that the settings it records match config.
Returns
OperationResult
Result of the backscatter processing.
Raises
TypeError

If config is neither an RTCConfig nor a GTCConfig.

ValueError

If crs is not a WGS 84 / UTM zone. Raised, not recorded, because a wrong crs would fail every burst. Under "auto", a footprint outside the UTM zones fails this item alone and is recorded as a NoUTMZoneError.

(OSError, SnapProcessingError or RasterWriteError)

If the disk is full, over quota or read-only, which would fail every remaining item alike: an OSError saying so, or an error caused by one or whose message or GPT output says so.

ProductSettingsMismatchError

If the product exists, overwrite is False, and the product records other settings than config or another SNAP version, or does not record one of them. An undetermined SNAP version is not compared.

OSError or RasterioError
If the product exists, overwrite is False, and it cannot be read to check its settings.

create_coherence()

Compute the coherence from a burst pair.

Usage

Source

create_coherence(pair, crs, *, config, overwrite=False)

Runs the single-shot SLC→Coherence→Terrain-Correction graph.

Parameters
pair: BurstPair

Burst pair to process.

crs: CRSInput | Literal["auto"]

The coordinate reference system of the geocoded output, a WGS 84 / UTM zone, north or south, which product file names record. Given as a CRS object, an authority string such as "EPSG:32632" or an EPSG code, or "auto" to process each pair in the UTM zone that holds its footprint (utm_zone). Use "auto" for pairs processed on their own, such as a time series, and the target cell’s crs for products meant for a composite: an input in another zone than the cell raises InconsistentInputsError when composited.

config: CoherenceConfig

Graph-shape configuration (window size, DEM, …).

overwrite: bool = False
Whether to overwrite an existing product. Without it, an existing product is returned as skipped, after checking that the settings it records match config.
Returns
OperationResult
Result of the coherence processing.
Raises
ValueError

If crs is not a WGS 84 / UTM zone. Raised, not recorded, because a wrong crs would fail every burst. Under "auto", a footprint outside the UTM zones fails this item alone and is recorded as a NoUTMZoneError.

(OSError, SnapProcessingError or RasterWriteError)

If the disk is full, over quota or read-only, which would fail every remaining item alike: an OSError saying so, or an error caused by one or whose message or GPT output says so.

ProductSettingsMismatchError

If the product exists, overwrite is False, and the product records other settings than config or another SNAP version, or does not record one of them. An undetermined SNAP version is not compared.

OSError or RasterioError
If the product exists, overwrite is False, and it cannot be read to check its settings.