Skip to content

API

Configuration

Spectral Analysis Configuration.

Attributes

Classes

SCTSpectralAnalysisConfig dataclass

Bases: AnalysisConfigABC

SCT Spectral Analysis configuration

Attributes

cropping_size class-attribute instance-attribute
Python
cropping_size: tuple[int, int] = (128, 128)
azimuth_block_size class-attribute instance-attribute
Python
azimuth_block_size: int = 2000
config_group_name class-attribute instance-attribute
Python
config_group_name = 'spectral_analysis'
validation_schema class-attribute instance-attribute
Python
validation_schema = Path(config_schema)

Methods:

__init__
Python
__init__(cropping_size: tuple[int, int] = (128, 128), azimuth_block_size: int = 2000) -> None
from_dict classmethod
Python
from_dict(arg: dict) -> SCTSpectralAnalysisConfig

Convert from dict

to_dict
Python
to_dict()

Convert to dict

from_toml classmethod
Python
from_toml(file: str | Path) -> Self

Generating a Self dataclass from a .toml configuration file.

Parameters:

Name Type Description Default
file str | Path

path to the .toml configuration file

required

Returns:

Type Description
Self

Self dataclass set from .toml file

to_toml
Python
to_toml(out_file: Path) -> None

Saving to disk a .toml file from the dataclass instance.

Parameters:

Name Type Description Default
out_file Path

path to the output .toml file

required

Main Analysis Interface

Spectral Analysis implementation.

Attributes

Classes

Functions:

full_spectral_analysis

Python
full_spectral_analysis(product: Path, point_target_source: Path | None, output_directory: Path, config: SCTSpectralAnalysisConfig | None, graphs: bool) -> Path

Full implementation of Spectral Analysis, both distributed and point target.

Parameters:

Name Type Description Default
product Path

Path to the product to be analyzed

required
point_target_source Path | None

Path to the point target source file, if not provided the analysis will be a Distributed Spectral Analysis

required
output_directory Path

Path to the output directory

required
config SCTSpectralAnalysisConfig | None

analysis configuration parameters, if needed

required
graphs bool

flag to enable graphs generation

required

Returns:

Type Description
Path

Path to the NetCDF file containing the results

Command Line Interface Command

Command Line Interface for Spectral Analysis.

Attributes

Classes

Functions:

spectral_analysis

Python
spectral_analysis(ctx: Context, product: InputProductOption, output_directory: OutputDirectoryOption, point_target_source: InputPointTargetSource = None, graphs: GraphsOption = False) -> None

Point and Distributed Target Spectral Analysis.

 It can be performed: - at each visible target location providing a point target source file -pt/--point-target-source - on distributed targets by partitioning the data into azimuth blocks/bursts

spectral_analysis_implementation

Python
spectral_analysis_implementation(product: Path, point_target_source: Path | None, output_directory: Path, config: SCTSpectralAnalysisConfig, graphs: bool, dump_config: bool) -> None

Implement the spectral analysis command.

Core implementation

Point Target and Distributed Spectral Analysis

Attributes

Classes

Functions:

sct_point_target_spectral_analysis

Python
sct_point_target_spectral_analysis(product_path: str | Path, external_target_source: str | Path, config: SCTSpectralAnalysisConfig | None = None) -> list[PointTargetSpectraDataOutput]

Spectral Analysis performed at each target position for the input product.

Parameters:

Name Type Description Default
product_path str | Path

path to the product to be analyzed

required
external_target_source str | Path

path to external point target source

required
config SCTSpectralAnalysisConfig | None

configuration parameters, by default None

None

Returns:

Type Description
list[PointTargetSpectraDataOutput]

list of PointTargetSpectraDataOutput analysis output, one for each product channel and each Point Target

sct_distributed_spectral_analysis

Python
sct_distributed_spectral_analysis(product_path: str | Path, config: SCTSpectralAnalysisConfig | None = None) -> list[DistributedSpectraDataOutput]

Spectral Analysis performed by partitioning the product in blocks and performing spectral analysis on each of them.

Parameters:

Name Type Description Default
product_path str | Path

path to the product to be analyzed

required
config SCTSpectralAnalysisConfig | None

configuration parameters, by default None

None

Returns:

Type Description
list[DistributedSpectraDataOutput]

list of DistributedSpectraDataOutput analysis output, one for each product channel and block