Qa Stages¶
Module: spectralbridge.qa.stages.
Stage QA emission from canonical on-disk pipeline artifacts.
API glossary ยท Workflow / scientific context
Signatures and documentation below are collected from the current source. Advanced objects are not newly declared stable by inclusion here.
Audience: public. Also exported as spectralbridge.qa.emit_stage_qa.
emit_stage_qa ¶
emit_stage_qa(*, flightline_dir: Path, stage_id: str, inputs: Iterable[Path] = (), outputs: Iterable[Path] = (), parameters: dict[str, Any] | None = None, mode: str = 'standard', primary_img: Path | None = None, reference_img: Path | None = None, chunk_shape: tuple[int, int] | None = None, thresholds: QAThresholds | None = None, force: bool = False) -> tuple[Path, dict[str, Any]]
Emit or reuse one deterministic stage QA JSON/HTML report from on-disk artifacts.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
flightline_dir
|
Path
|
Existing canonical completed flightline directory containing stage artifacts and QA sidecars. |
required |
stage_id
|
str
|
Canonical processing-stage identifier used for deterministic QA paths and stage-specific diagnostics. |
required |
inputs
|
Iterable[Path]
|
Paths to the stage input/output artifacts; their availability and provenance are recorded in the QA payload. |
()
|
outputs
|
Iterable[Path]
|
Paths to the stage input/output artifacts; their availability and provenance are recorded in the QA payload. |
()
|
parameters
|
dict[str, Any] | None
|
Optional serializable stage configuration recorded for reproducibility; does not modify the stage products. |
None
|
mode
|
str
|
Diagnostic coverage level, normally 'standard' or 'deep'; existing artifacts are inspected without rerunning correction. |
'standard'
|
primary_img
|
Path | None
|
Optional primary ENVI image to inspect for this stage. |
None
|
reference_img
|
Path | None
|
Optional aligned ENVI reference image for paired diagnostics. |
None
|
chunk_shape
|
tuple[int, int] | None
|
Optional (rows, columns) block shape in pixels for seam/chunk diagnostics. |
None
|
thresholds
|
QAThresholds | None
|
QAThresholds instance providing provisional review bounds; None uses the configured defaults, not universal scientific acceptance criteria. |
None
|
force
|
bool
|
Regenerate the requested outputs instead of reusing an otherwise valid checkpoint or report. |
False
|
Returns:
| Type | Description |
|---|---|
tuple[Path, dict[str, Any]]
|
Stage HTML path and JSON-serializable QA payload, written or reused with deterministic stage paths. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the supplied options, dimensions, support or provenance violate the input contract. |
Notes
Missing scientific inputs are recorded as NOT EVALUATED rather than
being silently omitted. mode='deep' increases sampling and seam-band
coverage but does not rerun the scientific correction itself. Callers
should invoke this after the stage product exists on disk, not while the
correction working set is still resident.
See Also
spectralbridge.qa.metrics.reflectance_summary : Related source-derived API contract.