The Dehydrate function method returns a hash describing this object. You can use this information in a later ENVI session to restore the object using the object’s static ::Hydrate method or the ENVIHydrate function. For additional information, see What are Hydrate and Dehydrate routines used for?

Example


; Start the application
e = ENVI()
 
; Open an input file
File = Filepath('AVIRISReflectanceSubset.dat', $
SUBDIR=['data', 'hyperspectral'], $
ROOT_DIR=e.Root_Dir)
Raster = e.OpenRaster(File)
 
; Define three ROIs, each containing 9 pixels of a common 
; material.
nSpectra = 9d
roi1 = EnviRoi(NAME='Green Field')
pixelAddr1 = [[77,182],[78,182],[79,182], $
             [77,183],[78,183],[79,183], $
             [77,184],[78,184],[79,184]]
roi1.AddPixels, pixelAddr1, SPATIALREF=raster.SpatialRef
 
roi2 = EnviRoi(NAME='Soil')
pixelAddr2 = [[386,285],[387,285],[388,285], $
             [386,286],[387,286],[388,286], $
             [386,287],[387,287],[388,287]]
roi2.AddPixels, pixelAddr2, SPATIALREF=raster.SpatialRef
 
roi3 = EnviRoi(NAME='Ground')
pixelAddr3 = [[296,326],[297,326],[298,326], $
             [296,327],[297,327],[298,327], $
             [296,328],[297,328],[298,328]]
roi3.AddPixels, pixelAddr3, SPATIALREF=raster.SpatialRef
 
; Retrieve the spectra from the ROIs and use their mean as
; target and background to the BandMaxSubsetRaster.
spectra1 = raster.GetData(ROI=roi1)
mean1 = Total(spectra1,1) / nSpectra
 
spectra2 = raster.Getdata(ROI=roi2)
mean2 = Total(spectra2,1) / nSpectra
 
spectra3 = raster.GetData(ROI=roi3)
mean3 = Total(spectra3,1) / nSpectra
 
targetSpec = [[mean1], [mean2]]
backgroundSpec = mean3
thresh = 0.387
 
; Create a spectral subset of those bands whose BandMax 
; significance values are not less than 0.387.
Subset = ENVIBandMaxSubsetRaster(raster, targetSpec, $
   backgroundSpec, THRESHOLD=thresh)
 
; Retrieve the dehydrated hash
Result = Subset.Dehydrate()
Print, Result, /IMPLIED_PRINT

Syntax


Result = ENVISubsetRaster.Dehydrate(ERROR=value)

Return Value


This function method returns a hash containing the key/value pairs representing the current object state. You can build your own hash without instantiating an object. To see the required key/value pairs for the object see the object’s Hydrate method.

Arguments


None

Keywords


ERROR

Set this keyword to a named variable that will contain any error message issued during execution of this routine. If no error occurs, the ERROR variable will be set to a null string (''). If an error occurs and the routine is a function, then the function result will be undefined.

When this keyword is not set and an error occurs, ENVI returns to the caller and execution halts. In this case, the error message is contained within !ERROR_STATE and can be caught using IDL's CATCH routine. See IDL Help for more information on !ERROR_STATE and CATCH.

See Manage Errors for more information on error handling in ENVI programming.

Version History


ENVI 6.1

Introduced

API Version


4.3

See Also


ENVIBandMaxSubsetRaster, ENVIBandMaxSubsetRaster::Hydrate, ENVIHydratable, ENVIHydrate