Skip to content

Neon Cube

Module: spectralbridge.neon_cube.

NEON-specific in-memory hyperspectral cube handling.

This module is adapted and substantially extended from concepts and data-access logic in HyTools open_neon and ENVI helpers. It operates without importing HyTools at runtime; that fact does not remove its implementation lineage.

HyTools: Hyperspectral image processing library Copyright (C) 2021 University of Wisconsin Authors named in the relevant source notices: Adam Chlus, Zhiwei Ye, Philip Townsend. License: GNU General Public License, version 3 Upstream: https://github.com/EnSpec/hytools Audited revision: 31286d64541791a9815d29443a33726fa4d54031

Modified and extended for SpectralBridge. See LICENSE, NOTICE, and HYTOOLS_PROVENANCE.md.

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.

NeonCube

NeonCube(h5_path: str | Path, ancillary_paths: Optional[Dict[str, str | Path]] = None, sample_slice: slice | tuple[int, int] | None = None, line_slice: slice | tuple[int, int] | None = None)

In-memory NEON hyperspectral cube loader.

The implementation intentionally targets NEON AOP reflectance products only; it mirrors the pieces of HyTools that cross-sensor-cal relies upon while avoiding a runtime dependency on HyTools itself. The spectral cube is loaded fully into memory (as float32) upon initialisation along with essential metadata required for BRDF/topographic corrections and ENVI exports.

get_ancillary

get_ancillary(name: str, radians: bool = True) -> np.ndarray

Return an ancillary raster or angle for correction workflows.

This method adapts HyTools' ancillary retrieval logic for the NEON-only use case within cross-sensor-cal (HyTools: Hyperspectral image processing library; Authors: Adam Chlus, Zhiwei Ye, Philip Townsend. GPLv3).

iter_chunks

iter_chunks(chunk_y: int = 100, chunk_x: int = 100) -> Iterator[Tuple[int, int, int, int, np.ndarray]]

Yield sequential spatial chunks of the reflectance cube.

chunk_count

chunk_count(chunk_y: int = 100, chunk_x: int = 100) -> int

Return the number of spatial chunks produced by :meth:iter_chunks.

build_envi_header

build_envi_header() -> dict

Construct an ENVI header compatible with NEON reflectance outputs.

Adapted from HyTools' ENVI export routines for NEON reflectance data (HyTools: Hyperspectral image processing library; Authors: Adam Chlus, Zhiwei Ye, Philip Townsend. GPLv3).

Audience: advanced.

debug_load_neon_cube

debug_load_neon_cube(h5_path: Path) -> 'NeonCube'

Convenience helper for manual debugging of NEON cubes.