pygmi.raster.equation_editor#
Equation editor for raster data.
Classes#
Equation Editor. |
Functions#
|
Use equations on raster data. |
|
Corrects names in equation to variable names. |
|
Use a histogram to generate a fast mode estimate. |
|
Mosaics data into a single band dataset. |
|
Get mean pixel value of all input bands. |
|
Get mean pixel value of all input bands. |
|
Get standard deviation pixel value of all input bands. |
Module Contents#
- class pygmi.raster.equation_editor.EquationEditor(parent=None)#
Bases:
pygmi.misc.BasicModuleEquation Editor.
This class allows the input of equations using raster datasets as variables. This is commonly done in remote sensing applications, where there is a requirement for band ratioing etc. It uses the numexpr library.
- Parameters:
parent – Reference to the parent routine. The default is None.
- equation#
String with the equation in it
- Type:
str
- bands#
Dictionary of bands
- Type:
dictionary
- setupui()#
Set up UI.
- combo()#
Update combo information.
- 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.
- pygmi.raster.equation_editor.eqedit(data, equation, dtype='auto', showlog=print, piter=iter)#
Use equations on raster data.
- Parameters:
data (list[pygmi.raster.datatypes.Data]) – List of PyGMI raster data.
equation (str) – Equation to compute.
dtype (str) – The data type of the output dataset. The default is ‘auto’.
showlog (collections.abc.Callable[..., None]) – Show information using a function. The default is print.
piter (collections.abc.Iterable) – Progress bar iterable. The default is iter.
- Returns:
List of PyGMI raster data.
- Return type:
listofData
- pygmi.raster.equation_editor.eq_fix(indata, equation, showlog=print)#
Corrects names in equation to variable names.
- Parameters:
indata (list[pygmi.raster.datatypes.Data]) – PyGMI raster dataset.
equation (str) – Equation to fix.
showlog (collections.abc.Callable[..., None]) – Show information using a function. The default is print.
- Returns:
Corrected equation.
- Return type:
str
- pygmi.raster.equation_editor.hmode(data)#
Use a histogram to generate a fast mode estimate.
- Parameters:
list – List of values to generate the mode from.
data (list[float])
- Returns:
Mode value.
- Return type:
float
- pygmi.raster.equation_editor.mosaic(eq, localdict)#
Mosaics data into a single band dataset.
- Parameters:
eq (str) – Equation with mosaic command.
localdict (dict) – Dictionary of data.
- Returns:
Output array.
- Return type:
MaskedArray
- pygmi.raster.equation_editor.mean(eq, localdict)#
Get mean pixel value of all input bands.
- Parameters:
eq (str) – Equation with std command.
localdict (dict) – Dictionary of data.
- Returns:
Output array.
- Return type:
MaskedArray
- pygmi.raster.equation_editor.detrend(eq, localdict)#
Get mean pixel value of all input bands.
- Parameters:
eq (str) – Equation with std command.
localdict (dict) – Dictionary of data.
- Returns:
Output array.
- Return type:
MaskedArray
- pygmi.raster.equation_editor.std(eq, localdict)#
Get standard deviation pixel value of all input bands.
- Parameters:
eq (str) – Equation with std command.
localdict (dict) – Dictionary of data.
- Returns:
Output array.
- Return type:
MaskedArray