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(dat, rlist[, showlog, piter, sensor])

Calculate Band ratios.

correct_bands(rlist, sensor[, bfile])

Correct the band designations.

get_aster_list(flist)

Get ASTER 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 (parent, optional) – Reference to the parent routine. The default is None.

setupui()#

Set up UI.

Return type:

None.

settings(nodialog=False)#

Entry point into item.

Parameters:

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

Returns:

True if successful, False otherwise.

Return type:

bool

saveproj()#

Save project data from class.

Return type:

None.

acceptall()#

Accept option.

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

Return type:

None.

setratios()#

Set the available ratios.

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

Return type:

None.

invert_selection()#

Invert the selected ratios.

Return type:

None.

set_selected_ratios()#

Set the selected ratios.

Return type:

None.

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

Bases: pygmi.misc.BasicModule

GUI to calculate satellite condition indices.

Parameters:

parent (parent, optional) – Reference to the parent routine. The default is None.

setupui()#

Set up UI.

Return type:

None.

settings(nodialog=False)#

Entry point into item.

Parameters:

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

Returns:

True if successful, False otherwise.

Return type:

bool

saveproj()#

Save project data from class.

Return type:

None.

acceptall()#

Accept option.

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

Return type:

None.

setratios()#

Set the available indices.

Return type:

None.

invert_selection()#

Invert the selected ratios.

Return type:

None.

set_selected_ratios()#

Set the selected ratios.

Return type:

None.

pygmi.rsense.ratios.calc_ratios(dat, 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.raster.datatypes.Data.) – List of PyGMI Data.

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

  • showlog (function, optional) – Display information. The default is print.

  • piter (function, optional) – Progress bar iterator. The default is iter.

Returns:

datfin – List of PyGMI Data.

Return type:

list of pygmi.raster.datatypes.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) – List of input ratios.

  • sensor (str) – Target sensor.

Returns:

rlist2 – List of converted ratios.

Return type:

list

pygmi.rsense.ratios.get_aster_list(flist)#

Get ASTER files from a file list.

Parameters:

flist (list) – List of filenames.

Returns:

flist – List of filenames.

Return type:

list

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

Get Landsat files from a file list.

Parameters:

flist (list) – List of filenames.

Returns:

flist – List of filenames.

Return type:

list

pygmi.rsense.ratios.get_sentinel_list(flist)#

Get Sentinel-2 files from a file list.

Parameters:

flist (list) – List of filenames.

Returns:

flist – List of filenames.

Return type:

list

pygmi.rsense.ratios.get_TCI(lst)#

Calculate TCI.

Parameters:

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

Returns:

tci – output TCI datasets.

Return type:

list of pygmi.raster.datatypes.Data.

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

Calculate VCI.

Parameters:
Returns:

vci – output VCI datasets.

Return type:

list of pygmi.raster.datatypes.Data

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

Calculate VHI.

Parameters:
  • tci (list) – TCI dataset list.

  • vci (list) – VCI dataset list.

  • alpha (float, optional) – Weight for proportion of TCI and VCI. The default is 0.5.

Returns:

vhi – Output VHI datasets.

Return type:

list of pygmi.raster.datatypes.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 of pygmi.raster.datatypes.Data.) – List of PyGMI Data.

  • showlog (function, optional) – Display information. The default is print.

  • piter (function, optional) – Progress bar iterator. The default is iter.

Returns:

datfin – Red, green and blue PyGMI Data.

Return type:

list of pygmi.raster.datatypes.Data.