Skip to content

Python API

Use these functions when you need fine-grained control beyond the CLI.

Quick example

from cross_sensor_cal import merge_duckdb
merge_duckdb(["parquet/a.parquet","parquet/b.parquet"], "merged/all.parquet")

Brightness correction entry point

apply_brightness_correction(cube, mask=None, method='percentile_match', ...)

Normalizes per-band brightness for hyperspectral cubes before BRDF/topo stages. The docstring walks through the affine model, parameter choices, and examples. Use it when you need to harmonise tiles prior to the full pipeline; the QA JSON will surface the per-band gain/offsets when this stage runs.

Cross-Sensor Calibration public package surface.

_PLOT_EXPORTS = (make_micasense_vs_landsat_panels.__name__, make_sensor_vs_neon_panels.__name__) module-attribute

__all__ = sorted(set(__all__ + (['apply_brightness_correction', load_brightness_coefficients.__name__] + list(_PLOT_EXPORTS)))) module-attribute

__version__ = '2.2.0' module-attribute

__getattr__(name)

load_brightness_coefficients(system_pair='landsat_to_micasense')

Load brightness coefficients for a given system pair.

Parameters

system_pair : str Key identifying the pair of systems, e.g. "landsat_to_micasense".

Returns

dict[int, float] Mapping from 1-based band index to brightness coefficient (percent).

Notes

  • Values are stored in percent (e.g., -7.3959 means "reduce by 7.3959%").

make_micasense_vs_landsat_panels(merged_dir, out_dir=None, *, max_points=50000, sentinel_at_or_below=-9999.0)

make_sensor_vs_neon_panels(merged_dir, out_dir=None, *, max_points=50000, sentinel_at_or_below=-9999.0)