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.
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.
e = ENVI()
file = Filepath('Sentinel2Subset_2016-12-12.dat', $
Root_Dir = e.Root_Dir)
raster = e.OpenRaster(file)
Time1File = Filepath('DurumWheatNDVI_2016-11-22.dat', $
Time1Raster = e.OpenRaster(Time1File)
Time2File = Filepath('DurumWheatNDVI_2016-12-12.dat', $
Time2Raster = e.OpenRaster(Time2File)
Task = ENVITask('AgFindDevelopingHotspots')
Task.INPUT_TIME1_RASTER = Time1Raster
Task.INPUT_TIME2_RASTER = Time2Raster
Task.DISTANCE = 10
DataColl = e.Data
View = e.GetView()
Layer = View.CreateLayer(raster)
Layer2 = View.CreateLayer(Task.OUTPUT_RASTER)
Result = ENVITask('AgFindDevelopingHotspots')
Input properties (Set, Get): DISTANCE, INPUT_TIME1_RASTER, INPUT_TIME2_RASTER, OUTPUT_RASTER_URI, THRESHOLD
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.
This task inherits the following methods from ENVITask:
This task inherits the following properties from ENVITask:
This task also contains the following properties:
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 associated OUTPUT_RASTER. If you do not specify this property, or set it to an exclamation symbol (!), a temporary file will be created.
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.
Crop Science 1.1
AgFindDevelopingHotspotsWithSpectralIndex Task, AgHotspotAnalysis Task, AgSpectralHotspotAnalysis Task, AgCalculateGetisOrd, AgCalculateGetisOrd Task