This task creates a classification raster based on color slices that represent relative Z-scores calculated from Getis-Ord Gi* hotspot analysis.
This task requires a separate license for the ENVI Crop Science Module; contact your sales representative for more information.
Example
This example first creates a Z-score raster from a spectral index image of alfalfa fields. It then creates a classification raster with color slices that represent the relative Z-scores.
The source image consists of layer-stacked Sentinel-2A visible, near-infrared, and shortwave-infrared bands with a spatial resolution of 10 meters. The image is from eastern Idaho, USA. The accompanying region of interest (ROI) file encompasses alfalfa fields. It is used to mask out all non-alfalfa pixels from the source image. The masked raster is then used to create a Modified Simple Ratio index, which is used as input to the Getis-Ord statistics calculation.
e = ENVI()
File = Filepath('CircularFields_Sentinel2A.dat', $
Subdir=['data', 'crop_science'], $
Root_Dir=e.Root_Dir)
Raster = e.OpenRaster(File)
ROIFile = Filepath('CircularFields_AlfalfaROI.xml', $
Subdir=['data', 'crop_science'], $
Root_Dir=e.Root_Dir)
ROI = e.OpenROI(ROIFile)
maskedRaster = ENVIROIMaskRaster(Raster, ROI)
MSRImage = ENVISpectralIndexRaster(maskedRaster, 'MSR')
GetisOrdTask = ENVITask('AgCalculateGetisOrd')
GetisOrdTask.INPUT_RASTER = MSRImage
GetisOrdTask.DISTANCE = 10
GetisOrdTask.Execute
Task = ENVITask('AgHotspotColorSlice')
Task.INPUT_RASTER = GetisOrdTask.OUTPUT_RASTER
Task.Execute
DataColl = e.Data
DataColl.Add, Task.OUTPUT_RASTER
View = e.GetView()
Layer = View.CreateLayer(Task.OUTPUT_RASTER)
Syntax
Result = ENVITask('AgHotspotColorSlice')
Input properties (Set, Get): INPUT_RASTER, OUTPUT_RASTER_URI
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:
INPUT_RASTER (required)
Specify a single-band raster.
OUTPUT_RASTER
This is a reference to the output hotspot color slice 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.
Version History
Crop Science 1.0
|
Introduced |
See Also
SpectralHotspotAnalysis Task, AgCalculateGetisOrd Task