>  Docs Center  >  Crop Science API  >  ENVIAgFindDevelopingHotspotsTask



This task looks for anomalies between two rasters of the same spatial extent, from different dates. The result is a classification image that shows statistically significant differences during the intervening time period. Areas that change at an average rate are suppressed, while areas that change at a higher rate (positive or negative) are highlighted. For agricultural studies, this can be useful for identifying areas that are growing faster or slower, relative to the entire image. Or, it can reveal areas that were damaged by events such as hail storms and drought.

You should spatially subset the Time 1 and Time 2 images to only include your area of interest, or mask out the rest of the images outside of the field extent. Then ensure that they are co-registered. See Example of Subsetting by ROI in the Find Hotspots topic for instructions.

This task is part of ENVI Crop Science, which requires a separate license and installation.


The source data used in this example is a time series of Sentinel-2A Level-1 images of Imperial Valley, California, in 2016. The source images were corrected for atmospheric effects using the ENVI QUick Atmospheric Correction (QUAC®) tool. A region of interest (ROI) was defined for a durum wheat field, and each image in the time series was spatially subsetted around this field. The ENVI Spectral Indices tool was used to create NDVI images for the field. The NDVI images are located in the data\crop_science\trend_analysis folder of the ENVI installation path.

; Start the application
e = ENVI()
; Open a Sentinel-2 base image
file = Filepath('Sentinel2Subset_2016-12-12.dat', $
  Subdir=['data','crop_science','trend_analysis'], $
  Root_Dir = e.Root_Dir)
raster = e.OpenRaster(file)
; Open two NDVI images
Time1File = Filepath('DurumWheatNDVI_2016-11-22.dat', $
  Subdir=['data','crop_science','trend_analysis'], $
Time1Raster = e.OpenRaster(Time1File)
Time2File = Filepath('DurumWheatNDVI_2016-12-12.dat', $
  Subdir=['data','crop_science','trend_analysis'], $
Time2Raster = e.OpenRaster(Time2File)
; Get the task from the catalog of ENVITasks
Task = ENVITask('AgFindDevelopingHotspots')
; Define inputs
Task.INPUT_TIME1_RASTER = Time1Raster
Task.INPUT_TIME2_RASTER = Time2Raster
Task.DISTANCE = 10 ;meters
; Run the task
; Get the collection of objects currently in the Data Manager
DataColl = e.Data
; Add the output to the data collection
DataColl.Add, Task.OUTPUT_RASTER
; Display the result
View = e.GetView()
Layer = View.CreateLayer(raster)
Layer2 = View.CreateLayer(Task.OUTPUT_RASTER)
View.Zoom, 2.0


Result = ENVITask('AgFindDevelopingHotspots')


Output properties (Get only): OUTPUT_RASTER

Properties marked as "Init" are applied only during the initial creation of the object. Properties marked as "Set" are those that you can set to specific values after the object has been created. You can also retrieve their current values any time. Properties marked as "Get" are those whose values you can retrieve but not set.


This task inherits the following methods from ENVITask. See the ENVITask topic in ENVI Help.

  • AddParameter
  • Execute
  • Parameter
  • ParameterNames
  • RemoveParameters


This task inherits the following properties from ENVITask:







See the ENVITask topic in ENVI Help for details.

This task also contains the following properties:

DISTANCE (required)

Specify the radius of the area around each pixel used to calculate the local mean. If the input rasters have a valid spatial reference, then the radius is measured in meters. Otherwise, it is measured in pixels.


Specify a raster at time 1.


Specify a raster of the same area at a later time.


This is a reference to the output raster of filetype ENVI.


Specify a string with the fully qualified filename and path of the output raster. If you do not specify this property, the output raster is only temporary. Once the raster has no remaining references, ENVI deletes the temporary file.

THRESHOLD (required)

Specify the threshold for the first color slice. The default is 3.0 standard deviations. Lower values reveal more hotspots, while higher values reveal fewer hotspots.

Version History



See Also

ENVIAgFindDevelopingHotspotsWithSpectralIndexTask, ENVIAgHotspotAnalysisTask, ENVIAgSpectralHotspotAnalysisTask, ENVIAgCalculateGetisOrd, ENVIAgCalculateGetisOrdTask

© 2020 Harris Geospatial Solutions, Inc. |  Legal
My Account    |    Store    |    Contact Us