pygmi.rsense.ratios#
Calculate remote sensing ratios and condition indices.
Classes#
GUI to calculate satellite ratios. |
|
GUI to calculate satellite condition indices. |
Functions#
|
Calculate Band ratios. |
|
Correct the band designations. |
|
Correct EMIT band names. |
|
Get ASTER files from a file list. |
|
Get EMIT files from a file list. |
|
Get Landsat files from a file list. |
|
Get Sentinel-2 files from a file list. |
|
Calculate TCI. |
|
Calculate VCI. |
|
Calculate VHI. |
|
Calculate Band ratios. |
Module Contents#
- class pygmi.rsense.ratios.SatRatios(parent=None)#
Bases:
pygmi.misc.BasicModuleGUI 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.BasicModuleGUI 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:
listofData
- 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:
listofstr
- pygmi.rsense.ratios.correct_EMIT_bands(rlist, dat)#
Correct EMIT band names.
- Parameters:
rlist (list[str]) – List of ratios.
dat (list[pygmi.raster.datatypes.Data]) – List of Data.
- Returns:
List of EMIT data bands.
- Return type:
listofData
- 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:
listofstr
- 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:
listofstr
- 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:
listofstr
- 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:
listofstr
- 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:
listofData
- pygmi.rsense.ratios.get_VCI(evi, index)#
Calculate VCI.
- Parameters:
evi (list[pygmi.raster.datatypes.Data]) – List of EVI datasets.
index (str) – Index for dataid.
- Returns:
Output VCI datasets.
- Return type:
listofData
- pygmi.rsense.ratios.get_VHI(tci, vci, alpha=0.5)#
Calculate VHI.
- Parameters:
tci (list[pygmi.raster.datatypes.Data]) – TCI dataset list.
vci (list[pygmi.raster.datatypes.Data]) – VCI dataset list.
alpha (float) – Weight for proportion of TCI and VCI. The default is 0.5.
- Returns:
Output VHI datasets.
- Return type:
listofData
- 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:
listofData