Skip to content

NEON h5 conversion - #1

Open
kllewers wants to merge 2 commits into
isofit:mainfrom
kllewers:neon-h5-conversion
Open

NEON h5 conversion#1
kllewers wants to merge 2 commits into
isofit:mainfrom
kllewers:neon-h5-conversion

Conversation

@kllewers

@kllewers kllewers commented Jun 2, 2026

Copy link
Copy Markdown

Adds isoio/neon_h5.py, a self-contained utility that converts NEON AOP L1 radiance HDF5 files to the three ENVI binary + .hdr files expected by apply_oe:

.rad — at-sensor radiance, BIL float32
.loc — per-pixel location (easting/northing/elevation), BIL float32
.obs — observation geometry (angles, path length, time), BIP float32
NEON stores radiance in a split-integer encoding (RadianceIntegerPart + RadianceDecimalPart / Scale_Factor); this module handles reconstruction, no-data masking, and the three known time-band formats (decimal hours / seconds since midnight / HHMMSS).

Public API

Individual converters (convert_rad, convert_loc, convert_obs) are also importable for partial workflows.

Output band descriptions
.rad — at-sensor radiance (BIL)
N bands matching the NEON AOP sensor wavelengths (e.g. 426 bands for the standard NEON imaging spectrometer). Center wavelengths and FWHM values are read from the H5 file and written into the ENVI header (wavelength and fwhm fields), so the file is self-describing. Units: W m⁻² sr⁻¹ nm⁻¹.

.loc — per-pixel location (BIL)
{
"1": "easting_utm",
"2": "northing_utm",
"3": "elevation_m"
}

.obs — observation geometry (BIP)
{
"1": "path_length",
"2": "sensor_azimuth",
"3": "sensor_zenith",
"4": "solar_azimuth",
"5": "solar_zenith",
"6": "toa_azimuth",
"7": "toa_zenith",
"8": "view_azimuth",
"9": "cos_incidence",
"10": "time_decimal_hours"
}

Band names are written into each ENVI header so they are visible in tools like ENVI, QGIS, and spectral (Python).

Tests
isoio/test/test_neon_h5.py — 20 pytest tests using a synthetic H5 fixture built in tmp_path (no real NEON file used for CI). Covers file sizes, pixel values, header content, BIL/BIP interleave, time-format detection, and the end-to-end triplet writer.

Additional Notes
This was originally while running ISOFIT/apply_oe via the command line on multiple NEON AOP radiance flightlines and subsets. This is not an H5 driver, it is a converter of h5 > ENVI binary. I'm sure there are additional improvements to be made and am happy to continue contributing/iterating/refining/restructuring.

I put this all together for the purposes of isofit/utils, but I originally had them more broken up in my codebase I use for my experiments. Please let me know if you would prefer a more modular format.

kllewers and others added 2 commits June 2, 2026 16:18
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@kllewers kllewers changed the title Neon h5 conversion NEON h5 conversion Jun 2, 2026
@kllewers kllewers changed the title NEON h5 conversion NENON h5 conversion Jun 3, 2026
@kllewers kllewers changed the title NENON h5 conversion NEON h5 conversion Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant