Skip to content

Qa Thresholds

Module: spectralbridge.qa.thresholds.

Configurable QA thresholds.

Defaults are intentionally conservative and provisional until they are tuned against a pinned set of real NEON, MicaSense, and Landsat comparison data.

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

QAThresholds dataclass

QAThresholds(valid_fraction_warn: float = 0.9, valid_fraction_fail: float = 0.7, negative_fraction_warn: float = 0.01, negative_fraction_fail: float = 0.05, overbright_fraction_warn: float = 0.01, overbright_fraction_fail: float = 0.05, correction_abs_q99_warn: float = 0.2, correction_abs_q99_fail: float = 0.5, seam_score_warn: float = 1.5, seam_score_fail: float = 2.5, chunk_difference_tolerance: float = 1e-06, srf_coverage_warn: float = 0.98, srf_coverage_fail: float = 0.9, provisional: bool = True)

Provisional standard-mode thresholds expressed as fractions.

Attributes:

Name Type Description
valid_fraction_warn float, default=0.9

Fractional support/range review threshold in [0, 1]; warn/fail interpretation follows the corresponding metric, not a universal scientific validity rule.

valid_fraction_fail float, default=0.7

Fractional support/range review threshold in [0, 1]; warn/fail interpretation follows the corresponding metric, not a universal scientific validity rule.

negative_fraction_warn float, default=0.01

Fractional support/range review threshold in [0, 1]; warn/fail interpretation follows the corresponding metric, not a universal scientific validity rule.

negative_fraction_fail float, default=0.05

Fractional support/range review threshold in [0, 1]; warn/fail interpretation follows the corresponding metric, not a universal scientific validity rule.

overbright_fraction_warn float, default=0.01

Fractional support/range review threshold in [0, 1]; warn/fail interpretation follows the corresponding metric, not a universal scientific validity rule.

overbright_fraction_fail float, default=0.05

Fractional support/range review threshold in [0, 1]; warn/fail interpretation follows the corresponding metric, not a universal scientific validity rule.

correction_abs_q99_warn float, default=0.2

Review threshold for the 99th percentile of absolute reflectance correction, in the diagnostic reflectance units.

correction_abs_q99_fail float, default=0.5

Review threshold for the 99th percentile of absolute reflectance correction, in the diagnostic reflectance units.

seam_score_warn float, default=1.5

Dimensionless seam/interior gradient-ratio review threshold; landscape structure can also exceed it.

seam_score_fail float, default=2.5

Dimensionless seam/interior gradient-ratio review threshold; landscape structure can also exceed it.

chunk_difference_tolerance float, default=1e-06

Absolute same-unit tolerance for chunk-invariance comparisons.

srf_coverage_warn float, default=0.98

Fractional support/range review threshold in [0, 1]; warn/fail interpretation follows the corresponding metric, not a universal scientific validity rule.

srf_coverage_fail float, default=0.9

Fractional support/range review threshold in [0, 1]; warn/fail interpretation follows the corresponding metric, not a universal scientific validity rule.

provisional bool, default=True

Whether these configured review bounds are explicitly provisional rather than empirically calibrated acceptance criteria.

to_dict

to_dict() -> dict[str, float | bool]

Serialize this record to its established machine-readable mapping.

Returns:

Type Description
dict[str, float | bool]

Mapping of record fields and workflow-derived summary entries in the established serialization schema.

Audience: advanced.

classify_high_bad

classify_high_bad(check_id: str, value: float | None, *, warn: float, fail: float, units: str | None = None, interpretation: str, provisional: bool = True, reason: str | None = None) -> QACheck

Classify a metric against inclusive upper warn/fail bounds; None yields NOT EVALUATED.

Audience: advanced.

classify_low_bad

classify_low_bad(check_id: str, value: float | None, *, warn: float, fail: float, units: str | None = None, interpretation: str, provisional: bool = True, reason: str | None = None) -> QACheck

Classify a metric against inclusive lower warn/fail bounds; None yields NOT EVALUATED.

Explicitly exported constants and type aliases

These values describe package metadata, schemas or configuration; they are not observations from a production dataset.

Name Source expression
KNOWN_BAD_WAVELENGTH_RANGES_NM ({'minimum_nm': 300.0, 'maximum_nm': 400.0, 'reason': 'spectral edge / low-signal region'}, {'minimum_nm': 1337.0, 'maximum_nm': 1430.0, 'reason': 'strong atmospheric water-absorption region'}, {'minimum_nm': 1800.0, 'maximum_nm': 1960.0, 'reason': 'strong atmospheric water-absorption region'}, {'minimum_nm': 2450.0, 'maximum_nm': 2600.0, 'reason': 'spectral edge / low-signal region'})