Package peppy :: Package hsi :: Module cube :: Class Cube
[frames] | no frames]

Class Cube

object --+
         |
        Cube
Known Subclasses:

Generic representation of an HSI datacube. Specific subclasses BILCube, BIPCube, and BSQCube exist to fill in the concrete implementations of the common formats of HSI data.

Instance Methods
 
__init__(self, filename=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__str__(self)
str(x)
 
fileExists(self)
 
isDataLoaded(self)
 
setURL(self, url=None)
 
open(self, url=None)
 
save(self, url=None)
 
initialize(self, datatype=None, byteorder=None)
 
initializeOffset(self)
 
initializeSizes(self, datatype=None, byteorder=None)
 
initializeMmap(self)
 
initializeRaw(self)
 
shape(self)
Shape the array based on the cube type
 
verifyAttributes(self)
Clean up after loading a cube to make sure some values are populated and that everything that should have defaults does.
 
guessScaleFactor(self)
Try to supply a good guess as to the scale factor of the samples based on the type of the data
 
guessDisplayBands(self)
Guess the best bands to display a false-color RGB image using the wavelength info from the cube's metadata.
 
guessWavelengthUnits(self)
Try to guess the wavelength units if the wavelength list is supplied but the units aren't.
 
getWavelengthStr(self, band)
 
updateExtrema(self, spectra)
 
getUpdatedExtrema(self)
 
getPixel(self, line, sample, band)
Get an individual pixel at the specified line, sample, & band
 
getBand(self, band)
Get a copy of the array of (lines x samples) at the specified band.
 
getBandInPlace(self, band)
Get the slice of the data array (lines x samples) at the specified band.
 
getBandRaw(self, band)
 
getFocalPlaneInPlace(self, line)
Get the slice of the data array (bands x samples) at the specified line, which corresponds to a view of the data as the focal plane would see it.
 
getFocalPlaneRaw(self, line)
 
getFocalPlaneDepthInPlace(self, sample, band)
Get the slice of the data array through the cube at the specified sample and band.
 
getFocalPlaneDepthRaw(self, sample, band)
 
getSpectra(self, line, sample)
Get the spectra at the given pixel.
 
getSpectraInPlace(self, line, sample)
Get the spectra at the given pixel.
 
getSpectraRaw(self, line, sample)
Get the spectra at the given pixel
 
getLineOfSpectra(self, line)
Get the all the spectra along the given line.
 
getLineOfSpectraCopy(self, line)
Get the spectra along the given line.
 
normalizeUnits(self, val, units)
Normalize a value in the specified units to the cube's default wavelength unit.
 
normalizeUnitsTo(self, val, units)
Normalize a value given in the cube's default wavelength unit to the specified unit.
 
getBandListByWavelength(self, wavelen_min, wavelen_max=-1, units='nm')
Get list of bands between the specified wavelength, or if the wavelength range is too small, get the nearest band.
 
getFlatView(self)
Get a flat, one-dimensional view of the data
 
getBandBoundary(self)
return the number of items you have to add to a flat version of the data until you reach the next band in the data
 
flatToLocation(self, pos)
Convert the flat index to a tuple of line,sample,band
 
locationToFlat(self, line, sample, band)
Convert location (line,sample,band) to flat index
 
getBadBandList(self, other=None)

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Properties

Inherited from object: __class__

Method Details

__init__(self, filename=None)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

getBand(self, band)

 

Get a copy of the array of (lines x samples) at the specified band. You are not working on the original data.

getBandInPlace(self, band)

 

Get the slice of the data array (lines x samples) at the specified band. This points to the actual in-memory array.

getFocalPlaneInPlace(self, line)

 

Get the slice of the data array (bands x samples) at the specified line, which corresponds to a view of the data as the focal plane would see it. This points to the actual in-memory array.

getFocalPlaneDepthInPlace(self, sample, band)

 

Get the slice of the data array through the cube at the specified sample and band. This points to the actual in-memory array.

getSpectra(self, line, sample)

 

Get the spectra at the given pixel. Calculate the extrema as we go along.

getSpectraInPlace(self, line, sample)

 

Get the spectra at the given pixel. Calculate the extrema as we go along.

getLineOfSpectra(self, line)

 

Get the all the spectra along the given line. Calculate the extrema as we go along.

getLineOfSpectraCopy(self, line)

 

Get the spectra along the given line. Subclasses override this.