This task performs Adaptive Coherence Estimator (ACE) target detection analysis.
To perform ACE using subspace background statistics, see the SpectralAdaptiveCoherenceEstimatorUsingSubspaceBackgroundStatistics task.
Example
ACE target detection involves multiple steps, as this code example demonstrates:
- Open a spectral library.
- Open a hyperspectral image.
- Get the wavelength values and units from the image.
- Choose an individual spectrum from the spectral library.
- Resample the spectrum to the wavelengths of the image.
- Run ACE target detection.
- Display the resulting image. Brighter pixels represent a close match to the Dry Grass spectrum.
This example takes several minutes to complete. Copy and paste the following code into the IDL Editor:
e = ENVI()
specLibFile = FILEPATH('veg_2grn.sli', ROOT_DIR=e.ROOT_DIR, $
SUBDIR=['resource', 'speclib', 'veg_lib'])
specLib = ENVISpectralLibrary(specLibFile)
file = FILEPATH('AVIRISReflectanceSubset.dat', $
ROOT_DIR=e.ROOT_DIR, $
SUBDIRECTORY = ['data', 'hyperspectral'])
raster = e.OpenRaster(file)
metadata = raster.METADATA
wavelengths = metadata['Wavelength']
wavelengthUnits = metadata['Wavelength Units']
Task1 = ENVITask('GetSpectrumFromLibrary')
Task1.INPUT_SPECTRAL_LIBRARY = specLib
Task1.SPECTRUM_NAME = 'Dry Grass'
Task1.Execute
Task2 = ENVITask('ResampleSpectrum')
Task2.INPUT_SPECTRUM = Task1.SPECTRUM
Task2.INPUT_WAVELENGTHS = Task1.WAVELENGTHS
Task2.INPUT_WAVELENGTH_UNITS = Task1.WAVELENGTH_UNITS
Task2.RESAMPLE_WAVELENGTHS = wavelengths
Task2.RESAMPLE_WAVELENGTH_UNITS = wavelengthUnits
Task2.Execute
ACETask = ENVITask('SpectralAdaptiveCoherenceEstimator')
ACETask.INPUT_RASTER = raster
ACETask.SPECTRA = Task2.OUTPUT_SPECTRUM
ACETask.Execute
DataColl = e.Data
DataColl.Add, ACETask.OUTPUT_RASTER
View = e.GetView()
Layer = View.CreateLayer(ACETask.OUTPUT_RASTER)
Syntax
Result = ENVITask('SpectralAdaptiveCoherenceEstimator')
Input properties (Set, Get): COVARIANCE, INPUT_RASTER, MEAN, OUTPUT_RASTER_URI, SPECTRA
Output properties (Get only): OUTPUT_RASTER
Properties marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Properties marked as "Get" are those whose values you can retrieve but not set.
Methods
This task inherits the following methods from ENVITask:
AddParameter
Execute
Parameter
ParameterNames
RemoveParameter
Properties
This task inherits the following properties from ENVITask:
COMMUTE_ON_DOWNSAMPLE
COMMUTE_ON_SUBSET
DESCRIPTION
DISPLAY_NAME
NAME
REVISION
TAGS
This task also contains the following properties:
COVARIANCE (optional)
Specify an array that is the covariance matrix of the input bands. The array size is [number of bands, number of bands].
INPUT_RASTER (required)
Specify a raster on which to perform the Adaptive Coherence Estimator.
MEAN (optional)
Specify an array that is the mean of the input bands. The number of elements in the array must match the number of bands.
OUTPUT_RASTER
This is a reference to the output raster of filetype ENVI.
OUTPUT_RASTER_URI (optional)
Specify a string with the fully qualified filename and path of the associated OUTPUT_RASTER. If you do not specify this property, or set it to an exclamation symbol (!), a temporary file will be created.
SPECTRA (required)
Specify a floating-point array with the target spectra. The array size is [number of bands, number of target spectra].
Version History
API Version
4.3
See Also
ENVITask, SpectralSubspaceBackgroundStatistics Task, SpectralAdaptiveCoherenceEstimatorUsingSubspaceBackgroundStatistics Task