Skip to content

Qa Brightness

Module: spectralbridge.qa.brightness.

Numerical diagnostics for the persisted brightness-correction step.

These helpers audit before/after products. They do not apply, refit, or otherwise change the correction coefficients used by the pipeline.

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.brightness_correction_metrics.

brightness_correction_metrics

brightness_correction_metrics(before: ndarray, after: ndarray, *, expected_percent: Mapping[int, float] | None = None) -> dict[str, Any]

Summarize a bandwise multiplicative brightness correction.

Parameters:

Name Type Description Default
before ndarray

Matching band-first arrays in unit reflectance. Invalid cells must be represented by NaN before calling this function.

required
after ndarray

Matching band-first arrays in unit reflectance. Invalid cells must be represented by NaN before calling this function.

required
expected_percent Mapping[int, float]

One-based band indices mapped to the configured percent adjustment.

None

Returns:

Type Description
dict

Per-band fitted gains, intercepts, fit quality, quantiles, and the difference between fitted and configured gain.