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 requires a separate license for the ENVI Crop Science Module; contact your sales representative for more information.

Example


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'], $
  Root_Dir=e.Root_Dir)
Time1Raster = e.OpenRaster(Time1File)
 
Time2File = Filepath('DurumWheatNDVI_2016-12-12.dat', $
  Subdir=['data','crop_science','trend_analysis'], $
  Root_Dir=e.Root_Dir)
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
Task.Execute
 
; 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

Syntax


Result = ENVITask('AgFindDevelopingHotspots')

Input parameters (Set, Get): DISTANCE, INPUT_TIME1_RASTER, INPUT_TIME2_RASTER, OUTPUT_RASTER_URI, THRESHOLD

Output parameters (Get only): OUTPUT_RASTER

Parameters marked as "Set" are those that you can set to specific values. You can also retrieve their current values any time. Parameters marked as "Get" are those whose values you can retrieve but not set.

Input Parameters


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.

INPUT_TIME1_RASTER (required)

Specify a raster at time 1.

INPUT_TIME2_RASTER (required)

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

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 parameter, or set it to an exclamation symbol (!), ENVI creates a temporary file.
  • If you set it to the hash symbol (#), ENVI creates a file in the temporary directory, but this file will not be deleted when ENVI closes.

THRESHOLD (optional)

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.

Output Parameters


OUTPUT_RASTER

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

Methods


Execute

Parameter

ParameterNames

Properties


DESCRIPTION

DISPLAY_NAME

NAME

REVISION

TAGS

Version History


Crop Science 1.1

Introduced

See Also


AgFindDevelopingHotspotsWithSpectralIndex Task, AgHotspotAnalysis Task, AgSpectralHotspotAnalysis Task, AgCalculateGetisOrd, AgCalculateGetisOrd Task