Skip to main content

vi

Functions

gli

def gli(**kwargs) -> np.ndarray | None

The GLI is an index which was designed for Digital Numbers like aerial imagery. It uses all visible bands. The index is especially focused on the GREEN band and potentially more sensitive to chlorophyll.

GLI=2GREENREDBLUE2GREEN+RED+BLUEGLI = \dfrac{2 * GREEN - RED - BLUE}{2 * GREEN + RED + BLUE}

Arguments:

  • blue numpy.ndarray - Input array holding Blue data.
  • green numpy.ndarray - Input array holding Green data.
  • red numpy.ndarray - Input array holding Red data.
  • nodata float, optional - Input nodata value. Defaults to 0.
  • mask numpy.ndarray, optional - Input binary array holding mask information.
  • normalize bool, optional - normalize data between -1 and 1. Be mindfull this will cause strange results on tiled data. Defaults to False.

Returns:

  • np.ndarray | None: calculated vegetation index array.

Examples:

gli(
red=np.array([0, 1, 2]),
green=np.array([0, 2, 1]),
blue=np.array([0, 3, 3]),
mask=np.array([0, 1, 1])
)

ndre

def ndre(**kwargs) -> np.ndarray | None

The NDRE uses both the RedEdge and NIR bands from multispectral imagery. This function allows the use of a mask array to delimit the results to a specific crop for example.

NDRE=NIRRedEdgeNIR+RedEdgeNDRE = \dfrac{NIR - RedEdge}{NIR + RedEdge}

Arguments:

  • reg numpy.ndarray - Input array holding RedEdge data.
  • nir numpy.ndarray - Input array holding NIR data.
  • mask numpy.ndarray, optional - Input binary array holding mask information.
  • nodata float, optional - Input nodata value. Defaults to 0.

Returns:

  • np.ndarray | None: calculated vegetation index array.

Examples:

ndre(
reg=np.array([0, 1, 2]),
nir=np.array([0, 2, 1]),
mask=np.array([0, 1, 1])
)

ndvi

def ndvi(**kwargs) -> np.ndarray | None

The NDVI uses both the RED and NIR bands from multispectral imagery or combined use of RGB and NIR cameras. This function allows the use of a mask array to delimit the results to a specific crop for example.

NDVI=NIRREDNIR+REDNDVI = \dfrac{NIR - RED}{NIR + RED}

Arguments:

  • red numpy.ndarray - Input array holding Red data.
  • nir numpy.ndarray - Input array holding NIR data.
  • mask numpy.ndarray, optional - Input binary array holding mask information.
  • nodata float, optional - Input nodata value. Defaults to 0.
  • normalize bool, optional - normalize data between -1 and 1. Be mindfull this will cause strange results on tiled data. Defaults to False.

Returns:

  • np.ndarray | None: calculated vegetation index array.

Examples:

ndvi(
red=np.array([0, 1, 2]),
nir=np.array([0, 2, 1]),
mask=np.array([0, 1, 1]),
nodata=-2,
normalize=True
)

ngrdi

def ngrdi(**kwargs) -> np.ndarray | None

The NGRDI is another vegetation index using only visible bands. Its structure and theory come close to the NDVI without using the IR Band.

NGRDI=GREENREDGREEN+REDNGRDI = \dfrac{GREEN - RED}{GREEN + RED}

Arguments:

  • green numpy.ndarray - Input array holding Green data.
  • red numpy.ndarray - Input array holding Red data.
  • nodata float, optional - Input nodata value. Defaults to 0.
  • mask numpy.ndarray, optional - Input binary array holding mask information.
  • normalize bool, optional - normalize data between -1 and 1. Be mindfull this will cause strange results on tiled data. Defaults to False.

Returns:

  • np.ndarray | None: calculated vegetation index array.

Examples:

ngrdi(
red=np.array([0, 1, 2]),
green=np.array([0, 2, 1]),
mask=np.array([0, 1, 1])
)

rgbvi

def rgbvi(**kwargs) -> np.ndarray | None

The RGBVI is an index that is more used in biomass estimations combined with plant height information, especially in early growth stage. Only uses visible bands.

RGBVI=GREENBLUEREDGREENGREEN+BLUEREDRGBVI = \dfrac{GREEN - BLUE * RED}{GREEN * GREEN + BLUE * RED}

Arguments:

  • blue numpy.ndarray - Input array holding Blue data.
  • green numpy.ndarray - Input array holding Green data.
  • red numpy.ndarray - Input array holding Red data.
  • nodata float, optional - Input nodata value. Defaults to 0.
  • mask numpy.ndarray, optional - Input binary array holding mask information.
  • normalize bool, optional - normalize data between -1 and 1. Be mindfull this will cause strange results on tiled data. Defaults to False.

Returns:

  • np.ndarray | None: calculated vegetation index array.

Examples:

rgbvi(
red=np.array([0, 1, 2]),
green=np.array([0, 2, 1]),
blue=np.array([0, 3, 3]),
mask=np.array([0, 1, 1])
)

vari

def vari(**kwargs) -> np.ndarray | None

The VARI is a genuine bullshit vegetation index used only to fake any type of blue interaction to crop performance. In most crops blue and red have a similar reflectance. The index only requires RGB information. Result can be normalised to [-1, 1], because the index originally does not. This function allows the use of a mask array to delimit the results to a specific crop for example.

VARI=GREENREDGREEN+REDBLUEVARI = \dfrac{GREEN - RED}{GREEN + RED - BLUE}

Arguments:

  • blue numpy.ndarray - Input array holding Blue data.
  • green numpy.ndarray - Input array holding Green data.
  • red numpy.ndarray - Input array holding Red data.
  • nodata float, optional - Input nodata value. Defaults to 0.
  • mask numpy.ndarray, optional - Input binary array holding mask information.
  • normalize bool, optional - normalize data between -1 and 1. Be mindfull this will cause strange results on tiled data. Defaults to False.

Returns:

  • np.ndarray | None: calculated vegetation index array.

Examples:

vari(
red=np.array([0, 1, 2]),
green=np.array([0, 2, 1]),
blue=np.array([0, 3, 3]),
mask=np.array([0, 1, 1])
)