Environments | PYTHON :: EASI :: MODELER |
Quick links | Description :: Parameters :: Parameter descriptions :: Details :: Example :: Algorithm :: References :: Related |
Back to top |
Back to top |
vegindex(fili, visirchn, filo, dboc, index, datatype, scaloffs, scalfact, ftype, foptions)
Name | Type | Caption | Length | Value range |
---|---|---|---|---|
FILI* | str | Input image or images for calculation | 1 - | |
VISIRCHN | List[int] | Database input channel list | 0 - 10 | -10000 - |
FILO* | str | Name of the output file | 1 - | |
DBOC | List[int] | Generated vegetation indices | 0 - | |
INDEX* | str | Vegetation index | 2 - 192 | |
DATATYPE | str | Output raster type | 0 - 3 | 8U | 16S | 16U | 32R Default: 32R |
SCALOFFS | List[float] | Scaling offset | 0 - 2 | |
SCALFACT | List[float] | Scaling factor | 0 - 2 | |
FTYPE | str | Output file type | 0 - 4 | Default: PIX |
FOPTIONS | str | Output file options | 0 - |
Back to top |
FILI
The path and file name of the input imagery to use in the index calculation. The file you specify must be a GDB-supported format.
VISIRCHN
The list of input channels that contain the blue, green, red, red-edge, near-infrared (NIR), and shortwave-infrared (SWIR) bands. This information must be specified correctly to ensure proper computation of the masks.
You specify this parameter as follows:
<Blue>,<Green>,<Red>,<Red edge(705nm)>,<NIR(830nm)>,<SWIR(1610nm)>,<SWIR(2190nm)>,<NIR(860nm)>,<Red edge(740nm)>,<Red edge(783nm)>
If you do not specify a value for this parameter, VEGINDEX checks for the MinWavelength, MaxWavelength, and WavelengthUnits metadata tags at the channel level to properly associate each channel with the correct band.
If the metadata tags are missing for any of the required channels, and no value is specified for VISIRCHN, processing stops, and an error message is displayed.
VISIRCHN = 0,3,2,0,1,0,4,0,0,0
If a required band is missing, you must specify a 0 (zero) for the position of the missing band in the list of input channels.
If using WorldView-2, and the file is set up as a standard WV-2 dataset, the value of VISIRCHN must be:
VISIRCHN = 2,3,5,6,7,8,0,0,0,0
This parameter is optional.
FILO
The name of the output file to which to write the processed data.
If the output file does not exist, one is created based on the type specified for FTYPE and the options specified for FOPTIONS. The file will have the number of channels required and have the same geocoding information and metadata as the input file.
If the output file is an existing file, it must be in a format that can be updated. The file must also contain channels suitable for writing the results, as specified by the value of DBOC.
When you specify an existing file, you need not specify a value for FTYPE and FOPTIONS unless the values of these parameters correspond to the type and options of the file; otherwise, an error may occur.
This parameter is mandatory.
DBOC
The output channel or channels to which to write the calculated vegetation index values.
If the output file is an existing file, you must specify the existing channels to update as the value of this parameter. If the output file and the input file are the same, and the output channels equate to the input channels, the channels are modified in place. The output raster channels must be a depth of 32 bits.
This parameter is optional.
INDEX
The type of vegetation index to calculate. You can enter a single index or enter a comma-separated list of one or more.
To calculate all indices appropriate to the input data, specify ALL.
DATATYPE
The data type of the output channel to create.
When the output is written to existing channels, this parameter is ignored.
When the number of output channels is greater than one, the specified data type is used for each output channel.
This parameter is optional.
SCALOFFS
The scaling offset to convert the computed index values to digital numbers (DN) in the output image.
If you specify a value for this parameter, you must also specify a scaling-factor value.
Together, the scaling factor and scaling offset convert the computed radiance values to DNs, as follows:
DN = Reflectance × Scaling factor + Scaling offset
Gain = 1 ÷ Scaling factor Bias = -Scaling offset ÷ Scaling factor Scaling factor = 1 ÷ Gain Scaling offset = -Bias ÷ Gain
This parameter is optional.
SCALFACT
The scaling factor to convert the computed index values to DNs in the output channels. The value or values you specify must be positive (greater than zero).
If you specify a value for the scaling factor, you must also specify a value for the scaling offset.
For information about scaling offset, including a list of default values according to data type, see the scaling-offset description.
This parameter is optional.
FTYPE
The format of the output file. The format must be a GDB-recognized type.
The default value is PIX.
For a complete list of GDB-recognized file types, see GDB-supported file formats.
FOPTIONS
The file-creation options to apply on creating the output file. These are specific to the format of the file; in each case, the default of no options is allowed. You can specify the compression schemes, file-format subtypes, and other information.
Different options are available for each type, as described for the FTYPE parameter.
For a complete list of GDB-recognized file types, including the available options for each, see GDB-supported file formats.
Back to top |
VEGINDEX calculates one or more vegetation indices using the reflectance data (top of atmosphere (TOA) or absolute reflectance) in the input file, channels, or both. If the input data is DN values, they will be converted internally to TOA reflectance values for calculation. The results are written to a new file, or to the file and channels you specify.
To avoid scaling of the results produced by VEGINDEX, make sure they are written to 32-bit real channels.
When file and band metadata information is available, VEGINDEX uses this information to select appropriate data for the input index or indices.
Before running VEGINDEX, it is recommended that your input data be corrected atmospherically to ensure your results are due truly to the vegetation, and not changing atmospheric conditions.
Supported sensors
Back to top |
The following example calculates all indices for a Landsat-7 image. Because the file has no available metadata, you must enter the channel information.
The number of output indices will be 11, based on the index to calculate being ALL. MCARI indices will not be created, because the required RedEdge band is not of Landsat-8 band structure.
from pci.vegindex import vegindex fili = "l7_ms_atcor.pix" visirchn= [1,2,3,0,4,5,6,0,0,0] # No RedEdge band filo = "vegindex.pix" # New file to create dboc = [] # Create 32-bit channels index = "ALL" # All indices possible for this sensor datatype= '32R' scaloffs = [] # Default no scaling scalfact = [] # Default no scaling ftype = "" foptions = "" vegindex(fili, visirchn, filo, dboc, index, datatype, scaloffs, scalfact, ftype, foptions)
Back to top |
These ratio images are derived from the absorption and reflection spectra of the material of interest. The absorption is based on the molecular bonds in the (surface) material. Therefore, the ratio often provides information on the chemical composition of the target.
The technique of ratioing bands involves separating the spectral-response value of a pixel in one image with that of the corresponding pixel in another. This is done to suppress similarities between bands and to eliminate albedo effects and shadows.
Vegetation indices
An assumption of vegetation indices is that all bare soil in an image will form a line in spectral space. Nearly all of the vegetation indices used commonly are concerned only with red-near-infrared space, so a red-near-infrared line for bare soil is assumed. This line is considered to be the line of zero vegetation.
All isovegetation lines converge at a single point.
The indices that use this assumption are the ratio-based indices, which measure the slope of the line between the point of convergence and the red-NIR point of the pixel. Some examples are: NDVI and RVI.
All isovegetation lines remain parallel to the bare soil line.
Typically, these indices are called perpendicular, because they measure the perpendicular distance from the soil line to the red-NIR point of the pixel. Examples are: DVI and PVI.
Most vegetation formulas are designed for use with data of three or more bands. The VEGINDEX algorithms are separated by the type of input data that is expected for each.
Sensors with RGB only
Name | Algorithm |
---|---|
GRVI | (Green – Red) ÷ (Green + Red) |
GI | ((2.0 × Green) - (Red + Blue)) ÷ ((2.0 × Green) + Red + Blue) |
Sensors with RGB and near-infrared (NIR)
Name | Algorithm | Reference |
---|---|---|
VDI | NIR – Red | 10 |
RVI | NIR ÷ Red | 2 |
NDVI | (NIR – Red) ÷ (NIR + Red) | 9 |
TDVI | (NIR – Red) ÷ (NIR + Red) + .51/2 | 1 |
SAVI | ((NIR – Red) ÷ (NIR + Red + L)) × (1 + L)
The L value is based on the amount of green vegetative cover. With VEGINDEX, L is a default of 0.5, which means, generally, areas of moderate green vegetative cover. |
5 |
MSAVI2 | (0.5) × (2(NIR + 1) – sqrt((2 × NIR + 1)2 – 8(NIR – Red))) | 8 |
GEMI | eta × (1 – 0.25 × eta) – ((Red – 0.125) ÷ (1 – Red))
Where eta = (2 × (NIR2 – Red2) + 1.5 × NIR + 0.5 × Red) ÷ (NIR + Red + 0.5) |
7 |
MTVI | 1.2 × [1.2 × (NIR – Green) – 2.5 × (Red – Green)] | 4 |
EVI | 2.5 × (NIR – Red) ÷ (1+NIR+(6 ×Red) – (7.5 × Blue) | 11 |
EVI2 | 2.5 × (NIR – Red) ÷ (NIR+(2.4 ×Red)+1) | 12 |
OSAVI | (NIR – Red) ÷ (NIR+Red)+0.16) | 13 |
MCARI2 | (1.5 ×[2.5 × (NIR – Red)] – [1.3 ×(NIR – Green)]) ÷ SQRT[((2 × NIR)+1)2 – ((6 ×NIR) – (5 × (SQRT(Red)))) – 0.5)] | 4 |
LAI | (3.618 × EVI) – 0.118 | 22 |
Sensors with RGB, red edge and near-infrared (NIR) or shortwave infrared (SWIR)
Name | Algorithm | Reference |
---|---|---|
GVI (Landsat-7 and Landsat-8 only) | (–0.2848*TM1) + (–0.2435*TM2) + (–0.5436*TM3) + (0.7243*TM4) + (0.0840*TM5) + (–1.1800*TM7) | 6 |
MCARI | [(RedEdge – Red) – 0.2 × (RedEdge - Green)] × (RedEdge ÷ Red) | 3 |
AFRI16 | [(NIR – (0.66 × SWIR1.6)) ÷ (NIR + (0.66 × SWIR1.6)); | 14 |
AFRI21 | [(NIR – (0.5 × SWIR2.1)) ÷ (NIR + (0.5 × SWIR2.1)); | 14 |
RENDVI (also known as NDRE) | (RedEdge750mm – NIR)) ÷ (RedEdge750mm+NIR); | 15 |
MRENDVI | (RedEdge750mm – NIR)) ÷ (RedEdge750mm+NIR – (2 × Blue); | 16/17 |
TCARI | 3 × (RedEdge700mm – Red) – (0.2 × (RedEdge700mm – Green) × (RedEdge700mm ÷ Red) | 18 |
NMDI | (NIR860mm – (SWIR1.6 – SWIR2.1)) ÷ (NIR860mm + (SWIR1.6 –SWIR2.1)) | 19/20 |
CIRedEdge | (RedEdge780mm ÷ RedEdge705mm) – 1 | 21 |
NDNI | ((log(1 ÷ SWIR) – log(1 ÷ SWIR1)) ÷ (log(1 ÷ SWIR) – log(1 ÷ SWIR1))) | 23 |
PSRI | ( (Red – Blue) ÷ RedEdge750mm | 24 |
Back to top |
© PCI Geomatics Enterprises, Inc.®, 2024. All rights reserved.