Skip to content

Parquet Export

Module: spectralbridge.parquet_export.

Parquet export utilities for ENVI reflectance products.

The helpers in this module are intentionally lightweight at import time so that unit tests can import :mod:spectralbridge.parquet_export without requiring heavy geospatial dependencies. Expensive libraries (rasterio, pandas, pyarrow) are imported lazily inside :func:build_parquet_from_envi.

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.

read_envi_in_chunks

read_envi_in_chunks(envi_img: Path, envi_hdr: Path, parquet_name: str, *, chunk_size: int = 50000)

Yield DataFrame chunks from an ENVI cube along with shared metadata.

Audience: advanced.

parquet_exists_and_valid

parquet_exists_and_valid(parquet_path: Path) -> bool

Return True when parquet_path exists and has a readable schema.

Audience: advanced.

build_parquet_from_envi

build_parquet_from_envi(envi_img: Path, envi_hdr: Path, parquet_path: Path, chunk_size: int = 50000, *, num_cpus: int | None = None) -> None

Read an ENVI cube and emit a wide per-pixel Parquet table.

Audience: advanced.

ensure_parquet_from_envi

ensure_parquet_from_envi(envi_img: Path, envi_hdr: Path, parquet_path: Path, *, chunk_size: int = 50000, num_cpus: int | None = None) -> Path

Reuse a readable Parquet schema or rebuild the table from the existing ENVI image/header in bounded chunks.

Audience: advanced.

repair_lonlat_in_place

repair_lonlat_in_place(folder: Path)

Add missing coordinate columns to eligible Parquets in place using matching ENVI geometry.

Audience: advanced.

ensure_parquet_for_envi

ensure_parquet_for_envi(envi_img: Path, logger, *, chunk_size: int = 2048, ray_cpus: int | None = None) -> Path | None

Ensure a .parquet sidecar exists for envi_img.

This treats the _undarkened_envi.img/.hdr convolution-only products the same as their brightness-adjusted counterparts so QA comparisons stay aligned.