fpipy.io¶
Functions for reading data from various formats.
Functions
|
Read ENVI format CFA data and metadata to an xarray Dataset. |
|
Read a CSV calibration file to a structured dataset. |
|
Load metadata from a .hdt header file (VTT format). |
-
fpipy.io.read_ENVI_cfa(filepath, raw_unit='dn', **kwargs)[source]¶ Read ENVI format CFA data and metadata to an xarray Dataset.
For the VTT format raw ENVI files the ENVI metadata is superfluous and is discarded, with the actual metadata read from the separate VTT header file. Wavelength and fwhm data will be replaced with information from metadata and number of layers etc. are omitted as redundant. Gain and bayer pattern are assumed to be constant within each file.
- Parameters
- Returns
dataset – Dataset derived from the raw image data and accompanying metadata. If the ENVI data had an included dark layer, it is separated into its own data variable in the dataset.
- Return type
-
fpipy.io.read_calibration(calibfile, wavelength_unit='nm')[source]¶ Read a CSV calibration file to a structured dataset.
- Parameters
calibfile (str) – Filepath to the CSV file containing the metadata. The CSV is assumed to have the following columns (case-sensitive, in no specific order): [‘Npeaks’, ‘SP1’, ‘SP2’, ‘SP3’, ‘PeakWL’, ‘FWHM’, ‘Sinv’]
wavelength_unit (str, optional) – Unit of the wavelength data in the calibration file.
- Returns
Dataset containing the calibration data in a structured format.
- Return type
xr.Dataset