snap_client.SNAPConfig
Runtime configuration for SNAP GPT processing.
Usage
snap_client.SNAPConfig(
bin=None,
rasterio_profile=None,
max_workers=None,
max_ram_gb=None,
threads_per_job=None,
cache_ratio=None,
auxdata_path=None,
timeout=(lambda: get_settings().snap.timeout)()
)Parameters
bin: Path | None = None-
A SNAP installation’s
bindirectory, used to locate thegptexecutable. Defaults toSNAP_BIN, thengptdiscovered onPATH. rasterio_profile: dict[str, Any] | None = None-
Overrides for the rasterio profile used when rewriting GPT output GeoTIFFs. Merged over
{"dtype": "float32", "nodata": "nan"}. max_workers: int | None = None-
Number of parallel GPT subprocesses; at least 1. Defaults to
SNAP_MAX_WORKERS(or 1). max_ram_gb: float | None = None-
Total RAM budget across all GPT processes in GB; must be positive and large enough to give every worker a 512 MB heap on top of 3 GB of JVM and OS overhead. Defaults to
SNAP_MAX_RAM_GB(or 8). threads_per_job: int | None = None-
Threads per GPT process (
-q); at least 1. Defaults toSNAP_THREADS_PER_JOBorcpu_count // max_workers. cache_ratio: float | None = None-
Fraction of the per-process Java heap used for the GPT tile cache (
-c); greater than 0 and at most 1. Defaults toSNAP_CACHE_RATIO(or 0.7). auxdata_path: Path | None = None-
Shared SNAP auxdata cache (DEM tiles, orbit files). Defaults to
SNAP_AUXDATA_PATH(or~/.snap/auxdata). timeout: float | None = (lambda: get_settings().snap.timeout)()-
Seconds one GPT run may take before it is stopped and recorded as failed; must be positive and finite, or
Nonefor no limit. Defaults toSNAP_TIMEOUT(or 3600), wherenonemeans no limit.
Attributes
resolved_gpt_path-
The
gptexecutable this configuration runs, frombin,SNAP_BINorPATH. resolved_snap_version-
Version of the SNAP installation that
gptbelongs to, such as(14, 0, 0), orNoneif it cannot be determined.
Raises
ValueError-
If a resource argument or
timeoutis out of range, or if the RAM budget cannot cover the workers andmax_ram_gbormax_workerswas passed. ConfigurationError-
If a
SNAP_*environment variable is invalid, if the RAM budget cannot cover the workers and both values come from the environment, or if GPT or the auxdata path cannot be resolved.
Methods
| Name | Description |
|---|---|
| __post_init__() | Validate configuration and resolve resource budgets. |
__post_init__()
Validate configuration and resolve resource budgets.
Usage
__post_init__()