enpt_enmapboxapp package
Submodules
enpt_enmapboxapp._enpt_alg_base module
This module provides the base class for EnPTAlgorithm and ExternalEnPTAlgorithm.
- class enpt_enmapboxapp._enpt_alg_base._EnPTBaseAlgorithm[source]
Bases:
QgsProcessingAlgorithm
- P_CPUs = 'CPUs'
- P_OUTPUT_FOLDER = 'outfolder'
- P_OUTPUT_RASTER = 'outraster'
- P_auto_download_ecmwf = 'auto_download_ecmwf'
- P_average_elevation = 'average_elevation'
- P_blocksize = 'blocksize'
- P_deadpix_P_algorithm = 'deadpix_P_algorithm'
- P_deadpix_P_interp_spatial = 'deadpix_P_interp_spatial'
- P_deadpix_P_interp_spectral = 'deadpix_P_interp_spectral'
- P_disable_progress_bars = 'disable_progress_bars'
- P_drop_bad_bands = 'drop_bad_bands'
- P_enable_ac = 'enable_ac'
- P_enable_keystone_correction = 'enable_keystone_correction'
- P_enable_vnir_swir_coreg = 'enable_vnir_swir_coreg'
- P_json_config = 'json_config'
- P_mode_ac = 'mode_ac'
- P_n_lines_to_append = 'n_lines_to_append'
- P_ortho_resampAlg = 'ortho_resampAlg'
- P_output_dir = 'output_dir'
- P_output_format = 'output_format'
- P_output_interleave = 'output_interleave'
- P_output_nodata_value = 'output_nodata_value'
- P_path_dem = 'path_dem'
- P_path_earthSunDist = 'path_earthSunDist'
- P_path_l1b_enmap_image = 'path_l1b_enmap_image'
- P_path_l1b_enmap_image_gapfill = 'path_l1b_enmap_image_gapfill'
- P_path_reference_image = 'path_reference_image'
- P_path_solar_irr = 'path_solar_irr'
- P_polymer_additional_results = 'polymer_additional_results'
- P_polymer_root = 'polymer_root'
- P_run_deadpix_P = 'run_deadpix_P'
- P_run_smile_P = 'run_smile_P'
- P_scale_factor_boa_ref = 'scale_factor_boa_ref'
- P_scale_factor_toa_ref = 'scale_factor_toa_ref'
- P_target_epsg = 'target_epsg'
- P_target_projection_type = 'target_projection_type'
- P_threads = 'threads'
- P_vswir_overlap_algorithm = 'vswir_overlap_algorithm'
- P_working_dir = 'working_dir'
- static _run_cmd(cmd, qgis_feedback=None, **kwargs)[source]
Execute external command and get its stdout, exitcode and stderr.
Code based on: https://stackoverflow.com/a/31867499
- Parameters:
cmd – a normal shell command including parameters
- addParameter(param, *args, advanced=False, **kwargs)[source]
Add a parameter to the QgsProcessingAlgorithm.
This overrides the parent method to make it accept an ‘advanced’ parameter.
- Parameters:
param – the parameter to be added
args – arguments to be passed to the parent method
advanced – whether the parameter should be flagged as ‘advanced’
kwargs – keyword arguments to be passed to the parent method
- createInstance(self) QgsProcessingAlgorithm | None [source]
Creates a new instance of the algorithm class.
This method should return a ‘pristine’ instance of the algorithm class.
- displayName(self) str [source]
Returns the translated algorithm name, which should be used for any user-visible display of the algorithm name.
Algorithm display names should be short, e.g. ideally no more than 3 or 4 words. The name should use sentence case (e.g. “Raster layer statistics”, not “Raster Layer Statistics”).
See also
See also
shortDescription()
- group(self) str [source]
Returns the name of the group this algorithm belongs to. This string should be localised.
See also
See also
tags()
- groupId(self) str [source]
Returns the unique ID of the group this algorithm belongs to. This string should be fixed for the algorithm, and must not be localised. The group id should be unique within each provider. Group id should contain lowercase alphanumeric characters only and no spaces or other formatting characters.
See also
- helpString(self) str [source]
Returns a localised help string for the algorithm. Algorithm subclasses should implement either
helpString()
orhelpUrl()
.See also
See also
Deprecated since version Unused,: will be removed in QGIS 4.0
- static helpUrl(self) str [source]
Returns a url pointing to the algorithm’s help page.
See also
See also
- initAlgorithm(self, configuration: Dict[str, Any] = {})[source]
Initializes the algorithm using the specified
configuration
.This should be called directly after creating algorithms and before retrieving any
parameterDefinitions()
oroutputDefinitions()
.Subclasses should use their implementations to add all required input parameter and output definitions (which can be dynamically adjusted according to
configuration
).Dynamic configuration can be used by algorithms which alter their behavior when used inside processing models. For instance, a “feature router” type algorithm which sends input features to one of any number of outputs sinks based on some preconfigured filter parameters can use the init method to create these outputs based on the specified
configuration
.See also
See also
addOutput()
- name(self) str [source]
Returns the algorithm name, used for identifying the algorithm. This string should be fixed for the algorithm, and must not be localised. The name should be unique within each provider. Names should contain lowercase alphanumeric characters only and no spaces or other formatting characters.
See also
See also
See also
tags()
enpt_enmapboxapp.enpt_algorithm module
This module provides the EnPTAlgorithm which is used in case EnPT is installed into QGIS Python environment.
- class enpt_enmapboxapp.enpt_algorithm.EnPTAlgorithm[source]
Bases:
_EnPTBaseAlgorithm
- processAlgorithm(self, parameters: Dict[str, Any], context: QgsProcessingContext, feedback: QgsProcessingFeedback | None) Dict[str, Any] [source]
Runs the algorithm using the specified
parameters
. Algorithms should implement their custom processing logic here.The
context
argument gives a temporary context with thread affinity matching the thread in which the algorithm is being run. This is a cut-back copy of the context passed to theprepareAlgorithm()
andpostProcessAlgorithm()
steps, but it is generally safe for most algorithms to utilize this context for loading layers and creating sinks. Any loaded layers or sinks created within this temporary context will be transferred back to the main execution context upon successful completion of theprocessAlgorithm()
step.Algorithm progress should be reported using the supplied
feedback
object. Additionally, well-behaved algorithms should periodically checkfeedback
to determine whether the algorithm should be canceled and exited early.This method will not be called if the
prepareAlgorithm()
step failed (returnedFalse
).Implementations of processAlgorithm can throw the
QgsProcessingException
exception to indicate that a fatal error occurred within the execution.- Returns:
A map of algorithm outputs. These may be output layer references, or calculated values such as statistical calculations. Unless the algorithm subclass overrides the
postProcessAlgorithm()
step this returned map will be used as the output for the algorithm.
See also
prepareAlgorithm()
See also
postProcessAlgorithm()
enpt_enmapboxapp.enpt_enmapboxapp module
This module provides a QGIS EnMAPBox GUI for the EnMAP processing tools (EnPT).
- class enpt_enmapboxapp.enpt_enmapboxapp.EnPTEnMAPBoxApp(enmapBox, parent=None)[source]
Bases:
EnMAPBoxApplication
The EnPT GUI class.
Return a QMenu that will be added to the parent appMenu.
- Parameters:
appMenu –
- Returns:
QMenu
enpt_enmapboxapp.enpt_external_algorithm module
This module provides the ExternalEnPTAlgorithm which is used in case EnPT is installed into separate environment.
- class enpt_enmapboxapp.enpt_external_algorithm.ExternalEnPTAlgorithm[source]
Bases:
_EnPTBaseAlgorithm
- P_conda_root = 'conda_root'
- initAlgorithm(self, configuration: Dict[str, Any] = {})[source]
Initializes the algorithm using the specified
configuration
.This should be called directly after creating algorithms and before retrieving any
parameterDefinitions()
oroutputDefinitions()
.Subclasses should use their implementations to add all required input parameter and output definitions (which can be dynamically adjusted according to
configuration
).Dynamic configuration can be used by algorithms which alter their behavior when used inside processing models. For instance, a “feature router” type algorithm which sends input features to one of any number of outputs sinks based on some preconfigured filter parameters can use the init method to create these outputs based on the specified
configuration
.See also
addParameter()
See also
addOutput()
- processAlgorithm(self, parameters: Dict[str, Any], context: QgsProcessingContext, feedback: QgsProcessingFeedback | None) Dict[str, Any] [source]
Runs the algorithm using the specified
parameters
. Algorithms should implement their custom processing logic here.The
context
argument gives a temporary context with thread affinity matching the thread in which the algorithm is being run. This is a cut-back copy of the context passed to theprepareAlgorithm()
andpostProcessAlgorithm()
steps, but it is generally safe for most algorithms to utilize this context for loading layers and creating sinks. Any loaded layers or sinks created within this temporary context will be transferred back to the main execution context upon successful completion of theprocessAlgorithm()
step.Algorithm progress should be reported using the supplied
feedback
object. Additionally, well-behaved algorithms should periodically checkfeedback
to determine whether the algorithm should be canceled and exited early.This method will not be called if the
prepareAlgorithm()
step failed (returnedFalse
).Implementations of processAlgorithm can throw the
QgsProcessingException
exception to indicate that a fatal error occurred within the execution.- Returns:
A map of algorithm outputs. These may be output layer references, or calculated values such as statistical calculations. Unless the algorithm subclass overrides the
postProcessAlgorithm()
step this returned map will be used as the output for the algorithm.
See also
prepareAlgorithm()
See also
postProcessAlgorithm()
enpt_enmapboxapp.version module
Module contents
Top-level package for enpt_enmapboxapp.