Skip to content

Bulk Streaming

Module: spectralbridge.bulk.streaming.

Bounded, restart-safe statistics over immutable ENVI flightline products.

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: advanced.

BivariateStatistics dataclass

BivariateStatistics(n: int = 0, mean_x: float = 0.0, mean_y: float = 0.0, m2_x: float = 0.0, m2_y: float = 0.0, c_xy: float = 0.0, x_min: float = math.inf, x_max: float = -math.inf, y_min: float = math.inf, y_max: float = -math.inf)

Numerically stable, mergeable bivariate population moments.

sum_x property

sum_x: float

sum_y property

sum_y: float

sum_x2 property

sum_x2: float

sum_y2 property

sum_y2: float

sum_xy property

sum_xy: float

update

update(x: ndarray, y: ndarray) -> None

merge

merge(other: BivariateStatistics) -> BivariateStatistics

subtract

subtract(other: BivariateStatistics) -> BivariateStatistics

Return the stable inverse merge self - other for LOSO fitting.

copy

copy() -> BivariateStatistics

from_row classmethod

from_row(row: dict[str, Any]) -> BivariateStatistics

Audience: advanced.

PairBand dataclass

PairBand(translation_pair: str, source_sensor: str, target_sensor: str, band_index: int, source_band_index: int, target_band_index: int)

Record a one-based source/target band relationship for streamed sufficient statistics.

x_column property

x_column: str

y_column property

y_column: str

Audience: advanced.

pair_bands

pair_bands(pairs: Sequence[TranslationPair]) -> tuple[PairBand, ...]

Expand registered translation pairs into ordered band-level statistics specifications.

Audience: advanced.

iter_aligned_pair_chunks

iter_aligned_pair_chunks(flightline: FlightlineRecord, translation_pairs: Sequence[TranslationPair], *, chunk_size: int, minimum_reflectance: float) -> Iterator[tuple[int, dict[PairBand, tuple[np.ndarray, np.ndarray, np.ndarray]]]]

Read all requested sensors together and yield aligned, valid pair arrays.

Audience: advanced.

write_statistics

write_statistics(path: Path, rows: list[dict[str, Any]]) -> None

Atomically write compact sufficient-statistics rows using the fixed statistics schema.

Audience: advanced.

write_diagnostic_sample

write_diagnostic_sample(path: Path, rows: list[dict[str, Any]]) -> None

Atomically write the explicitly requested diagnostic pixel sample using its fixed schema.

Audience: advanced.

compute_flightline_statistics

compute_flightline_statistics(flightline: FlightlineRecord, paths: BulkAnalysisPaths, *, chunk_size: int, minimum_reflectance: float, translation_pairs: Sequence[TranslationPair], diagnostic_sample_size: int = 0, diagnostic_seed: int = 0, force: bool = False) -> tuple[list[dict[str, Any]], list[dict[str, Any]], FlightlineRecord]

Create or reuse one compact per-flightline analytical checkpoint.

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
STATISTICS_SCHEMA_VERSION 1