indices_functions#

This module contains functions to compute radiometric indices.

sen2chain.indices_functions.create_raw_ndr(baseline, b1_path: str | PosixPath, b2_path: str | PosixPath, out_path: str | PosixPath = './raw_ndr.tif') PosixPath#

Creates a generic normalized difference ratio raster from B1 and B2 rasters. NDR = (B1 - B2) / (B1 + B2) :param b1_path: path to the B1 raster. :param b2_path: path to the B2 raster. :param out_path: path to the output raster.

sen2chain.indices_functions.create_raw_ireci(baseline, b1_path: str | PosixPath, b2_path: str | PosixPath, b3_path: str | PosixPath, b4_path: str | PosixPath, out_path: str | PosixPath = './raw_ireci.tif') PosixPath#

Creates an IRECI raster from NIR, RED and RED EDGE rasters.

Parameters:
  • b1_path – path to the NIR raster.

  • b2_path – path to the RED raster.

  • b3_path – path to the first RED EDGE raster.

  • b4_path – path to the second RED EDGE raster.

  • out_path – path to the output raster.

sen2chain.indices_functions.create_raw_bigr(baseline, red_path: str | PosixPath, green_path: str | PosixPath, out_path: str | PosixPath = './raw_bigr.tif') PosixPath#

Creates a BI (Green, Red) raster from GREEN and RED rasters.

Parameters:
  • red_path – path to the RED raster.

  • green_path – path to the GREEN raster.

  • out_path – path to the output raster.

sen2chain.indices_functions.create_raw_birnir(baseline, red_path: str | PosixPath, nir_path: str | PosixPath, out_path: str | PosixPath = './raw_birnir.tif') PosixPath#

Creates a BI (Red, NIR) raster from RED and NIR rasters.

Parameters:
  • red_path – path to the RED raster.

  • nir_path – path to the NIR raster.

  • out_path – path to the output raster.

sen2chain.indices_functions.create_raw_bibg(baseline, blue_path: str | PosixPath, green_path: str | PosixPath, out_path: str | PosixPath = './raw_bibg.tif') PosixPath#

Creates a BI (Blue, Green) raster from BLUE and GREEN rasters.

Parameters:
  • blue_path – path to the BLUE raster.

  • green_path – path to the GREEN raster.

  • out_path – path to the output raster.

sen2chain.indices_functions.create_raw_bi(baseline, b1_path: str | PosixPath, b2_path: str | PosixPath, out_path: str | PosixPath = './raw_bi.tif') PosixPath#

Creates a BI (Green, Red) raster from GREEN and RED rasters.

Parameters:
  • red_path – path to the RED raster.

  • green_path – path to the GREEN raster.

  • out_path – path to the output raster.

sen2chain.indices_functions.create_raw_evi(baseline, blue_path: str | PosixPath, red_path: str | PosixPath, nir_path: str | PosixPath, out_path: str | PosixPath = './raw_evi.tif') PosixPath#

Creates en EVI raster from BLUE, RED, NIR rasters.

Parameters:
  • blue_path – path to the BLUE raster

  • red_path – path to the RED raster.

  • nir_path – path to the NIR raster.

  • out_path – path to the output raster.

sen2chain.indices_functions.create_masked_indice(indice_path: str | PosixPath, cloud_mask_path: str | PosixPath, out_path: str | PosixPath = './masked_indice.tif') PosixPath#

Masks an indice raster with a cloud mask.

Parameters:
  • indice_path – path to the NDVI raster.

  • cloud_mask_path – path to the cloud mask raster.

  • out_path – path to the output raster.

sen2chain.indices_functions.index_tiff_2_jp2(img_path: str | PosixPath, out_path: str | PosixPath = './indice_2_jp2.jp2', quality: int = 20) PosixPath#

Convert a indice file from TIF to JP2. :param out_path: path to the output raster.