isofit.core.fileio¶
-
class
SpectrumFile(fname, write=False, n_rows=None, n_cols=None, n_bands=None, interleave=None, dtype=<class 'numpy.float32'>, wavelengths=None, fwhm=None, band_names=None, bad_bands='[]', zrange='{0.0, 1.0}', flag=-9999.0, ztitles='{Wavelength (nm), Magnitude}', map_info='{}')[source]¶ Bases:
objectA buffered file object that contains configuration information about formatting, etc.
-
get_frame(row)[source]¶ The frame is a 2D array, essentially a list of spectra. The self.frames list acts as a hash table to avoid storing the entire cube in memory. So we read them or create them on an as-needed basis. When the buffer flushes via a call to flush_buffers, they will be deleted.
-
write_spectrum(row, col, x)[source]¶ We write a spectrum. If a binary format file, we simply change the data cached in self.frames and defer file I/O until flush_buffers is called.
-
-
class
IO(config, forward, inverse, active_rows, active_cols)[source]¶ Bases:
object…
-
get_components_at_index(index)[source]¶ Get the spectrum from the file at the specified index. Helper/ parallel enabling function.
Parameters: index ( int) – reference location for iter_indsReturns: success: boolean flag indicating if data present Returns: r: row index Returns: c: column index Returns: meas: measured radiance file Return type: (<class ‘int’>, <class ‘int’>, <built-in function array>, <class ‘isofit.core.geometry.Geometry’>) Returns: geom: set up specified geometry files
-