Skip to content

File Types

Module: spectralbridge.file_types.

Direct-module reference; consult the linked workflow for processing context.

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.

SensorType

Enumerate sensor-name strings used by the legacy typed filename conventions.

Audience: advanced.

DataFile dataclass

DataFile(path: Path, domain: str | None = None, site: str | None = None, date: str | None = None, time: str | None = None, product: str | None = None, sensor: str | None = None, masked: bool = False, convolution: bool = False)

Base class for NEON data files.

name property

name: str

directory property

directory: Path

file_path property

file_path: Path

Return the concrete :class:Path for this data file.

match classmethod

match(filename: str) -> Optional[re.Match]

from_filename classmethod

from_filename(path: Path) -> Self

find_in_directory classmethod

find_in_directory(directory: Path) -> List[Self]

Recursively find all matching files in a directory.

Audience: advanced.

MaskedFileMixin

Mixin to handle optional '_masked' suffixes in filenames.

is_masked property

is_masked: bool

Return True if the filename indicates a masked file.

masked_path property

masked_path: Path

Return a new Path with '_masked' inserted before the file extension.

masked_pattern classmethod

masked_pattern() -> re.Pattern

Adjust the class's regex pattern to allow optional '_masked' before file extensions. Assumes the original pattern ends with: .img$ or .hdr$

match classmethod

match(filename: str) -> Optional[re.Match]

Override match to use the masked-aware pattern.

masked_version

masked_version() -> Self

Return a new instance pointing to the masked version of the file.

Audience: advanced.

NEONReflectanceFile dataclass

NEONReflectanceFile(path: Path, domain: str | None = None, site: str | None = None, date: str | None = None, time: str | None = None, product: str | None = None, sensor: str | None = None, masked: bool = False, convolution: bool = False, tile: str | None = None, descriptor: str = 'reflectance', suffix: str | None = None, directional: bool = False)

Represent the legacy typed filename contract for a raw reflectance HDF5 product.

from_filename classmethod

from_filename(path: Path | str) -> 'NEONReflectanceFile'

from_components classmethod

from_components(domain: str, site: str, date: str, folder: Path, time: Optional[str] = None, suffix: Optional[str] = None, tile: Optional[str] = None, directional: bool = False, product: str = '30006.001') -> 'NEONReflectanceFile'

Audience: advanced.

NEONReflectanceENVIFile dataclass

NEONReflectanceENVIFile(path: Path, domain: str | None = None, site: str | None = None, date: str | None = None, time: str | None = None, product: str | None = None, sensor: str | None = None, masked: bool = False, convolution: bool = False)

Base (uncorrected) NEON reflectance ENVI image.

parse_filename classmethod

parse_filename(path: Path)

from_filename classmethod

from_filename(path: Path) -> 'NEONReflectanceENVIFile'

from_components classmethod

from_components(*, domain: str, site: str, product: str = 'DP1.30006.001', tile: str, date: Optional[str] = None, time: Optional[str] = None, directional: bool = True, descriptor: str | None = None, folder: Path) -> 'NEONReflectanceENVIFile'

find_in_directory classmethod

find_in_directory(root: Path) -> List['NEONReflectanceENVIFile']

Audience: advanced.

NEONReflectanceENVIHDRFile dataclass

NEONReflectanceENVIHDRFile(path: Path, domain: str | None = None, site: str | None = None, date: str | None = None, time: str | None = None, product: str | None = None, sensor: str | None = None, masked: bool = False, convolution: bool = False, tile: str | None = None, directional: bool = False)

Represent the legacy typed filename contract for a raw reflectance ENVI header product.

from_filename classmethod

from_filename(path: Path) -> 'NEONReflectanceENVIHDRFile'

from_components classmethod

from_components(domain: str, site: str, product: str, date: str, folder: Path, time: Optional[str] = None, tile: Optional[str] = None, directional: bool = False, descriptor: str | None = None) -> 'NEONReflectanceENVIHDRFile'

Audience: advanced.

NEONReflectanceAncillaryENVIFile dataclass

NEONReflectanceAncillaryENVIFile(path: Path, domain: str | None = None, site: str | None = None, date: str | None = None, time: str | None = None, product: str | None = None, sensor: str | None = None, masked: bool = False, convolution: bool = False)

Ancillary ENVI image stack, e.g. NEON_D10_R10C_DP1.30006.001_L003-1_20210915_directional_reflectance_ancillary_envi.img NEON_D10_R10C_DP1.30006.001_L003-1_20210915_reflectance_ancillary_envi.img

from_filename classmethod

from_filename(path: Path) -> 'NEONReflectanceAncillaryENVIFile'

from_components classmethod

from_components(*, domain: str, site: str, product: str = 'DP1.30006.001', tile: str, date: str, time: Optional[str] = None, directional: bool = True, folder: Path) -> 'NEONReflectanceAncillaryENVIFile'

Build a filename like: NEON_{domain}_{site}_{product}_{tile}_{date}[_HHMMSS][_directional]_reflectance_ancillary_envi.img

find_in_directory classmethod

find_in_directory(root: Path) -> List['NEONReflectanceAncillaryENVIFile']

Audience: advanced.

NEONReflectanceAncillaryENVIHDRFile

NEONReflectanceAncillaryENVIHDRFile(path: Path, domain: str, site: str, product: str, date: str, time: Optional[str] = None, tile: Optional[str] = None, directional: bool = False)

Represent the legacy typed filename contract for a ancillary ENVI header product.

from_filename classmethod

from_filename(path: Path) -> 'NEONReflectanceAncillaryENVIHDRFile'

from_components classmethod

from_components(domain: str, site: str, product: str, date: str, folder: Path, time: Optional[str] = None, tile: Optional[str] = None, directional: bool = False) -> 'NEONReflectanceAncillaryENVIHDRFile'

Audience: advanced.

NEONReflectanceConfigFile dataclass

NEONReflectanceConfigFile(path: Path, domain: str | None = None, site: str | None = None, date: str | None = None, time: str | None = None, product: str | None = None, sensor: str | None = None, masked: bool = False, convolution: bool = False, tile: str | None = None, directional: bool = False, suffix: str | None = None)

Represent the legacy typed filename contract for a correction configuration JSON product.

from_filename classmethod

from_filename(path: Path) -> 'NEONReflectanceConfigFile'

find_in_directory classmethod

find_in_directory(directory: Path, suffix: Optional[str] = None) -> List['NEONReflectanceConfigFile']

from_components classmethod

from_components(*, domain: str, site: str, product: str, tile: str, date: str, time: Optional[str], directional: bool, folder: Path) -> 'NEONReflectanceConfigFile'

Audience: advanced.

NEONReflectanceBRDFCorrectedENVIFile dataclass

NEONReflectanceBRDFCorrectedENVIFile(path: Path, domain: str | None = None, site: str | None = None, date: str | None = None, time: str | None = None, product: str | None = None, sensor: str | None = None, masked: bool = False, convolution: bool = False, suffix: str | None = None, tile: str | None = None, directional: bool = False)

Represent the legacy typed filename contract for a BRDF/topographically corrected ENVI image product.

from_filename classmethod

from_filename(path: Path) -> 'NEONReflectanceBRDFCorrectedENVIFile'

from_components classmethod

from_components(domain: str, site: str, date: str, suffix: str, folder: Path, time: Optional[str] = None, tile: Optional[str] = None, directional: bool = False, product: str = '30006.001') -> 'NEONReflectanceBRDFCorrectedENVIFile'

find_in_directory classmethod

find_in_directory(root: Path, *, suffix: str | None = None, include_masks: bool = False, **_: object) -> List['NEONReflectanceBRDFCorrectedENVIFile']

Audience: advanced.

NEONReflectanceBRDFCorrectedENVIHDRFile dataclass

NEONReflectanceBRDFCorrectedENVIHDRFile(path: Path, domain: str | None = None, site: str | None = None, date: str | None = None, time: str | None = None, product: str | None = None, sensor: str | None = None, masked: bool = False, convolution: bool = False, suffix: str | None = None, tile: str | None = None, directional: bool = False)

Represent the legacy typed filename contract for a BRDF/topographically corrected ENVI header product.

from_filename classmethod

from_filename(path: Path) -> 'NEONReflectanceBRDFCorrectedENVIHDRFile'

find_in_directory classmethod

find_in_directory(root: Path, *, suffix: str | None = None, **_: object) -> List['NEONReflectanceBRDFCorrectedENVIHDRFile']

Audience: advanced.

NEONReflectanceBRDFMaskENVIFile dataclass

NEONReflectanceBRDFMaskENVIFile(path: Path, domain: str | None = None, site: str | None = None, date: str | None = None, time: str | None = None, product: str | None = None, sensor: str | None = None, masked: bool = False, convolution: bool = False, suffix: str | None = None, tile: str | None = None, directional: bool = False)

Represent the legacy typed filename contract for a BRDF mask ENVI image product.

from_filename classmethod

from_filename(path: Path) -> 'NEONReflectanceBRDFMaskENVIFile'

from_components classmethod

from_components(domain: str, site: str, date: str, suffix: str, folder: Path, *, product: str = '30006.001', time: Optional[str] = None, tile: Optional[str] = None, directional: bool = False) -> 'NEONReflectanceBRDFMaskENVIFile'

find_in_directory classmethod

find_in_directory(root: Path, *, suffix: str | None = None, **_: object) -> List['NEONReflectanceBRDFMaskENVIFile']

Audience: advanced.

NEONReflectanceBRDFMaskENVIHDRFile dataclass

NEONReflectanceBRDFMaskENVIHDRFile(path: Path, domain: str | None = None, site: str | None = None, date: str | None = None, time: str | None = None, product: str | None = None, sensor: str | None = None, masked: bool = False, convolution: bool = False, suffix: str | None = None, tile: str | None = None, directional: bool = False)

Represent the legacy typed filename contract for a BRDF mask ENVI header product.

from_filename classmethod

from_filename(path: Path) -> 'NEONReflectanceBRDFMaskENVIHDRFile'

from_components classmethod

from_components(domain: str, site: str, date: str, suffix: str, folder: Path, *, product: str = '30006.001', time: Optional[str] = None, tile: Optional[str] = None, directional: bool = False) -> 'NEONReflectanceBRDFMaskENVIHDRFile'

find_in_directory classmethod

find_in_directory(root: Path, *, suffix: str | None = None, **_: object) -> List['NEONReflectanceBRDFMaskENVIHDRFile']

Audience: advanced.

NEONReflectanceCoefficientsFile dataclass

NEONReflectanceCoefficientsFile(path: Path, domain: str | None = None, site: str | None = None, date: str | None = None, time: str | None = None, product: str | None = None, sensor: str | None = None, masked: bool = False, convolution: bool = False, correction: str | None = None, suffix: str | None = None, tile: str | None = None, directional: bool = False)

Represent the legacy typed filename contract for a correction coefficient product.

from_filename classmethod

from_filename(path: Path) -> 'NEONReflectanceCoefficientsFile'

from_components classmethod

from_components(domain: str, site: str, date: str, correction: str, suffix: str, folder: Path, time: Optional[str] = None, tile: Optional[str] = None, directional: bool = False, product: str = '30006.001') -> 'NEONReflectanceCoefficientsFile'

find_in_directory classmethod

find_in_directory(directory: Path, *, correction: Optional[str] = None, suffix: Optional[str] = None, **_: object) -> List['NEONReflectanceCoefficientsFile']

Audience: advanced.

NEONReflectanceResampledENVIFile dataclass

NEONReflectanceResampledENVIFile(path: Path, domain: str | None = None, site: str | None = None, date: str | None = None, time: str | None = None, product: str | None = None, sensor: str | None = None, masked: bool = False, convolution: bool = False, suffix: str = 'envi', tile: str | None = None, directional: bool = False)

Represent the legacy typed filename contract for a resampled sensor ENVI image product.

from_filename classmethod

from_filename(path: Path) -> 'NEONReflectanceResampledENVIFile'

from_components classmethod

from_components(domain: str, site: str, date: str, sensor: str, suffix: str, folder: Path, time: Optional[str] = None, tile: Optional[str] = None, directional: bool = False, product: str = '30006.001') -> 'NEONReflectanceResampledENVIFile'

find_in_directory classmethod

find_in_directory(directory: Path, sensor: Optional[str] = None, suffix: Optional[str] = None) -> List['NEONReflectanceResampledENVIFile']

find_all_sensors_in_directory classmethod

find_all_sensors_in_directory(directory: Path, suffix: Optional[str] = None) -> List['NEONReflectanceResampledENVIFile']

Audience: advanced.

NEONReflectanceResampledHDRFile

NEONReflectanceResampledHDRFile(path: Path, domain: str, site: str, date: str, product: Optional[str] = None, time: Optional[str] = None, sensor: Optional[str] = None, suffix: str = 'envi', tile: Optional[str] = None, directional: bool = False)

Represent the legacy typed filename contract for a resampled sensor ENVI header product.

from_filename classmethod

from_filename(path: Path) -> 'NEONReflectanceResampledHDRFile'

from_components classmethod

from_components(domain: str, site: str, date: str, sensor: str, suffix: str, folder: Path, time: Optional[str] = None, tile: Optional[str] = None, directional: bool = False, product: str = '30006.001') -> 'NEONReflectanceResampledHDRFile'

find_in_directory classmethod

find_in_directory(directory: Path, sensor: Optional[str] = None, suffix: Optional[str] = None) -> List['NEONReflectanceResampledHDRFile']

Audience: advanced.

NEONReflectanceResampledMaskENVIFile dataclass

NEONReflectanceResampledMaskENVIFile(path: Path, domain: str | None = None, site: str | None = None, date: str | None = None, time: str | None = None, product: str | None = None, sensor: str | None = None, masked: bool = False, convolution: bool = False, suffix: str = 'envi', tile: str | None = None, directional: bool = False)

Represent the legacy typed filename contract for a resampled sensor mask ENVI image product.

from_filename classmethod

from_filename(path: Path) -> 'NEONReflectanceResampledMaskENVIFile'

from_components classmethod

from_components(domain: str, site: str, date: str, sensor: str, suffix: str, folder: Path, time: Optional[str] = None, tile: Optional[str] = None, directional: bool = False, product: str = '30006.001') -> 'NEONReflectanceResampledMaskENVIFile'

find_in_directory classmethod

find_in_directory(directory: Path, sensor: Optional[str] = None, suffix: Optional[str] = None) -> List['NEONReflectanceResampledMaskENVIFile']

Audience: advanced.

NEONReflectanceResampledMaskHDRFile

NEONReflectanceResampledMaskHDRFile(path: Path, domain: str, site: str, date: str, product: Optional[str] = None, time: Optional[str] = None, sensor: Optional[str] = None, suffix: str = 'envi', tile: Optional[str] = None, directional: bool = False)

Represent the legacy typed filename contract for a resampled sensor mask ENVI header product.

from_filename classmethod

from_filename(path: Path) -> 'NEONReflectanceResampledMaskHDRFile'

from_components classmethod

from_components(domain: str, site: str, date: str, sensor: str, suffix: str, folder: Path, time: Optional[str] = None, tile: Optional[str] = None, directional: bool = False, product: str = '30006.001') -> 'NEONReflectanceResampledMaskHDRFile'

find_in_directory classmethod

find_in_directory(directory: Path, sensor: Optional[str] = None, suffix: Optional[str] = None) -> List['NEONReflectanceResampledMaskHDRFile']

Audience: advanced.

SpectralDataParquetFile

SpectralDataParquetFile(path: Path, base: str)

Represent the legacy typed filename contract for a spectral-data Parquet product.

from_raster_file classmethod

from_raster_file(raster_file: DataFile) -> 'SpectralDataParquetFile'

from_filename classmethod

from_filename(path: Path) -> 'SpectralDataParquetFile'

Audience: advanced.

MaskedSpectralCSVFile

MaskedSpectralCSVFile(path: Path, domain: str, site: str, date: str, time: str, product: Optional[str] = None, tile: Optional[str] = None)

Represents masked spectral data CSV files like NEON_D13_NIWO_DP1_*_with_mask_and_all_spectra.csv

from_components classmethod

from_components(domain: str, site: str, date: str, time: str, base_name: str, folder: Path) -> 'MaskedSpectralCSVFile'

Audience: advanced.

EndmembersCSVFile

EndmembersCSVFile(path: Path, domain: str, site: str, date: str, time: str)

Represents endmembers CSV output from unmixing process

from_signatures_file classmethod

from_signatures_file(signatures_file: MaskedSpectralCSVFile, output_dir: Path) -> 'EndmembersCSVFile'

Audience: advanced.

UnmixingModelBestTIF

UnmixingModelBestTIF(path: Path, domain: str, site: str, date: str, time: str)

Represents model_best.tif output from unmixing

from_signatures_file classmethod

from_signatures_file(signatures_file: MaskedSpectralCSVFile, output_dir: Path) -> 'UnmixingModelBestTIF'

Audience: advanced.

UnmixingModelFractionsTIF

UnmixingModelFractionsTIF(path: Path, domain: str, site: str, date: str, time: str)

Represents model_fractions.tif output from unmixing

from_signatures_file classmethod

from_signatures_file(signatures_file: MaskedSpectralCSVFile, output_dir: Path) -> 'UnmixingModelFractionsTIF'

Audience: advanced.

UnmixingModelRMSETIF

UnmixingModelRMSETIF(path: Path, domain: str, site: str, date: str, time: str)

Represents model_rmse.tif output from unmixing

from_signatures_file classmethod

from_signatures_file(signatures_file: MaskedSpectralCSVFile, output_dir: Path) -> 'UnmixingModelRMSETIF'