Interpolate spectra
source module isofit.utils.interpolate_spectra
Classes
Functions
-
interpolate_spectra — Interpolate wavelength bands that are either no data or Nan. The interpolation will only be applied to pixel-vectors that include partial NaNs. This is meant to be used if the number of wavelengths missing is minor, and has not been widely tested if a large number of wavelength vlues are missing.
source class Worker(infile, outfile, inplace, nodata_value, logfile, loglevel)
source method Worker.interpolate_values(meas, replace_nan=False)
source method Worker.interpolate_chunk(startstop)
source interpolate_spectra(infile: str, outfile: str = '', inplace: bool = False, nodata_value: float = -9999.0, n_cores: int = -1, ray_address: str = None, ray_redis_password: str = None, ray_temp_dir: str = None, ray_ip_head=None, task_inflation_factor: int = 1, logfile: str = None, loglevel: str = 'INFO')
Interpolate wavelength bands that are either no data or Nan. The interpolation will only be applied to pixel-vectors that include partial NaNs. This is meant to be used if the number of wavelengths missing is minor, and has not been widely tested if a large number of wavelength vlues are missing.
The interpolation will do two checks. One for "nodata values," the other for NaN values. Motivated by some sensor products which have rdn data with both no data, and NaN values.
Parameters
infile: str Input file that contains the wavelengths to be interpolated. inplace: bool Flag to tell algorithm to write to new file (False) or write to input file (True) outfile: str Output lcoation for the interpolated wavelengths nodata_value: float No data value to check against, and interpolate across Flexible typing in numpy boolean operations means this could be float or int n_cores: int Number of cores to run. Substantial parallelism is available Defaults to maxing this out on the available system (-1) logfile: str File path to write logs to loglevel: str Logging level with which to run ISOFIT
Raises
-
ValueError