Skip to content

plugins

Product Format Plugins protocols

SCT plugins protocols (input products and analyses).

Attributes

Detector module-attribute

Python
Detector = Callable[[str | Path], bool]

CorrectionsConfigT module-attribute

Python
CorrectionsConfigT = TypeVar('CorrectionsConfigT')

Classes

AbsoluteLocalizationErrorCorrector

Bases: Protocol[CorrectionsConfigT]

SCT protocol to define the behavior of specific sensors Absolute Localization Error computation

Methods:

__init__
Python
__init__(external_product_path: Path | None)
get_ale_corrections_function
Python
get_ale_corrections_function() -> ALECorrectionFunctionType

Getter of the ALE correction function to effectively compute corrections

update_corrections_config
Python
update_corrections_config(corrections_config: CorrectionsConfigT) -> CorrectionsConfigT

Update the input corrections config to disable specific corrections when an external product is provided.

Parameters:

Name Type Description Default
corrections_config CorrectionsConfigT

corrections config to be updated

required

Returns:

Type Description
CorrectionsConfigT

updated corrections config

InputProductPluginProtocol

Bases: Protocol

Input product plugin protocol.

Input product plugins are discovered via the sct.input_products entry-point namespace. Each plugin encapsulates the knowledge required to read and validate a specific SAR product format, together with an optional detector function (to recognize that format from a path) and an optional absolute-localization-error corrector.

The entry-point object must be importable without importing the heavy product-access implementation; all heavy imports should be deferred to the manager, detector and corrector classes returned by the accessor methods.

Attributes

version instance-attribute
Python
version: str

Methods:

get_manager classmethod
Python
get_manager() -> type[SCTInputProduct]

Return the input product manager class for this format.

The manager class implements SCTInputProduct and provides read access to the SAR product data (metadata, raster, auxiliary files).

Returns:

Type Description
type[SCTInputProduct]

manager class for the product format

get_detector classmethod
Python
get_detector() -> Detector

Return a callable that detects whether a path belongs to this format.

The detector is a Detector (Callable[[str | Path], bool]) that inspects the given path and returns True if the data matches the product format.

Returns:

Type Description
Detector

detection callable

get_ale_corrector classmethod
Python
get_ale_corrector() -> AbsoluteLocalizationErrorCorrector | None

Return the ALE corrector class, or None if not supported.

The corrector is used to adjust the absolute localization error (range/azimuth biases) that may affect the product.

Returns:

Type Description
AbsoluteLocalizationErrorCorrector | None

corrector class, or None if ALE correction is not available

AnalysisPluginProtocol

Bases: Protocol

Analysis plugin protocol.

Analysis plugins are discovered via the sct.analyses entry-point namespace. The protocol is intentionally input-agnostic: each plugin defines, validates and provides its own inputs, configuration, CLI and testing hooks. The entry-point object must be importable without importing the heavy analysis implementation (main/core) or the scientific stack.

Attributes

version instance-attribute
Python
version: str
short_help instance-attribute
Python
short_help: str

Methods:

get_handlers classmethod
Python
get_handlers() -> dict[str, AnalysisHandler]

Retrieve the analysis handlers exposed by this plugin.

A single plugin may expose more than one analysis type (e.g. radiometry exposes several types sharing one CLI group).

Returns:

Type Description
dict[str, AnalysisHandler]

mapping of analysis type name to its handler

get_cli classmethod
Python
get_cli() -> Typer | Callable

Retrieve the plugin CLI (a Typer group or a single command callable).

Input Products plugins loader.

Attributes

import_input_product_plugins module-attribute

Python
import_input_product_plugins = partial(import_plugins, plugin_protocol=InputProductPluginProtocol, namespace='sct.input_products')

import_analysis_plugins module-attribute

Python
import_analysis_plugins = partial(import_plugins, plugin_protocol=AnalysisPluginProtocol, namespace='sct.analyses')

Classes

Functions:

import_plugins

Python
import_plugins(*, plugin_protocol: Type, namespace: str) -> list

Load plugins using Stevedore entry points.

Parameters:

Name Type Description Default
plugin_protocol Type

Protocol that plugins must satisfy

required
namespace str

Entry-point namespace

required

Returns:

Type Description
list

list of available plugins