pygmi.rsense.ratios#

Calculate remote sensing ratios and condition indices.

Classes#

SatRatios

GUI to calculate satellite ratios.

ConditionIndices

GUI to calculate satellite condition indices.

Functions#

calc_ratios(idat, rlist[, showlog, piter, sensor])

Calculate Band ratios.

correct_bands(rlist, sensor[, bfile])

Correct the band designations.

correct_EMIT_bands(rlist, dat)

Correct EMIT band names.

get_aster_list(flist)

Get ASTER files from a file list.

get_EMIT_list(flist)

Get EMIT files from a file list.

get_landsat_list(flist[, sensor, allsats])

Get Landsat files from a file list.

get_sentinel_list(flist)

Get Sentinel-2 files from a file list.

get_TCI(lst)

Calculate TCI.

get_VCI(evi, index)

Calculate VCI.

get_VHI(tci, vci[, alpha])

Calculate VHI.

landslide_index(dat[, sensor, showlog, piter])

Calculate Band ratios.

Module Contents#

class pygmi.rsense.ratios.SatRatios(parent=None)#

Bases: pygmi.misc.BasicModule

GUI to calculate satellite ratios.

Parameters:

parent – Reference to the parent routine. The default is None.

setupui()#

Set up UI.

settings(nodialog=False)#

Entry point into item.

Parameters:

nodialog (bool) – Run settings without a dialog. The default is False.

Returns:

True if successful, False otherwise.

Return type:

bool

saveproj()#

Save project data from class.

acceptall()#

Accept option.

Updates self.outdata, which is used as input to other modules.

Returns:

True if successful, False otherwise.

Return type:

bool

setratios()#

Set the available ratios.

The ratio definitions are for the ASTER satellite. Band 0 refers to an imaginary blue band.

invert_selection()#

Invert the selected ratios.

class pygmi.rsense.ratios.ConditionIndices(parent=None)#

Bases: pygmi.misc.BasicModule

GUI to calculate satellite condition indices.

Parameters:

parent – Reference to the parent routine. The default is None.

setupui()#

Set up UI.

settings(nodialog=False)#

Entry point into item.

Parameters:

nodialog (bool) – Run settings without a dialog. The default is False.

Returns:

True if successful, False otherwise.

Return type:

bool

saveproj()#

Save project data from class.

acceptall()#

Accept option.

Updates self.outdata, which is used as input to other modules.

Returns:

True if successful, False otherwise.

Return type:

bool

setratios()#

Set the available indices.

invert_selection()#

Invert the selected ratios.

set_selected_ratios()#

Set the selected ratios.

pygmi.rsense.ratios.calc_ratios(idat, rlist, showlog=print, piter=iter, sensor=None)#

Calculate Band ratios.

Note that this routine assumes that the ratio you supply is correct for your data.

Parameters:
  • dat – List of PyGMI Data.

  • rlist (list[str]) – List of strings, containing ratios to calculate..

  • showlog (collections.abc.Callable[..., None]) – Display information. The default is print.

  • piter (collections.abc.Iterable) – Progress bar iterator. The default is iter.

  • sensor (str | None) – The sensor being processed. The default is None.

  • idat (list[pygmi.raster.datatypes.Data])

Returns:

List of PyGMI Data.

Return type:

list of Data

pygmi.rsense.ratios.correct_bands(rlist, sensor, bfile=None)#

Correct the band designations.

Ratio formula are defined in terms of ASTER bands. This converts that to the target sensor.

Parameters:
  • rlist (list[str]) – List of input ratios.

  • sensor (str) – Target sensor.

  • bfile (str | None) – Data filename. The default is None.

Returns:

List of converted ratios.

Return type:

list of str

pygmi.rsense.ratios.correct_EMIT_bands(rlist, dat)#

Correct EMIT band names.

Parameters:
Returns:

List of EMIT data bands.

Return type:

list of Data

pygmi.rsense.ratios.get_aster_list(flist)#

Get ASTER files from a file list.

Parameters:

flist (list[str]) – List of filenames.

Returns:

List of filenames.

Return type:

list of str

pygmi.rsense.ratios.get_EMIT_list(flist)#

Get EMIT files from a file list.

Parameters:

flist (list[str]) – List of filenames.

Returns:

List of filenames.

Return type:

list of str

pygmi.rsense.ratios.get_landsat_list(flist, sensor=None, allsats=False)#

Get Landsat files from a file list.

Parameters:
  • flist (list[str]) – List of filenames.

  • sensor (str | None) – Landsat satellite sensor, by default None.

  • allsats (bool) – Use all Landsat sensors, by default False.

Returns:

List of filenames.

Return type:

list of str

pygmi.rsense.ratios.get_sentinel_list(flist)#

Get Sentinel-2 files from a file list.

Parameters:

flist (list[str]) – List of filenames.

Returns:

List of filenames.

Return type:

list of str

pygmi.rsense.ratios.get_TCI(lst)#

Calculate TCI.

Parameters:

lst (list[pygmi.raster.datatypes.Data]) – List of PyGMI datasets - land surface temperatures.

Returns:

Output TCI datasets.

Return type:

list of Data

pygmi.rsense.ratios.get_VCI(evi, index)#

Calculate VCI.

Parameters:
Returns:

Output VCI datasets.

Return type:

list of Data

pygmi.rsense.ratios.get_VHI(tci, vci, alpha=0.5)#

Calculate VHI.

Parameters:
Returns:

Output VHI datasets.

Return type:

list of Data

pygmi.rsense.ratios.landslide_index(dat, sensor=None, showlog=print, piter=iter)#

Calculate Band ratios.

Note that this routine assumes that the ratio you supply is correct for your data.

Parameters:
  • dat (list[pygmi.raster.datatypes.Data]) – List of PyGMI Data.

  • sensor (str | None) – The sensor being processed. The default is None.

  • showlog (collections.abc.Callable[..., None]) – Display information. The default is print.

  • piter (collections.abc.Iterable) – Progress bar iterator. The default is iter.

Returns:

Red, green and blue PyGMI Data.

Return type:

list of Data