Skip to content

Mesma Readiness

Module: spectralbridge.mesma_readiness.

Experimental staged MESMA audit on verified compact empirical spectral summaries.

Not operational abundance inference. Keep unknown units, material purity and independent ground-truth gaps visible. Source rasters/library are never copied.

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.

ReadinessConfig dataclass

ReadinessConfig(seed: int = 20261014, candidate_per_class: int = 12, mixture_endmembers_per_class: int = 2, pairs_per_composition: int = 1, mc_replicates: int = 12, minimum_train: int = 4, minimum_test: int = 2, maximum_models: int = 20000, plant_folds: int = 3, all_flights: bool = True)

Audience: advanced.

decode_flight_history

decode_flight_history(value)

Decode the established nested JSON exposure contract, never split on pipes.

Audience: advanced.

load_compact_inputs

load_compact_inputs(source, compact, *, include_historical_labels=True)

Validate paired memberships/support; retain stored units without guessing.

Audience: advanced.

flight_target_tables

flight_target_tables(compact, waves)

Actual paired plant/flight means, never polygon/year medians in flight tests.

Audience: advanced.

replace_flight_targets

replace_flight_targets(y, table, indices, flight, observations, scale)

Replace only held-out rows with their actual flight; expose missing sources.

Audience: advanced.

run_readiness

run_readiness(source, compact, output, *, config=None, first_pass=False) -> dict

Run experimental grouped readiness diagnostics on verified compact inputs.

Parameters:

Name Type Description Default
source str or Path

Original polygon Parquet, read in place.

required
compact str or Path

Completed paired NEON/undarkened OLI empirical summaries from the same source; caller verifies upstream manifests. Values stay in stored units; no physical scale inferred.

required
output str or Path

Compact checkpoints, memberships and tables.

required
config ReadinessConfig

Explicit candidate/fold/model budgets.

None
first_pass bool

Restrict to plant_0 for a controlled diagnostic run.

False

Returns:

Name Type Description
dict dict

Conditional synthetic status, source/config/code identity and owned output hashes. This is not an operational MESMA readiness certificate.

Raises:

Type Description
ValueError

Invalid budgets, pairing, coordinates, conflicts or corrupt checkpoints. Missing optional flight inputs fail explicitly.

OSError

Required source/checkpoint files cannot be read/written.

Parent identities are purged globally before training-only candidate selection. Synthetic fractions are algebraic mixing weights, not field abundance. Missing purity, verified units and real fraction truth remain blockers. Completed valid fold checkpoints are reused, not regenerated.