EnMAP-Box 3 Documentation¶
The EnMAP-Box is a python plugin for QGIS, designed to process and visualise hyperspectral remote sensing data.
Get going with the Installation and the Getting Started chapter. Have a look at the Cookbook for usage examples!
Key features¶
- Extend your QGIS for remote sensing image analysis
- Add powerful tools to process and analyse imaging spectroscopy data
- Integrate machine learning algorithms into your image classification and regression with Random Forests, Support Vector Machines and many more
- Create and manage spectral libraries with attribute data
- Develop your own image processing algorithms using a powerful Python API

News¶
FOSSGIS 2023 Berlin¶
The EnMAP-Box will be present at the FOSSGIS with a demosession: Visualisierung und Analyse von Satellitenbildern mit der EnMAP-Box (https://pretalx.com/fossgis2023/talk/9WAMJ9/)
Looking forward meeting you there!
UPDATE - Here is the recording of the presentation:
EnMAP-Box Version 3.11 released¶
Oct. 10, 2022
A new EnMAP-Box version has been released. A list of all improvements can be found in the changelog.
EnMAP-Box Version 3.10 released¶
June 09, 2022
A new EnMAP-Box version has been released. A list of all improvements can be found in the changelog.
EnMAP-Box Version 3.9 released¶
Oct. 10, 2021
A new EnMAP-Box version has been released. A list of all improvements can be found in the changelog.
EnMAP-Box Workshop 2021¶
June 07, 2021
The next EnMAP-Box workshop will be held online on 21-23 June, 2021. The workshop aims to demonstrate the current state of the EnMAP-Box by way of presentations, live demos with Q&A and self-paced tutorials. Registration for up to 250 participants is now open at the workshop website.

FOSSGIS 2021¶
June 09, 2021
Benjamin Jakimow presented how to use Spectral Libraries in QGIS using the EnMAP-Box (german).
EnMAP-Box Version 3.7 released¶
Oct. 27, 2020
A new EnMAP-Box version has been released. It includes product readers for EnMAP L1B, L2C and L2A, PRISMA L2D and DESIS L2A images, and a first version of Spectral Math in the QGIS Expression Builder. A list of all improvements can be found in the changelog.
FOSSGIS 2020¶
Andreas Rabe presented the EnMAP-Box at the FOSSGIS 2020 in Freiburg. See the full live-demo session here (german):
QGIS User Conference 2019¶
Two Presentations by EnMAP-Box developers Andreas Rabe and Benjamin Jakimow at the QGIS User conference in Coruña
- Earth observation data processing in QGIS with a python API
- EO Time Series Viewer - A plugin to explore Earth Observation Time Series Data in QGIS
About¶
The EnMAP-Box is a free and open source plugin for QGIS. It is designed to process imaging spectroscopy data and particularly developed to handle data from the upcoming EnMAP sensor. The two main goals of the development are to provide (i) state-of-the-art applications for the processing of high dimensional spectral and temporal remote sensing data and (ii) a graphical user interface (GUI) that enhances the GIS oriented visualization capabilities in QGIS by applications for visualization and exploration of multi-band remote sensing data and spectral libraries. Therefore, the algorithms provided in the EnMAP-Box will be of high value for many other, especially multi- and hyperspectral EO missions.
The EnMAP-Box plugin bridges and combines efficiently all advantages of QGIS (e.g. for visualization, vector data processing), packages like GDAL (for data IO or working with virtual raster files) and abundant libraries for Python (e.g. scikit-learn for EO data classification and PyQtGraph for fast and interactive chart drawing). The plugin consists of a (i) graphical user interface for hyperspectral data visualization and e.g. spectral library management, (ii) a set of algorithms, and (iii) a high-level application programming interface (EnMAP API).
The EnMAP-Box is developed at Humboldt-Universität zu Berlin and Universität Greifswald under contract by the Helmholtz Centre Potsdam GFZ and is part of the EnMAP Core Science Team activities. It is funded by the German Aerospace Centre (DLR) - Project Management Agency, granted by the Federal Ministry of Economic Affairs and Energy (BMWi; grant no. 50EE1923).
![]() |
![]() |
FAQ & Troubleshooting¶
Bug report & feedback¶
Note
Your feedback is more than welcome! In case you encounter any problems with the EnMAP-Box or have suggestions of any kind for improving it (or this documentation), please let us know!
Please report issues here
For questions use GitHub Discussions
Contact¶
E-Mail: enmapbox@enmap.org
Newsletter: Subscribe to the EnMAP mailing list to be informed about new EnMAP-Box releases and other EnMAP related news. Click here for more information.
FAQ¶
This is a list of Frequently Asked Questions about the EnMAP-Box. Feel free to suggest new entries!
How to cite the EnMAP-Box?
Please cite the EnMAP-Box as:
EnMAP-Box Developers (2019): EnMAP-Box 3 - A QGIS Plugin to process and visualize hyperspectral remote sensing data. https://enmap-box.readthedocs.io/en/latest
BibTeX:
@misc{enmapbox2019, author = {EnMAP-Box Developers}, title = {EnMAP-Box 3 - A QGIS Plugin to process and visualize hyperspectral remote sensing data}, year = 2019, url = {https://enmap-box.readthedocs.io/en/latest} }
For the general idea behind the EnMAP-Box please refer to:
van der Linden, S., Rabe, A., Held, M., Jakimow, B., Leitão, P., Okujeni, A., Schwieder, M., Suess, S., Hostert, P., 2015. The EnMAP-Box—A Toolbox and Application Programming Interface for EnMAP Data Processing. Remote Sensing 7, 11249–11266. 10.3390/rs70911249.
How to install QGIS without administrative rights?
Installation: no module named pip
In case you run into problems during installation because pip is not available in your python environment (error message
C:/.../python3.exe: No module named pip
or similar), follow these steps (Windows):Start the OSGeo4W installer from the OSGeo4W Shell by calling
setup
which will open the OSGeo4W Setup dialog.
Now navigate through the first pages of the dialog, by selecting the following settings:
- Advanced Installation Next
- Installation from Internet Next
- default OSGeo4W root directory Next
- local temp directory Next
- direct connection Next
- Select downloadsite
https://download.osgeo.ogr
Next
Then use the textbox to filter, select and install the following packages (see video below for help):
- python3-pip
- python3-setuptools
Click on the
symbol once, which should usually change the Skip setting to installing the most recent version. Only AFTER having selected both packages, click Next.
Demonstration of package selection in the Setup
Click Finish when the installation is done.
Python package installation with requirements.txt does not work
Usually, all dependencies can be installed with one line:
python3 -m pip install -r https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/requirements.txt
If the method above did not work for some reason, try installing the packages listed in the
requirements.txt
line by line, e.g.python3 -m pip install numpy
and so on.
Installation: error ensomap / numba / TypeError jitdebug
EnSoMAP requires Numba, a JIT compiler that translates python code into fast machine code. Unfortunately, Numba is not part of a standard QGIS installation. Installing it afterwards can be tricky, in particular on the standard Windows and macOS QGIS installations. If you want to use EnSoMAP and numba, we therefore recommend to use a QGIS that was installed with Conda instead.
Install conda and create a conda environment with QGIS as described here.
Install Numba
(qgis_stable) $>conda install numba --channel=conda-forge
Start the conda QGIS by:
(qgis_stable) $>qgis
If not already done, install the EnMAP-Box to your Conda-QGIS with the QGIS Plugin Manager.
Image Cube tool missing qtopengl / Missing OpenGL / QtOpenGL packages
On some systems we experiences problems related to a missing OpenGL support (e.g Issue #299)
- Ensure that you have installed OpenGL drivers that support your graphic card
- Ensure that PyOpenGL is installed:: $ python3 -m pip install PyOpenGL
On Linux, it might be necessary to install the Python bindings for QtOpenGL in order to start the Image Cube tool.
sudo apt-get install python3-pyqt5.qtopengl
Error loading the plugin
In case of missing requirements you should see an error message like this
In that case please make sure you installed all missing packages, in this example
pyqtgraph
andsklearn
are missing.
Exception: Unable to find full path for “dockpanel.ui”. Make its directory known to UI_DIRECTORIES
It’s likely that an update of the EnMAP-Box plugin failed to remove a previous version properly. The following workaround might help:
- Navigate into the active QGIS profile folder. It can be opened via Settings > User Profiles > Open Active Profile Folder
- Close QGIS. This is necessary to avoid any file handles on files or folders of the EnMAP-Box plugin.
- Delete the EnMAP-Box plugin folder manually, e.g. default/python/plugins/enmapboxplugin if the active QGIS profile is ‘default’.
4. Restart QGIS and install the most-recent EnMAP-Box version This description was taken from https://bitbucket.org/hu-geomatics/enmap-box/issues/304/exception-unable-to-find-full-path-for
Known Issues¶
Here is a list of known issues, that aren’t fixed easily, and/or only affect a specific version of QGIS or operating system:
How to contribute¶
The EnMAP-Box is a freely available, platform-independent software designed to process hyperspectral remote sensing data, and particularly developed to handle data from the EnMAP sensor.
The EnMAP-Box source code is hosted in a public git repository at https://github.com/EnMAP-Box/enmap-box.
Approved QGIS plugin versions (“production releases”) are available in the QGIS Plugin Repository https://plugins.qgis.org/plugins/enmapboxplugin/.
The development of the EnMAP-Box is funded within the EnMAP scientific preparation program under the DLR Space Administration (mission lead) and GFZ Potsdam (scientific lead) with resources from the German Federal Ministry for Economic Affairs and Energy.
Everyone is welcome to contribute to the EnMAP-Box
Submit a bug report or feature request¶
In case you experience issues with the EnMAP-Box, do not hesitate to submit a ticket to our Issue Tracker. You are also welcome to post feature requests or pull requests.
It is recommended to check that your issue complies with the following rules before submitting:
Verify that your issue is not being currently addressed by other issues or pull requests.
If you are submitting a bug report, please:
- Report a short description how to reproduce it
- If an exception is raised, please provide the full traceback.
- If necessary, provide a link to the data that causes the bug
- If not feasible to include a reproducible snippet, please be specific about what part of the EnMAP-Box (functions, widget) are involved and the shape of the data
- Include your operating system type and version number of QGIS, Qt and the EnMAP-Box.
- Please ensure that code snippets and error messages are formatted in appropriate code blocks.
Note
You can use this Markdown syntax to style your issues.
Provide source code¶
If your are not an EnMAP-Box core developer, the preferred way to contribute your code code is to use pull requests.
- Fork the EnMAP-Box repository
- Clone your fork
- Modify the source code
- Commit your modifications
- Push your modification to your fork and
- Create a pull request
1. Create a fork on GitHub¶
Forking the EnMAP-box repository allows you to modify the EnMAP-Box code as you like and backup your contributions in a separated GitHub repository. To create a fork,
- log in to GitHub and visit https://github.com/EnMAP-Box/enmap-box
- Click ‘+’ and Fork this repository
- Select a name and workspace for your EnMAP-Box fork, hereafter called enmap-box-fork
Please read https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks for details how you can create your own fork of the EnMAP-Box repository.
2. Clone the forked EnMAP-Box repository¶
Follow these steps but replace the EnMAP-Box repository url with that of your fork. Clone enmap-box-fork to your local disk:
git clone --recurse-submodules git@github.com/myusername/enmap-box-fork.git
Go into the repository folder and force to checkout the develop branch.
cd enmap-box-fork
Add the EnMAP-Box repository as upstream repository:
git remote add upstream https://github.com/EnMAP-Box/enmap-box
Note
From now on, you can synchronize your fork with the EnMAP-Box repository by:
$git fetch upstream main
$git merge upstream/main
to get the latest updates from the main branch. Call:
$git push
to upload them to the remote github.com/myusername/enmap-box-fork.git
Now install python requirements and run the initial setup for the EnMAP-Box repository, as described in Installation
3. Modify the local repository¶
As you like, you can continue modifying the EnMAP-Box code in the develop branch or create a new one ‘my_modifications’:
$ git checkout -b my_modifications
4. Commit your changes¶
Save your changes by committing them to your local repository:
$ git add modified_files
$ git commit -a -m 'added x, modified y and fixed z' -s
Please use signed commits to label your individual contribution visible. Even better, use GnuPG-signed commits (-S).
5. Push changes back to your fork¶
A push will upload your changes to github.com/myusername/enmap-box-fork.git:
$ git push
6. Create a pull request¶
Open the GitHub webpage of your fork and create a pull request. The pull request will inform us on the changed you made.
Before you create a pull request, please check the following:
make sure that every source code file provides a licence notice
make sure your code passes the tests and provide tests if your like to provide new functionality, like EnMAP-Box Applications
make sure your code is commented and documented
make sure your name is listed in the
CONTRIBUTORS.md
update your feature branch to the current EnMAP-Box develop branch:
git fetch upstream develop git merge upstream/develop
rebase your changes and push them to your forked repository:
git push -f
describe your pull request with a helpful title, e.g using the following labels:
[feature] <title>
a new feature[fix] <title>
a fix for a known issue. If possible, please refer to existing issue numbers like in #123 #124.
Documentation¶
The EnMAP-Box documentation is based on Sphinx-build reStructured text and hosted at https://enmap-box.readthedocs.io/en/latest .
The documentation source code, i.e. *.rst files, are hosted in the /source
folder in
https://github.com/EnMAP-Box/enmap-box-documentation
Please read https://github.com/EnMAP-Box/enmap-box-documentation#readme for how you can contribute to the EnMAP-Box documentation repository and the Style Guide for a more detailed overview of the general styling.
Licensing¶
The software produced for the EnMAP-Box is licensed according to the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License (SPDX short identifier: GPL-3.0), or (if desired) any later version. See either https://www.gnu.org/licenses/gpl-3.0.en.html or https://opensource.org/licenses/GPL-3.0 for further details of the license.
A copy of this license is part of the EnMAP-Box repository (LICENSE.txt) and delivered with each release of an EnMAP-Box plugin.
The EnMAP-Box documentation is published under the terms of the Creative Commons 1.0 Universal (CC0) License. See https://creativecommons.org/publicdomain/zero/1.0/legalcode for further details of the license.
Applying License Terms¶
Each source code contribution to the central repository should include a reference to the GPL-3 license terms at the beginning of the file:
"""
***************************************************************************
<file name> - <short description>
-----------------------------------------------------------------------
begin : <month and year of creation>
copyright : (C) <year> <creator>
email : <main address>
***************************************************************************
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
*
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this software. If not, see <https://www.gnu.org/licenses/>.
***************************************************************************
"""
An example from the source code can be found here: enmapbox/__init__.py
Images and other multimedia content from the EnMAP-Box documentation, i.e files within the EnMAP-Box repositories doc/source
folder,
are published under the terms of the CC0 license.
Contributor License Agreements (CLA)¶
The purpose of CLAs are to clearly define the terms under which intellectual property has been contributed to the EnMap-Box and thereby allow us to defend the project should there be a legal dispute regarding the software at some future time.
The EnMap-Box Consortium desires that all maintainers and contributors of ideas, code, or documentation to the EnMAP-Box project complete, sign, and submit an ICLA.
A signed ICLA is required to be on file before an individual is given commit rights to the EnMap-Box repository. The ICLA form for filling and signing is available here.
The ICLA is not tied to any employer, so it is recommended to use one’s personal information, e.g. for email address in the contact details, rather than an email address provided by an employer.
For a corporation that has assigned employees to work on the EnMap-Box, a CCLA is available for contributing intellectual property via the corporation, that may have been assigned as part of an employment agreement.
Note that a CCLA does not remove the need for every developer to sign their own ICLA as an individual, which covers both contributions which are owned and those that are not owned by the corporation signing the CCLA.
The CCLA legally binds the corporation, so it must be signed by a person with authority to enter into legal contracts on behalf of the corporation. The CCLA form for filling and signing is available here.
Documents may be submitted by email and signed by hand or by electronic signature. The files should be named icla.pdf and icla.pdf.asc for individual agreements; ccla.pdf and ccla.pdf.asc for corporate agreements. Zip files, other archives, or links to files are not accepted. The files must be attached to the mail.
When submitting by email, please fill the form with a pdf viewer, then print, sign, scan all pages into a single pdf file, and attach the pdf file to an email to enmapbox@enmap.org. If possible, send the attachment from the email address in the document. Please send only one document per email.
If you prefer to sign electronically, please fill the form, save it locally (e.g. icla.pdf), and sign the file by preparing a detached PGP signature. For example, gpg –armor –detach-sign icla.pdf
The above will create a file icla.pdf.asc. Send both the file (icla.pdf) and signature (icla.pdf.asc) as attachments in the same email. Please send only one document (file plus signature) per email. Please do not submit your public key. Instead, please upload your public key to pgpkeys.mit.edu.
Contributors who have not signed an ICLA are in a somewhat fuzzy spot. If they make a large contribution, or many contributions, then the EnMap-Box maintainers will likely ask to submit an ICLA. However, for small fixes, infrequent and other minimal or sporadic contributions the terms for licensing and intellectual property still must be clarified.
For this purpose, barriers for contributing are minimized and contributors pinky swear that they’re submitting their own work or rather certify that they adhere to the requirements of the DCO defined in version 1.1 or later at https://developercertificate.org/ by signing-off their pull requests or similar ways of contributing.
The DCO is very Git-centric, and it only relies on commit metadata.
Indeed, signing-off a commit is just about appending a Signed-off-by. For example a commit like:
$ git commit -m 'Fixes issue XYZ' -s
will create a commit message as in:
commit b2c150d3aa82f6583b9aadfecc5f8fa1c74aca09
Fixes issue XYZ
Signed-off-by: Erwin Gerwin <erwin.gerwin@streetcat.com>
Even this approach introduces a low barrier for contributions, it is very easy to use whatever email address you want for a commit, and the sign-off is just text. Since the issue of trust is important the use of GnuPG signatures in Git commits is recommended additionally, e.g. with:
$ git commit -s -S (makes GnuPG-signed commits, and)
$ git log --show-signature (shows GnuPG signatures in the log history)
$ git merge --verify-signatures branch (ensures that all commits are signed and valid before performing a merge)
Having to use GnuPG for all commits can be a bit daunting.
Tests and Continuous Integration¶
Please provide some tests that show if your source code works right.
Unit tests should be located in the repositories enmapboxtesting
folder.
To run all tests call:
$ set CI=True
$ python -m nose2 -s enmapboxtesting
Note
The environmental variable CI=True is used to inform test routines to not enter the GUI thread. If unset, some widgets might pop-up and wait for your input to terminate.
To run the unit tests in test_mytests.py, call:
$ python -m nose2 -s enmapboxtesting test_mytests
Roadmap¶
The development of the EnMAP-Box is based on the following schedule. Note that from EnMAP-Box v3.12+, we optimize releases for the currently supported QGIS Long Term Release (LTR), while also ensuring compatibility to the currently supported QGIS Latest Release (LR).
Version | Minimum QGIS version | Date |
---|---|---|
EnMAP-Box 3.8 | QGIS 3.16 | End March 2021 |
EnMAP-Box 3.9 | QGIS 3.18 | End September 2021 |
EnMAP-Box 3.10 | QGIS 3.24 | End Mar 2022 |
EnMAP-Box 3.11 | QGIS 3.24 | End September 2022 |
EnMAP-Box 3.12 | QGIS 3.28 LTR | End Mar 2023 |
EnMAP-Box 3.13 | QGIS 3.28 LTR | End September 2023 |
EnMAP-Box 3.14 | QGIS 3.34 LTR | End Mar 2024 |
EnMAP-Box 3.15 | QGIS 3.34 LTR | End September 2024 |
Release versions: https://plugins.qgis.org/plugins/enmapboxplugin/
Changelog: https://github.com/EnMAP-Box/enmap-box/blob/main/CHANGELOG.md
Pre-Release versions: https://github.com/EnMAP-Box/enmap-box/releases
Glossary¶
This glossary gives an overview of how specific terms are used inside the EnMAP-Box.
All the terms that relate to GIS in general should be consistent with the terms given by the QGIS user manual and GUI. Because the EnMAP-Box integrates into the QGIS GUI, we try to not (as far as possible) contradict or redefine terminology.
All terms that relate to machine learning should be consistent with the definitions given by Scikit-Learn and the Scikit-Learn glossary, because we wildly crosslink into the Scikit-Learn docs!
GIS and Remote Sensing¶
- attribute
- A synonym for field.
- attribute table
- A tabulated data table associated with a vector layer. Table columns and rows are referred to as fields and geographic features respectively.
- attribute value
- Refers to a single cell value inside the attribute table of a vector layer.
- band
- A raster layer is composed of one or multiple bands.
- categorized layer
A categorized vector layer or categorized raster layer.
- categorized raster layer
A raster layer styled with a Paletted/Unique values renderer. The renderer defines the band with category values and a list of named and colored categories. Styles are usually stored as QML sidecar files. Category values don’t have to be strictly consecutive.
- categorized vector layer
A vector layer styled with a Categorized renderer. The renderer defines the field storing the category values (numbers or strings; expressions not yet supported) and a list of named and colored categories. Styles are usually stored as QML sidecar files. Note that in case of numerical category values, the values don’t have to be strictly consecutive.
- categorized spectral library
A spectral library that is also a categorized vector layer.
- category
- categories
- A category has a value, a name and a color.
- class
- Synonym for category.
- classification layer
A categorized raster layer that is assumed to represent a mapping of a contiguous area.
Note that there is currently no equivalent term for a contiguous vector polygon layer. We may introduce it in the future as needed. For now we expect users to rasterize such a vector layer into a raster layer.
- class probability layer
- A multi-band raster layer, where the bands represent class probabilities (values between 0 and 1) for a set of categories.
- class fraction layer
- A multi-band raster layer, where the bands represent class cover fractions (values between 0 and 1) for a set of categories.
- color
- An rgb-color, hex-color or int-color specified by a red, green and blue component. Learn more here: https://htmlcolorcodes.com/
- continuous-valued raster layer
A raster layer, where each band represents a continuous-valued variable.
Variable names are given by the raster band names. Variable colors are given by the PAMRasterBand/Metadata “color” item (optional).
- continuous-valued vector layer
A vector layer styled with a Graduated or a Diagrams renderer. Styles are usually stored as QML sidecar files.
A Graduated renderer specifies a single field used as continuous-valued variable. Variable name is given by the field name and color is given by the symbol color.
TODO: screenshot for graduated renderer (see issue #1038)
A Diagrams renderer specifies multiple fields used as continuous-valued variables. Variable names and colors is given by assigned attribute names and colors.
TODO: screenshot for diagrams renderer (see issue #1038)
- continuous-valued layer
A continuous-valued vector layer or continuous-valued raster layer.
TODO: update screenshot (see issue #1038)
- continuous-valued spectral library
A spectral library that is also a continuous-valued vector layer.
TODO: update screenshot (see issues #1036 and #1038)
- continuous-valued variable
- A continuous-valued variable has a name and (optional) a color.
- field
Refers to a single column inside the attribute table of a vector layer.
A synonym for attribute.
- geographic feature
Refers to a single row inside the attribute table of a vector layer. In a vector layer, a geographic feature is a logical element defined by a point, polyline or polygon.
Note that in the context of GIS, the epithet “geographic” in “geographic feature” is usually skipped. In the context of EnMAP-Box, and machine learning in general, the term “feature” is used differently.
See feature for details.
- grid
- A raster layer defining the spatial extent, coordinate reference system and the pixel size.
- hex-color
- A color specified by a 6-digit hex-color string, where each color component is represented by a two digit hexadecimal number, e.g. red #FF0000, green #00FF00, blue #0000FF, black #000000, white #FFFFFF and grey #808080.
- int-color
- A color specified by a single integer between 0 and 256^3 - 1, which can also be represented as a hex-color.
- labeled layer
- A categorized layer or a continuous-valued layer.
- layer
- A vector layer or a raster layer.
- layer style
- The style of a layer can be defined in the Layer Styling panel and the Styling tab of the Layer Properties dialog. Some applications and algorithms take advantage of style information, e.g. for extracting category names and colors.
- mask layer
A mask raster layer or mask vector layer.
- mask raster layer
A raster layer interpreted as a binary mask. All no data (zero, if missing), inf and nan pixel evaluate to false, all other to true. Note that only the first band used by the renderer is considered.
- mask vector layer
A vector layer interpreted as a binary mask. Areas covered by a geometry evaluate to true, all other to false.
- pickle file
A binary file ending on .pkl that contains a pickled Python object, usually a dictionary or list container. Pickle file content can be browsed via the EnMAP-Box Data Sources panel:
- pixel profile
List of band values for a single pixel in a raster layer.
- point layer
A vector layer with point geometries.
- polygon layer
A vector layer with polygon geometries.
- ployline layer
- A vector layer with line geometries.
- raster layer
Any raster file that can be opened in QGIS as QgsRasterLayer. Elsewhere known as an image.
- regression layer
A continuous-valued raster layer that is assumed to represent a mapping of a contiguous area.
- rgb-color
- A color specified by a triplet of byte values (values between 0 and 255) representing the red, green and blue color components, e.g. red (255, 0, 0), green (0, 255, 0), blue (0, 0, 255), black (0, 0, 0), white (255, 255, 255) and grey (128, 128, 128).
- RGB image
- A 3-band byte raster layer with values ranging from 0 to 255.
- spectral band
- A band inside a spectral raster layer. A spectral band represents a measurement for a region of the electromagnetic spectrum around a specific center wavelength. The region is typically described by a spectral response function.
- spectral library
A vector layer with at least one text, JSON or binary field that is designated to a Spectral Profiles editor. Such Spectral Profile fields can contain profile data. Additional metadata can be stored like in any other vector layer, e.g. in text and numeric fields.
Using a vector layer with multiple Spectral Profile fields, it possible to link different profiles to the same geographic feature, e.g. a white reference profile to a field spectrometer profile relating to the same spatial position.
A single profile is represented by a dictionary of the following values:
- y: list of y values, required (e.g. surface reflectance)
- x: list of x values, optional (e.g. wavelength)
- xUnit: x value units, optional (e.g. nanometers)
- yUnit: y value units, optional (e.g. ???)
- bbl: optional list of bad band multiplier values
Depending on the selected data type of the spectral profile field, the dictionary is stored as plain JSON text or binarized JSON object.
See enmapbox.qgispluginsupport.qps.speclib.core.SpectralLibraryUtils for details.
- spectral profile
A pixel profile in a spectral raster layer or a profile in a spectral library.
- spectral raster layer
A raster layer with proper wavelength and wavelength units metadata, where the individual bands (i.e. spectral bands) represent measurements across the electromagnetic spectrum. The measurement vector of a single pixel is called a spectral profile)
- spectral response function
- The spectral response describes the sensitivity of a sensor to optical radiation of different wavelengths. In hyperspectral remote sensing, the spectral response function is often described by a single full-width-at-half-maximum value.
- spectral response function library
A spectral library, where each profile represents the spectral response function of a spectral band.
- stratification layer
A classification layer that is used to stratify an area into distinct subareas.
- stratum
- strata
- A category of a classifcation layer that is used as a stratification layer. Conceptually, a stratum can be seen as a binary mask with all pixels inside the stratum evaluating to True and all other pixels evaluating to False.
- table
A vector layer with (potentially) missing geometry.
Note that in case of missing geometry, the vector layer icon looks like a table and layer styling is disabled.
- vector feature
- Synonym for geographic feature.
- vector layer
Any vector file that can be opened in QGIS as QgsVectorLayer.
Raster Metadata¶
- Introduction
Raster metadata management is mainly based on the GDAL PAM (Persistent Auxiliary Metadata) model. Depending on the type of metadata, managing specific metadata item in the GUI or programmatically can differ. Details are explained in the specific term descriptions below.
In the GUI, most of the metadata items can be inspected in the Layer Properties dialog, under GDAL Metadata.
Alternatively, metadata can be managed inside a standard text editor, by opening the GDAL PAM *.aux.xml sidecar file. If the PAM file not already exists, you can create it manually, but usually, it is also created, when a raster file is opened inside QGIS. Here is an excerpt of the
enmap_berlin.bsq.aux.xml
PAM file:<PAMDataset> <Metadata domain="ENVI"> <MDI key="band_names">{band 8, band 9, band 10, band 11, band 12, band 13, band 14, band 15, band 16, band 17, band 18, band 19, band 20, band 21, band 22, band 23, band 24, band 25, band 26, band 27, band 28, band 29, band 30, band 31, band 32, band 33, band 34, band 35, band 36, band 37, band 38, band 39, band 40, band 41, band 42, band 43, band 44, band 45, band 46, band 47, band 48, band 49, band 50, band 51, band 52, band 53, band 54, band 55, band 56, band 57, band 58, band 59, band 60, band 61, band 62, band 63, band 64, band 65, band 66, band 67, band 68, band 69, band 70, band 71, band 72, band 73, band 74, band 75, band 76, band 77, band 91, band 92, band 93, band 94, band 95, band 96, band 97, band 98, band 99, band 100, band 101, band 102, band 103, band 104, band 105, band 106, band 107, band 108, band 109, band 110, band 111, band 112, band 113, band 114, band 115, band 116, band 117, band 118, band 119, band 120, band 121, band 122, band 123, band 124, band 125, band 126, band 127, band 144, band 145, band 146, band 147, band 148, band 149, band 150, band 151, band 152, band 153, band 154, band 155, band 156, band 157, band 158, band 159, band 160, band 161, band 162, band 163, band 164, band 165, band 166, band 167, band 168, band 195, band 196, band 197, band 198, band 199, band 200, band 201, band 202, band 203, band 204, band 205, band 206, band 207, band 208, band 209, band 210, band 211, band 212, band 213, band 214, band 215, band 216, band 217, band 218, band 219, band 220, band 221, band 222, band 223, band 224, band 225, band 226, band 227, band 228, band 229, band 230, band 231, band 232, band 233, band 234, band 235, band 236, band 237, band 238, band 239}</MDI> <MDI key="fwhm">{ 0.005800, 0.005800, 0.005800, 0.005800, 0.005800, 0.005800, 0.005800, 0.005800, 0.005800, 0.005800, 0.005900, 0.005900, 0.006000, 0.006000, 0.006100, 0.006100, 0.006200, 0.006200, 0.006300, 0.006400, 0.006400, 0.006500, 0.006600, 0.006600, 0.006700, 0.006800, 0.006900, 0.006900, 0.007000, 0.007100, 0.007200, 0.007300, 0.007300, 0.007400, 0.007500, 0.007600, 0.007700, 0.007800, 0.007900, 0.007900, 0.008000, 0.008100, 0.008200, 0.008300, 0.008400, 0.008400, 0.008500, 0.008600, 0.008700, 0.008700, 0.008800, 0.008900, 0.008900, 0.009000, 0.009100, 0.009100, 0.009200, 0.009300, 0.009300, 0.009400, 0.009400, 0.009500, 0.009500, 0.009600, 0.009600, 0.009600, 0.009600, 0.009700, 0.009700, 0.009700, 0.011800, 0.011900, 0.012100, 0.012200, 0.012400, 0.012500, 0.012700, 0.012800, 0.012900, 0.013100, 0.013200, 0.013300, 0.013400, 0.013500, 0.013600, 0.013700, 0.013800, 0.013900, 0.014000, 0.014000, 0.014100, 0.014100, 0.014200, 0.014200, 0.014300, 0.014300, 0.014300, 0.014400, 0.014400, 0.014400, 0.014400, 0.014400, 0.014400, 0.014400, 0.014400, 0.014400, 0.014400, 0.013700, 0.013600, 0.013600, 0.013500, 0.013500, 0.013400, 0.013400, 0.013300, 0.013200, 0.013200, 0.013100, 0.013100, 0.013000, 0.012900, 0.012900, 0.012800, 0.012800, 0.012700, 0.012700, 0.012600, 0.012500, 0.012500, 0.012400, 0.012400, 0.012300, 0.010900, 0.010800, 0.010800, 0.010700, 0.010700, 0.010600, 0.010600, 0.010500, 0.010500, 0.010400, 0.010400, 0.010400, 0.010300, 0.010300, 0.010200, 0.010200, 0.010100, 0.010100, 0.010100, 0.010000, 0.010000, 0.009900, 0.009900, 0.009900, 0.009800, 0.009800, 0.009700, 0.009700, 0.009700, 0.009600, 0.009600, 0.009600, 0.009500, 0.009500, 0.009400, 0.009400, 0.009400, 0.009300, 0.009300, 0.009300, 0.009200, 0.009200, 0.009100, 0.009100, 0.009100}</MDI> <MDI key="wavelength">{ 0.460000, 0.465000, 0.470000, 0.475000, 0.479000, 0.484000, 0.489000, 0.494000, 0.499000, 0.503000, 0.508000, 0.513000, 0.518000, 0.523000, 0.528000, 0.533000, 0.538000, 0.543000, 0.549000, 0.554000, 0.559000, 0.565000, 0.570000, 0.575000, 0.581000, 0.587000, 0.592000, 0.598000, 0.604000, 0.610000, 0.616000, 0.622000, 0.628000, 0.634000, 0.640000, 0.646000, 0.653000, 0.659000, 0.665000, 0.672000, 0.679000, 0.685000, 0.692000, 0.699000, 0.706000, 0.713000, 0.720000, 0.727000, 0.734000, 0.741000, 0.749000, 0.756000, 0.763000, 0.771000, 0.778000, 0.786000, 0.793000, 0.801000, 0.809000, 0.817000, 0.824000, 0.832000, 0.840000, 0.848000, 0.856000, 0.864000, 0.872000, 0.880000, 0.888000, 0.896000, 0.915000, 0.924000, 0.934000, 0.944000, 0.955000, 0.965000, 0.975000, 0.986000, 0.997000, 1.007000, 1.018000, 1.029000, 1.040000, 1.051000, 1.063000, 1.074000, 1.086000, 1.097000, 1.109000, 1.120000, 1.132000, 1.144000, 1.155000, 1.167000, 1.179000, 1.191000, 1.203000, 1.215000, 1.227000, 1.239000, 1.251000, 1.263000, 1.275000, 1.287000, 1.299000, 1.311000, 1.323000, 1.522000, 1.534000, 1.545000, 1.557000, 1.568000, 1.579000, 1.590000, 1.601000, 1.612000, 1.624000, 1.634000, 1.645000, 1.656000, 1.667000, 1.678000, 1.689000, 1.699000, 1.710000, 1.721000, 1.731000, 1.742000, 1.752000, 1.763000, 1.773000, 1.783000, 2.044000, 2.053000, 2.062000, 2.071000, 2.080000, 2.089000, 2.098000, 2.107000, 2.115000, 2.124000, 2.133000, 2.141000, 2.150000, 2.159000, 2.167000, 2.176000, 2.184000, 2.193000, 2.201000, 2.210000, 2.218000, 2.226000, 2.234000, 2.243000, 2.251000, 2.259000, 2.267000, 2.275000, 2.283000, 2.292000, 2.300000, 2.308000, 2.315000, 2.323000, 2.331000, 2.339000, 2.347000, 2.355000, 2.363000, 2.370000, 2.378000, 2.386000, 2.393000, 2.401000, 2.409000}</MDI> <MDI key="wavelength_units">Micrometers</MDI> ... </Metadata> <PAMRasterBand band="1"> <Description>band 8 (0.460000 Micrometers)</Description> <NoDataValue>-9.90000000000000E+01</NoDataValue> <Metadata> <MDI key="wavelength">0.460000</MDI> <MDI key="wavelength_units">Micrometers</MDI> </Metadata> </PAMRasterBand> <PAMRasterBand band="1"> ... </PAMRasterBand> ... </PAMDataset>
For managing metadata programmatically, you can mostly use the GDAL API classes
gdal.Datset
andgdal.Band
, or the EnMAP-Box API classesenmapboxprocessing.rasterreader.RasterReader
andenmapboxprocessing.rasterreader.RasterWriter
.Warning
If you want to edit metadata in an editor or programmatically, be sure to first close the associated raster layer inside QGIS. Otherwise, QGIS will overwrite your changes again.
To examplify the API usage, we assume the following namespace setup throughout the rest of this section:
from osgeo import gdal from enmapboxprocessing.rasterreader import RasterReader from enmapboxprocessing.rasterwriter import RasterWriter from enmapbox.exampledata import enmap # use enmap_berlin.bsq raster layer as example dataset dataset: gdal.Dataset = gdal.Open(enmap) raster = RasterReader(enmap) # assume we have a newly created gdal.Dataset object in update mode newDataset: gdal.Dataset newRaster = RasterWriter(newDataset) # for band-wise interactions, we just use the first band bandNo = 1
- bad band
- bad band list
- bad band multiplier
- bbl
- bad band list
The bad band multiplier value is indicating whether a band is usable (1) or not (0).
This information is derived from PAM/Band/Default/bbl. If that is undefined, it is derived by indexing the ENVI bad bands list from PAM/Dataset/ENVI/bbl. If that is also undefined, it is assumed, that the band is usable (i.e. value=1):
# get >>>dataset.GetRasterBand(bandNo).GetMetadataItem('bbl') # isn't sufficient in this case >>>dataset.GetMetadataItem('bbl', 'ENVI') # also not sufficient >>>raster.badBandMultiplier(bandNo) # this will correctly resolve the bad band multiplier None None 1 # set >>>newDataset.GetRasterBand(bandNo).SetMetadataItem('bbl', '1') # set for single band >>>newDataset.SetMetadataItem('bbl', '{1, ...., 1}', 'ENVI') # set for all bands at once >>>newRaster.setBadBandMultiplier(1, bandNo) # set for single band
- band description
- band name
The name of a band.
Usage example:
# get >>>dataset.GetRasterBand(bandNo).GetDescription() >>>raster.bandName(bandNo) band 8 (0.460000 Micrometers) band 8 (0.460000 Micrometers) # set >>>newDataset.GetRasterBand(bandNo).SetDescription('my band name') >>>newRaster.setBandName('my band name', bandNo)
- center wavelength
- A synonym for wavelength.
- fwhm
- full-width-at-half-maximum
The full-width-half-maximum (FWHM) value of a spectral band is approximating the spectral response function as a normal distribution with a sigma = FWHM / 2.355. Units should be the same as those used for wavelength and set in the wavelength units item.
This information is derived from PAM/Band/Default/fwhm. If that is undefined, it is derived by indexing the ENVI fwhm list from PAM/Dataset/ENVI/fwhm:
# get >>>dataset.GetRasterBand(bandNo).GetMetadataItem('fwhm') # isn't sufficient in this case >>>text = dataset.GetMetadataItem('fwhm', 'ENVI') # this gives just a string with values for all bands >>>text >>>float(text.strip('{}').split(',')[bandNo - 1]) # extra processing required to unpack the band FWHM >>>raster.badBandMultiplier(bandNo) # in Nanometers (the default) >>>raster.badBandMultiplier(bandNo, 'Micrometers') # in user-defined units None { 0.005800, 0.005800, 0.005800, 0.005800, 0.005800, 0.005800, 0.005800, 0.005800, 0.005800, 0.005800, 0.005900, 0.005900, 0.006000, 0.006000, 0.006100, 0.006100, 0.006200, 0.006200, 0.006300, 0.006400, 0.006400, 0.006500, 0.006600, 0.006600, 0.006700, 0.006800, 0.006900, 0.006900, 0.007000, 0.007100, 0.007200, 0.007300, 0.007300, 0.007400, 0.007500, 0.007600, 0.007700, 0.007800, 0.007900, 0.007900, 0.008000, 0.008100, 0.008200, 0.008300, 0.008400, 0.008400, 0.008500, 0.008600, 0.008700, 0.008700, 0.008800, 0.008900, 0.008900, 0.009000, 0.009100, 0.009100, 0.009200, 0.009300, 0.009300, 0.009400, 0.009400, 0.009500, 0.009500, 0.009600, 0.009600, 0.009600, 0.009600, 0.009700, 0.009700, 0.009700, 0.011800, 0.011900, 0.012100, 0.012200, 0.012400, 0.012500, 0.012700, 0.012800, 0.012900, 0.013100, 0.013200, 0.013300, 0.013400, 0.013500, 0.013600, 0.013700, 0.013800, 0.013900, 0.014000, 0.014000, 0.014100, 0.014100, 0.014200, 0.014200, 0.014300, 0.014300, 0.014300, 0.014400, 0.014400, 0.014400, 0.014400, 0.014400, 0.014400, 0.014400, 0.014400, 0.014400, 0.014400, 0.013700, 0.013600, 0.013600, 0.013500, 0.013500, 0.013400, 0.013400, 0.013300, 0.013200, 0.013200, 0.013100, 0.013100, 0.013000, 0.012900, 0.012900, 0.012800, 0.012800, 0.012700, 0.012700, 0.012600, 0.012500, 0.012500, 0.012400, 0.012400, 0.012300, 0.010900, 0.010800, 0.010800, 0.010700, 0.010700, 0.010600, 0.010600, 0.010500, 0.010500, 0.010400, 0.010400, 0.010400, 0.010300, 0.010300, 0.010200, 0.010200, 0.010100, 0.010100, 0.010100, 0.010000, 0.010000, 0.009900, 0.009900, 0.009900, 0.009800, 0.009800, 0.009700, 0.009700, 0.009700, 0.009600, 0.009600, 0.009600, 0.009500, 0.009500, 0.009400, 0.009400, 0.009400, 0.009300, 0.009300, 0.009300, 0.009200, 0.009200, 0.009100, 0.009100, 0.009100} 0.0058 5.8 0.0058 # set >>>newDataset.GetRasterBand(bandNo).SetMetadataItem('fwhm', '0.0058') # set FWHM for single band >>>newDataset.GetRasterBand(bandNo).SetMetadataItem('wavelength_units', 'Micrometers') # also set the units >>>newDataset.SetMetadataItem('fwhm', '{0.0058, ..., 0.0091}', 'ENVI') # set FWHM for all bands at once >>>newDataset.SetMetadataItem('wavelength_units', 'Micrometers', 'ENVI') # also set the units >>>newRaster.setFwhm(5.8, bandNo) # set single band FWHM in Nanometers >>>newRaster.setFwhm(0.0058, bandNo, 'Micrometers') # set single band FWHM in user-defined units
- no data value
The no data value of a band.
Usage example:
# get >>>dataset.GetRasterBand(bandNo).GetNoDataValue() >>>raster.noDataValue(bandNo) >>>raster.noDataValue() # if bandNo is skipped, it defaults to the first band -99.0 -99.0 -99.0 # set newDataset.GetRasterBand(bandNo).SetNoDataValue(-9999) newRaster.setNoDataValue(-9999, bandNo) newRaster.setNoDataValue(-9999) # if bandNo is skipped, the no data value is applied to all bands
- wavelength
The center wavelength value of a band. Units should be the same as those used for the fwhm and set in the wavelength units item.
This information is derived from PAM/Band/Default/wavelength. If that is undefined, it is derived by indexing the ENVI wavelength list from PAM/Dataset/ENVI/wavelength:
# get >>>dataset.GetRasterBand(bandNo).GetMetadataItem('wavelength') # this works, because the GDAL ENVI driver assigns those on-the-fly >>>text = dataset.GetMetadataItem('fwhm', 'ENVI') # this gives just a string with values for all bands >>>text >>>float(text.strip('{}').split(',')[bandNo - 1]) # extra processing required to unpack the band wavelength >>>raster.wavelength(bandNo) # in Nanometers (the default) >>>raster.wavelength(bandNo, 'Micrometers') # in user-defined units 0.460000 { 0.460000, 0.465000, 0.470000, 0.475000, 0.479000, 0.484000, 0.489000, 0.494000, 0.499000, 0.503000, 0.508000, 0.513000, 0.518000, 0.523000, 0.528000, 0.533000, 0.538000, 0.543000, 0.549000, 0.554000, 0.559000, 0.565000, 0.570000, 0.575000, 0.581000, 0.587000, 0.592000, 0.598000, 0.604000, 0.610000, 0.616000, 0.622000, 0.628000, 0.634000, 0.640000, 0.646000, 0.653000, 0.659000, 0.665000, 0.672000, 0.679000, 0.685000, 0.692000, 0.699000, 0.706000, 0.713000, 0.720000, 0.727000, 0.734000, 0.741000, 0.749000, 0.756000, 0.763000, 0.771000, 0.778000, 0.786000, 0.793000, 0.801000, 0.809000, 0.817000, 0.824000, 0.832000, 0.840000, 0.848000, 0.856000, 0.864000, 0.872000, 0.880000, 0.888000, 0.896000, 0.915000, 0.924000, 0.934000, 0.944000, 0.955000, 0.965000, 0.975000, 0.986000, 0.997000, 1.007000, 1.018000, 1.029000, 1.040000, 1.051000, 1.063000, 1.074000, 1.086000, 1.097000, 1.109000, 1.120000, 1.132000, 1.144000, 1.155000, 1.167000, 1.179000, 1.191000, 1.203000, 1.215000, 1.227000, 1.239000, 1.251000, 1.263000, 1.275000, 1.287000, 1.299000, 1.311000, 1.323000, 1.522000, 1.534000, 1.545000, 1.557000, 1.568000, 1.579000, 1.590000, 1.601000, 1.612000, 1.624000, 1.634000, 1.645000, 1.656000, 1.667000, 1.678000, 1.689000, 1.699000, 1.710000, 1.721000, 1.731000, 1.742000, 1.752000, 1.763000, 1.773000, 1.783000, 2.044000, 2.053000, 2.062000, 2.071000, 2.080000, 2.089000, 2.098000, 2.107000, 2.115000, 2.124000, 2.133000, 2.141000, 2.150000, 2.159000, 2.167000, 2.176000, 2.184000, 2.193000, 2.201000, 2.210000, 2.218000, 2.226000, 2.234000, 2.243000, 2.251000, 2.259000, 2.267000, 2.275000, 2.283000, 2.292000, 2.300000, 2.308000, 2.315000, 2.323000, 2.331000, 2.339000, 2.347000, 2.355000, 2.363000, 2.370000, 2.378000, 2.386000, 2.393000, 2.401000, 2.409000} 0.46 460.0 0.46 # set >>>newDataset.GetRasterBand(bandNo).SetMetadataItem('wavelength', '0.46') # set wavelength for single band >>>newDataset.GetRasterBand(bandNo).SetMetadataItem('wavelength_units', 'Micrometers') # also set the units >>>newDataset.SetMetadataItem('fwhm', '{0.46, ..., 2.409}', 'ENVI') # set wavelength for all bands at once >>>newDataset.SetMetadataItem('wavelength_units', 'Micrometers', 'ENVI') # also set the units >>>newRaster.setWavelength(460, bandNo) # set single band wavelength in Nanometers >>>newRaster.setWavelength(0.46, bandNo, 'Micrometers') # set single band wavelength in user-defined units
- wavelength units
The wavelength units of a band. Valid units are Micrometers, um, Nanometers, nm.
This information is derived from PAM/Band/Default/wavelength_units. If that is undefined, it is derived from PAM/Dataset/ENVI/wavelength_units:
# get >>>dataset.GetRasterBand(bandNo).GetMetadataItem('wavelength_units') # this works, because the GDAL ENVI driver assigns those on-the-fly >>>dataset.GetMetadataItem('wavelength_units', 'ENVI') >>>raster.wavelengthUnits(bandNo) Micrometers Micrometers Micrometers # set >>>newDataset.GetRasterBand(bandNo).SetMetadataItem('wavelength_units', 'Micrometers') # set for single band >>>newDataset.SetMetadataItem('wavelength_units', 'Micrometers', 'ENVI') # set for the dataset
Note that when using the
RasterWriter
for setting wavelength or fwhm information, the wavelength units are also correctly specified at the same time.
Machine Learning¶
EnMAP-Box provides nearly all of it’s machine learning related functionality by using Scikit-Learn in the background. So we decided to also adopt related terminology and concepts as far as possible, while still retaining the connection to GIS and remote sensing in the broader context of being a QGIS plugin. Most of the following definitions are directly taken from the Scikit-Learn glossary as is, and only expanded if necessary.
- classification
- The process of identifying which category an object belongs to.
- classifier
- A supervised estimator with a finite set of discrete possible output values.
- clusterer
- An unsupervised estimator with a finite set of discrete output values.
- clustering
- The process of automatic grouping of similar objects into sets.
- cross-validation
The training dataset is split into k smaller sets and the following procedure is followed for each of the k “folds”:
- a model is trained using k-1 of the folds as training dataset
- the resulting model is used to predict the targets of the remaining part of the dataset
The performance can now be calculated from the predictions for the whole training dataset.
This approach can be computationally expensive, but does not waste too much data (as is the case when fixing an arbitrary validation set), which is a major advantage in problems where the number of samples is very small.
- dataset
A dataset is a complete representation of a learning problem, combining feature data X and target data y. Datasets are often split into sub-datasets. One common splitting technique is the train-test split, where a part of the dataset is held out as a so-called training dataset used for fitting the estimator and another part is held out as a test dataset used for a final evaluation.
When evaluating different settings (i.e. hyperparameters) for an estimator, yet another part of the dataset can be held out as a so-called validation dataset. Training proceeds on the training dataset, best parameters are found by evaluating against the validation dataset, and final evaluation can be done on the test dataset. Holding out a validation datase can be avoided by using cross-validation for hyperparameter tuning.
- estimator
- An object which manages the estimation of a model. The model is estimated as a deterministic function.
- evaluation metric
Evaluation metrics give a measure of how well a model (e.g. a classifier or regressor) performs.
See also https://scikit-learn.org/stable/modules/model_evaluation
- feature
- feature vector
In QGIS and other GIS, the term feature is well defined as a logical element defined by a point, polyline or polygon inside a vector layer. In the context of the EnMAP-Box, we refere to it as geographic feature.
In machine learning, a feature is a component in a so-called feature vector, which is a list of numeric quantities representing a sample in a dataset. A set of samples with feature data X and associated target data y or Y form a dataset.
Elsewhere features are known as attributes, predictors, regressors, or independent variables. Estimators assume that features are numeric, finite and not missing. n_features indicates the number of features in a dataset.
- n_features
- The number of features in a dataset.
- n_outputs
- The number of outputs in a dataset.
- n_samples
- The number of samples in a dataset.
- n_targets
- Synonym for n_outputs.
- output
Individual scalar/categorical variables per sample in the target.
Also called responses, tasks or targets.
- regression
- The process of predicting a continuous-valued attribute associated with an object.
- regressor
- A supervised estimator with continuous output values.
- sample
We usually use this term as a noun to indicate a single feature vector.
Elsewhere a sample is called an instance, data point, or observation. n_samples indicates the number of samples in a dataset, being the number of rows in a data array X.
- target
The dependent variable in supervised learning, passed as y to an estimator’s fit method.
Also known as dependent variable, outcome variable, response variable, ground truth or label.
- test dataset
- The dataset used for final evaluation.
- training dataset
- The dataset used for training.
- transformer
- An estimator that transforms the input, usually only feature data X, into some transformed space (conventionally notated as Xt).
- validation dataset
- The dataset used for finding best parameters (i.e. hyperparameter tuning).
- X
- Denotes data that is observed at training and prediction time, used as independent variables in learning. The notation is uppercase to denote that it is ordinarily a matrix.
- y
- Y
- Denotes data that may be observed at training time as the dependent variable in learning, but which is unavailable at prediction time, and is usually the target of prediction. The notation may be uppercase to denote that it is a matrix, representing multi-output targets, for instance; but usually we use y and sometimes do so even when multiple outputs are assumed.
Installation¶
The EnMAP-Box is a plugin for QGIS and requires additional python packages that need to be installed independent from QGIS.
Video with step by step installation instructions
1. Install QGIS¶
Install QGIS version 3.26 or higher to run the EnMAP-Box. You can get QGIS here. Additional information on the installation process is provided in the QGIS Documentation.
In case you already have QGIS installed, you can skip this step.
MacOS¶
Download the official qgis-macos-pr.dmg from https://www.qgis.org/en/site/forusers/download.html.
Extract the qgis-macos-pr.dmg and move it to your app folder
Installing or opening QGIS may raise a verification warning. In that case, open your system preferences, go to
and allow QGIS to be open anyway.
- Now you can start QGIS.app from your application folder.
2. Install required python packages¶
The EnMAP-Box plugin requires several python packages (click here here for full list). In the following we demonstrate two variants for installing the required packages (you don’t have to do both!):
2.1 Package Installer¶
The EnMAP-Box includes a Package Installer that offers a more or less one-click solution to install required python packages. It can be accessed from the menu bar via
.If you start the EnMAP-Box for the first time, you may see a warning. The Package Installer can also be opened by clicking Install Missing.

Use the Yes to All button to install all required python packages. Per default, this will install packages using pip into the user directory (as this does not require admin rights). It is also possible to install/update packages individually via the context menu inside the package list.

It might be necessary to restart QGIS and the EnMAP-Box.
2.2 Command-line¶
In case the Package Installer does not work for you or you do not want to use it, try installing the packages from the command-line. This variant may be more reliable. See OS specific instructions below:
Close QGIS, if it is open.
Run the OSGeo4W Shell as administrator, if possible. A convenient way to access the OSGeo4W Shell is from the start menu. Depending on the installation method you used to install QGIS, the shortcut will be listed under QGIS 3.xx (standalone installer) or OSGeo4W (network installer)
Hold Ctrl + Shift and click on the OSGeo4W Shell entry (or right-click and choose Run as administrator)
Activate the Python 3 environment by entering:
py3_env
Note
In more recent versions of QGIS the
py3_env
call might not be necessary or will simply not work. If so, just continue with the following step (4).Install required python packages by entering:
python3 -m pip install -r https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/requirements.txt
Now all packages will be installed automatically. After completion, the shell should show something like this:
If the package installation was successful, you can close the shell. The required packages are installed now and you can continue to start/install the EnMAP-Box.
Error
In case you run into problems because pip is not available in your python environment (error message
C:/.../python3.exe: No module named pip
or similar), follow these steps…
Close QGIS, if it is open.
Open the terminal and install all missing packages using pip:
python3 -m pip install -r https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/requirements.txt
Hint
Make sure to execute the pip command in the python environment QGIS is using (usually you can find out where python is located by running
import sys; sys.executable
in the QGIS Python Console). You then might have to change thepython3
part in the snippet below with the explicit QGIS python path.This also applies if you installed QGIS using flatpak, in that case install python modules as described here.
Note
You might also consider to create a virtual environment (
python3 -m venv
), install the packages as described, setsystem-site-packages = true
in thepyvenv.cfg
, activate this virtual environment and startqgis
from there.
To install single python packages like the astropy package, open the Terminal and call:
/Applications/QGIS.app/Contents/MacOS/bin/pip3 install -U astropy
Use -U
or --update
to update older package version.
To install all packages required, call:
/Applications/QGIS.app/Contents/MacOS/bin/pip3 install -U -r https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/requirements.txt
More details on the QGIS packaging mechanism for macOS can be found here.
Error
See FAQ if you run into problems installing the packages.
3. Install or update the EnMAP-Box¶
Install from QGIS plugin repository¶
Open QGIS and go to
In the search bar enter
enmap
orEnMAP-Box 3
Now the EnMAP-Box should be listed in the plugin list:
Select it and click Install plugin (or Upgrade in case you update to a new version)
The following dialog might pop up afterwards:
Depending on whether you want to use the GEE Time Series Explorer check
or uncheck
the checkbox and confirm with OK
(Optional): You can download a demo dataset via
Experimental version
It is also possible to install the most recent develop version of the EnMAP-Box. To do so, make sure that the option
Show also experimental plugins is activated in the plugin manager settings. Once activated, there is an additional button
Install Experimental Plugin in the plugin manager.

Warning
As the experimental tag suggests, this version comes with the newest features and developments, but might also be prone to bugs and crashes.
Install older version¶
- Go to the QGIS Python Plugins Repository https://plugins.qgis.org/plugins/enmapboxplugin/
- Click on the Versions tab to see all available version.
- Click on the desired version and on the next page click
- It is recommended to uninstall previous EnMAP-Box versions (delete folder manually, or in QGIS via )
- Open .
- Press … and select the downloaded zip file
(
enmapboxplugin.3.x.YYYYMMDDTHHMM.QGIS3.zip
) and click Install plugin. - Start the EnMAP-Box via the
icon or from the menubar .
Getting Started¶
EnMAP-Box Introduction and basic features:
1. Launching the EnMAP-Box¶
Once you successfully installed the EnMAP-Box, you can access the plugin via the icon
in the QGIS toolbar or via from the menubar.
Furthermore, the EnMAP-Box Processing Algorithms provider is available in the Processing Toolbox.
![]()
The Graphical User Interface (GUI) of the EnMAP-Box on first open
Tip
Have a look at the User Manual for a detailed description of the GUI.
2. Loading data¶
You can load an example dataset into your project by selecting in the menu bar. On a fresh installation you will be asked to download the dataset, confirm with OK. The data will be added automatically into a single map view and will be listed in the Data Sources panel as well.
3. First steps in the GUI¶
By default the example data is loaded into a single map view. Let’s rearrange those for better visualisation and in order to get to know the GUI functionalities:
Click the
Open a map view button to add a second map view. This view will appear below the first map view (Map #1).
We want to arrange the windows so that they are next to each other (horizontally): Click and hold on to the blue area of Map #2 and drag it to the right of Map #1 (see figure below). The translucent blue rectangle indicates where the map window will be docked once you stop holding the left mouse button.
In the Map #1 list in the Data Views panel, select
hires_berlin.bsq
and drag the layer into Map #2 (you can drag them directly into the map view or the respective menu item under Data Views).In the next step we link both map views, so that zoom and center are synchronized between both: Click the
button or go to and select
Link map scale and center.
Move the map (using
or holding the mouse wheel
) and notice how both map views are synchronized now.
Now we want to change the RGB representation of the enmap_berlin.bsq
image:
- In the Data Views panel click the
Open Raster Layer Styling button, which will open a new panel. Here you can quickly change the renderer (e.g., singleband gray, RGB) and the band(s) visualized. You can do so manually using the slider or by selecting the buttons with predefined wavelength regions based on Sentinel-2 (e.g. G = Green, N = Near infrared). The raster layer needs to have wavelength information for the latter to work!
- In the RGB tab, look for Predefined and click on the dropdown menu
. You will find several band combination presets. Select Colour infrared.
![]()
Raster Layer Styling panel with selected Color infrared preset
- Try out other renderers and band combinations!
4. Use a Processing Algorithm¶
In this section we will use a processing algorithm from the EnMAP-Box algorithm provider. The EnMAP-Box adds more than 150 Processing Algorithms to the QGIS processing framework. Their scope ranges from general tasks, e.g. file type conversions or data import to specific applications like machine learning. In this example we are converting a polygon dataset with information on different landcover types into a classification raster, i.e., we are going to rasterize the vector dataset.
- First of all, make sure the Processing Toolbox window is opened. If not, activate it via
- Open the Rasterize categorized vector layer algorithm under
- Use the following settings:
- Categorized vector layer:
landcover_berlin_polygon.gpkg
- Grid:
enmap_berlin.bsq
Specify an output filepath under Output Classification and click Run.
Result of the Classification from Vector algorithm (right) and the input grid (left) and polygon dataset (middle)
5. What’s next?¶
Todo
- Tutorials
- Advanced raster algebra using Raster math
See also
If you face issues or have questions, head over to the GitHub Discussions page and start a new discussion.
Cookbook¶
This section is a collection of ‘recipes’ for common tasks you can perform in the EnMAP-Box. For convenience the recipes might use and refer to the EnMAP-Box test dataset, but of course it is desired that you use your own data sets as well.
Todo
We will try to continuously update this section. If you miss topics, feel free to suggest new entries here!
Clip a raster with a vector¶
Clipping a raster to the bounds of a vector layer is fairly simple in the EnMAP-Box, since vector layers can be interpreted as masks.
Go to the Processing Algorithms and select
Under Raster select the raster layer you want to clip, and under Mask select the vector layer.
Tip
If you want to invert the clip, which means that only pixels are included which are NOT within a polygon, simply activate the Invert Mask option.

Output example: Input raster (left), vector geometry for clipping (middle) and resulting output (right)
Attention
This method will just mask the raster according to the vector geometries, the extent will not be altered, which means the raster will not be cropped to the extent of the vector layer. You may use the Translate raster layer algorithm for this.
Clustering (kmeans)¶
Several clustering methods are available in the EnMAP-Box. You can find them in the Processing Toolbox under Fit … algorithm first and then apply it to an image with Predict (unsupervised) classification layer.
. The usual way to apply these methods is to use aThis recipe demonstrates the basic workflow of applying clusterers using K-Means clustering (Fit KMeans) and the test dataset.
See also
You can find all the available clustering algorithms here.
Open the test dataset
In the processing toolbox go to
- Specify
enmap_berlin.bsq
under Raster - Under Output Clusterer specify an output file path and click Run
- Specify
Now open
- Select
enmap_berlin.bsq
as input Raster - Under Clusterer click … and select the output
.pkl
file from the Fit KMeans algorithm - Specify an output filepath for the transformed raster under Clustering and click Run
EnMAP true color image (left) and kmeans cluster result with 8 clusters (right)
- Select
Tip
8 clusters is the default of the kmeans algorithm here, if you want to change the number of clusters, run the
Fit Kmeans algorithm with a fewer number, by altering the KMeans()
function in the Code window to KMeans(n_clusters=4)
.
This will reduce the amount of clusters to 4.
Filtering¶
The EnMAP Box comes with a variety of filtering algorithms. You can find them in the processing toolbox under
. In this section we will demonstrate how to apply them, by showing a spatial filter and a spectral filter.Spatial Filter¶
Spatial filters apply a 2D kernel spatially (i.e. y/x dimensions) for each band.
Open the testdataset. In the processing toolbox go to .
- Select
enmap_berlin.bsq
as Raster - Use the default settings in the code window
- Specify Output Raster, and click Run

Input image on the left (true color RGB), median filtered image on the right (same band combination)
Spectral Filter¶
In spectral filtering a 1D kernel is applied along the z dimension of the raster (bands). Mind that in some cases you will reduce the overall number of band values as values in the beginning and at the end will be set to nodata (depending on the kernel type and size).
Open the testdataset. In the processing toolbox go to .
- Select
enmap_berlin.bsq
as Raster - In the code window, change
stddev=1
tostddev=2
- Specify Output Raster, and click Run

Spectral signature of a pixel, original vs filtered with a Gaussian1DKernel
Generic Filter (Majority)¶
With the Spatial Generic Filter Processing Algorithm you can use the scipy generic_filter function to write your own spatial filter functions.
In this example we will write a mode filter (also known as majority filter). This kind of filter is often used to smooth classification results (reduce salt-and-pepper effects in the image). It calculates the mode of all values in a specifiable neighborhood around a pixel (e.g. 3x3 pixel window) and assigns this value to the pixel.
In the Processing Toolbox go to and open
Select an input raster under Raster
In the Code text window you can enter python code. Delete the existing content and enter the following
from scipy.ndimage.filters import generic_filter import numpy as np from scipy.stats import mode def filter_function(invalues): invalues_mode = mode(invalues, axis=None, nan_policy='omit') return invalues_mode[0] function = lambda array: generic_filter(array, function=filter_function, size=3)
Specify the output raster location and click Run

Majority filter applied to classification image: original classification (left), majority filtered 3x3 window (middle), majority filtered 5x5 window (right)
Tip
Also have a look at the scipy.stats.mode documentation. You can change
the window size by altering the size
parameter in the generic_filter
function.
You could further improve the function above by putting constraints on the definition of majority (for example, only update the original value if the frequency of the modal value is higher than 50 percent)
Map Algebra with ImageMath¶
You can open the ImageMath raster calculator under
Calculate NDVI¶
Make sure to open the testdatasets for this example
Specify the input and output parameters according to the screenshot below (you can of course alter the names, but make sure to also adapt them in the script)
Enter this code in the editor on the right side. You do not need to alter Output Grid and Processing for now.
# select the red band red = enmap[38] # select the nir band nir = enmap[64] # calculate ndvi ndvi = (nir-red)/(nir+red)
Click the run button
. The result should be listed in the Data Sources panel.
Mask raster with vector¶
Make sure to open the testdatasets for this example
Select
enmap_berlin.bsq
under Inputs and name itenmap
. Further selectlandcover_berlin_polygon.shp
and name itmask
.Under Outputs specify output path and file and name it
result
Enter this code in the editor
result = enmap # set all cells not covered by mask to nodata result[:, mask[0] == 0] = noDataValue(enmap) # specify nodata value setNoDataValue(result, noDataValue(enmap)) # copy metadata to result raster setMetadata(result, metadata(enmap))
Click the run button
. The result should be listed in the Data Sources panel.
Wavelength Information¶
If wavelength information is defined for each band of a raster image, the EnMAP-Box can use it to easily select pre-defined band combinations or to better compare spectral profiles of sensors with different number of bands.

The wavelength information needs to be defined similar to the ENVI metadata standard:
- wavelength units defines the metric unit of the wavelength, e.g. nm, mu, cm,..
- wavelength defines the band values in wavelength units, e.g. 450 nm.
- fwhm defines the full width at half maximum in wavelength units
Wavelength information can be inspected with the Tools -> Metadata Viewer

In the QGIS python shell, wavelength information can be read as followed:
from enmapbox.gui.utils import parseWavelength, parseFWHM
source = 'path to raster file / QgsRasterLayer / GDAL DataSource'
wavelength, wavelength_unit = parseWavelength(source)
fwhm = parseFWHM(source)
print(wavelength)
print(wavelength_unit)
print(fwhm)
Internally, the EnMAP-Box reads wavelength information via the GDAL metadata model:
from osgeo import gdal
path = r'path to image'
dataset: gdal.DataSet = gdal.Open(path)
print(dataset.GetMetadataItem('wavelength_units', 'ENVI'))
print(dataset.GetMetadataItem('wavelengths', 'ENVI'))
Wavelength information can be set in the same way:
from osgeo import gdal
path = r'path to image'
dataset: gdal.DataSet = gdal.Open(path)
print(dataset.SetMetadataItem('wavelength_units', 'nm', 'ENVI'))
print(dataset.SetMetadataItem('wavelengths', '{490, 560, 665}', 'ENVI'))
dataset.FlushCache()
del dataset
Please note that this will only work if the image is not opened in QGIS!.
Transformation (PCA)¶
Several transformation methods are available in the EnMAP-Box. You can find them in the Processing Toolbox under Fit … algorithm first and then apply it to an image with Transform raster layer.
. The usual way to apply these methods is to use aThis recipe demonstrates the basic workflow of applying transformations using a principle component analysis (Fit PCA) and the test dataset.
See also
You can find all the available transformation algorithms here.
Open the test dataset
In the processing toolbox go to
- Specify
enmap_berlin.bsq
under Raster - Under Output Transformer specify an output file path and click Run
- Specify
Now open
- Select
enmap_berlin.bsq
as input Raster - Under Transformer click … and select the output
.pkl
file from the Fit PCA algorithm - Specify an output filepath for the transformed raster under Transformation and click Run
- Select
User Manual¶
The GUI¶
![]()
Overview of the EnMAP-Box
Toolbar¶
In the toolbar you can find the most common tasks. See table below for information on different buttons and their functionality.
It is possible to enable and disable the different tools: Right-click
on the toolbar and check or uncheck the desired toolbar.
Enable and disable different toolbars
Button | Button Name | Description |
---|---|---|
Adds a data source | Here you can add data from different sources, e.g. raster and vector |
Button | Button Name | Description |
---|---|---|
GEE Time Series Explorer | Opens the GEE Time Series Explorer in a new view. | |
Location Browser | Use point location or geometry formats to navigate to a specific location or send a request to the Nominatim Geocoding service of OpenStreetMap. | |
Profile Analytics | Opens the Profile Analytics in a new view. | |
Raster Band Stacking | Stack different raster bands individually. | |
Sensor Product Import | Import different sensor products by drag & drop. |
Panels¶
The Data Sources panel lists the data in your current project, comparable to the Layers panel in QGIS. The following data types and their corresponding metadata are available:
-
File size: Metadata on resolution and extent of the raster
CRS: Shows Coordinate Reference System (CRS) information
Bands: Information on overall number of bands as well as band-wise metadata such as name, class or wavelength (if available)
Note
Depending on the type, raster layers will be listed with different icons:
for default raster layers (continuous value range)
for mask raster layers
for classification raster layers
Also see section on data types for further information.
-
- File size: Shows the file size and extent of the vector layer
- CRS: Shows Coordinate Reference System (CRS) information
- Features: Information on number of features and geometry types
- Fields: Attribute information, number of fields as well as field names and corresponding datatype
-
- File size: Size of the file on hard disk
- Profiles: Shows the number of spectra in the library
Buttons of the Data Sources panel:
Tip
- If you want to remove all layers at once, right-click
in the Data Sources panel and and select Remove all DataSources
- The EnMAP-Box also supports Tile-/Web Map Services (e.g. Google Satellite or OpenStreetMap) as a raster layer. Just add them to
your QGIS project as you normally would, and then click the
Synchronize Data Sources with QGIS button. Now they should appear in the data source panel and can be added to a Map View.
The Data Views panel organizes the different windows and their content. You may change the name of a Window by double-clicking onto the name in the list.
Buttons of the Data Views panel:
Organization of the Data Views panel:
Example of how different window types and their contents are organized in the Data Views panel. In this case there are two Map Views and one Spectral Library View in the project.
This menu manages the connection between raster sources and spectral library windows.
When collecting profiles, the Identify tool selects profiles from the top-most raster layer by default. The Profile Source panel allows to change this behaviour
and to control:
the profile source, i.e., the raster layer to collect profiles from,
the style how they appear in the profile plot as profile candidate,
the sampling method, for example to aggregate multiple pixel into a single profile first,
the scaling of profile value.
Overview of the Spectral Profile Sources Window with two labeled spectra and main functionalities
Buttons of the Profile Sources
Button | Description |
---|---|
add a new profile source entry | |
remove selected entries |
- Profiles
- Define the input data from where to take the spectral information from.
- Style
Change style of displayed spectra, i.e. symbol and color
- Source
- Specify a source raster dataset
- Double-clicking in the cell will open up a dropdown menu where you can select from all loaded raster datasets.
- Sampling
- Select Single Profile or Kernel by double-clicking into the cell.
- Scaling
- Choose how spectra are sampled.
- Define the scaling factors by setting the Offset and Scale value.
Option | Description |
---|---|
SingleProfile | Extracts the spectral signature of the pixel at the selected location |
Sample3x3 | Extracts spectral signatures of the pixel at the selected location and its adjacent pixels in a 3x3 neighborhood. |
Sample5x5 | Extracts spectral signatures of the pixel at the selected location and its adjacent pixels in a 5x5 neighborhood. |
Sample3x3Mean | Extracts the mean spectral signature of the pixel at the selected location and its adjacent pixels in a 3x3 neighborhood. |
Sample5x5Mean | Extracts the mean spectral signature of the pixel at the selected location and its adjacent pixels in a 5x5 neighborhood. |
The processing toolbox is basically the same panel as in QGIS. Here you can find all EnMAP-Box processing algorithms
listed under EnMAP-Box. In case it is closed/not visible you can open it by clicking the
button in the menubar or .
See QGIS Documentation - The toolbox for further information.
This tools lets you inspect the values of a layer or multiple layers at the location where you click in the map view. To select a location (e.g. pixel or feature)
use the Select Cursor Location button together with the
Identify cursor location value option activated and click somewhere in the map view.
The Cursor Location Value panel should open automatically and list the information for a selected location. The layers will be listed in the order they appear in the Map View. In case you do not see the panel, you can open it via
.By default, raster layer information will only be shown for the bands which are mapped to RGB. If you want to view all bands, change the Visible setting to All (right dropdown menu). Also, the first information is always the pixel coordinate (column, row).
You can select whether location information should be gathered for All layers or only the Top layer. You can further define whether you want to consider Raster and Vector layers, or Vector only and Raster only, respectively.
Coordinates of the selected location are shown in the x and y fields. You may change the coordinate system of the displayed coordinates via the
Select CRS button (e.g. for switching to lat/long coordinates).
Views¶
The map view allows you to visualize raster and vector data. It is interactive, which means you can move the content or zoom in/out.
In order to add a new Map View click the
Open a Map View button. Once you added a Map View, it will be listed in the
Data Views
panel.Add layers by either drag-and-dropping them into the Map View (from the Data Sources list) or right-click
onto the layer
You can also directly create a new Map View and open a layer by right-clicking
the layer
You can link multiple Map View with each other, so that the contents are synchronized. The following options are available:
In order to link Map View, go to
in the menu bar, which will open the following dialog:Here you can specify the above mentioned link options between the Map Views. You may either specify linkages between pairs
or link all canvases at once (the All Canvases option is only specifiable when the number of Map Views is > 2). Remove
created links by clicking .
Demonstration of linking two Map Views
The Spectral Library Window offers (almost) the same tools like the standard QGIS attribute table. In addition, it provides views and features specifically to visualize and manage spectral profiles. It directly interacts with the Map View(s), which means spectra can be directly collected from an image. Furthermore, external libraries (e.g. ENVI Spectral Library) can be imported.
Add a new spectral library view by using the Add Spectral Library Window button in the toolbar or open a new window from the menu .
Overview of the Spectral Library view with several collected and labeled spectra and main tools
Buttons of the Spectral Library Window
Make sure to enable the
and
button in the menu bar and open a raster from which you want to collect spectra in a new Map View.
Click on a desired pixel position in the opened raster image and a new Spectral Library window opens with the spectral profile of the respective pixel.
Profiles obtained from pixel positions are considered as current or temporary profile candidates. The last profile candidate will be replaced by a new one each time you click on a new pixel position.
Click on Add Profile(s)
to keep the candidate profile in the spectral library. Activate Add profiles automatically
to collect multiple profiles and display them all in the same spectral library.
As an alternative to the mouse you can also identify and select pixel profiles using the shortcuts to change, select and add pixel profiles to the Spectral Library.
First activate the crosshair for the respective image. Click with the right mouse button in the image. Select Crosshair > Pixel Grid > desired raster image.
Now you should see a red square around your pixel and a red dot indicating the position of the pixel profile.
To identify, select and add a pixel profile, use the following key combinations:
Shortcut | Action |
---|---|
←/↑/↓/→ | Move the map |
Ctrl + ←/↑/↓/→ | Select next pixel in arrow direction |
Ctrl + S | Add the selected pixel profile candidate |
Add profiles from another raster image
Sometimes, you want to compare spectral profiles from different raster sources. The Spectral Profile Source panel allows you to change the default settings of the Identify tool so that you can select profiles from different images at the same time.
If the Spectral Profile Source Panel is not already visible, open it via
.Add another profile source relation with
and change the Source to the desired raster images.
If you now collect new spectral information, two profiles will appear in the same Spectral Library Window.
Tip
Change the color of one of the profile by changing the Style in the Spectral Profile Sources.
In a similar way you can compare profiles from the same raster image but using a different sampling methods.
In the second relation set the Source to the same image as the first relation.
Change the Sampling to e.g. a 3x3 Kernel mean profile.
Collect new pixel profiles.
Spectral Profile Sources Sampling Example
You can also add more information to your spectral library by using the attribute table. Add additional fields to the table, e.g. in order to add information to every spectrum (id, name, classification label, …).
Now you can use the Add Field
dialog to add a new column.
Select a data type of your choice.
A new column is added to the attribute table, which you can edit with a double click.
Tip
When you add a new attribute to the table, you can also choose to use it to store new spectral profiles by checking the Use to store spectral profiles checkbox. String, text and binary format can be used to store spectral profiles.
Add information in the layer properties window
It is also possible to add new information to the attribute table in the Layer Properties of the Spectral Library.
Navigate to the Fields tab and add a new field. Note: This view does not allow you to set the option Use to store spectral profiles.
Overview of the Layer Properties / Fields section
In addition, the Layer Properties panel allows you to set a certain widget for a specific column.
Switch to the Attributes Form tab in the Layer Properties, select the desired column and choose a certain widget type, e.g. a default range, color, spectral profiles etc.
Selecting widget types for specific columns
The field calculator
The field calculator allows you to modify or assess spectra and calculate new columns or modify existing ones using an expression.
Overview of the Field Calculator
Selecting spectra
Spectra can be selected in the attribute table and in the plot window itself. Selected spectra will be highlighted (blue background in the table; thicker line in a different color in the plot window).
Tip
You can inspect an individual value of a spectrum by holding the Alt key and clicking some position along the spectrum
It is also possible to select and filter profiles with the common vector filter and selection tools, e.g. select spectra by expression:
Select profiles using an expression
Locations of spectra (if available) can be visualized as a point layer by right-clicking into the map window, and selecting Add Spectral Library > SpectralLibrary #
As already mentioned, the Field Calculator can modify attribute values of all or selected features. In addition, the field calculator can be used to calculate spectral profiles.
- Create a new Spectral Profile field based with Add Field
, use string, text or binary format and tick the Ise to store Spectral Profiles box.
- Open the field calculator
and search for spectralData or spectralMath in the Spectral Libraries tab.
SpectralMath allows you to modify spectral profiles with Python code.
- To use the SpectralMath function, select a field from which to take the spectral profiles, define an expression and the format.
spectralMath("<profile field 1>", ..., "<profile field n>", '<python code>', '<output format>')
Note: The last argument defines the output format. It must correspond to the type you assigned when creating the new column.
Example of calculating new spectral profiles
SpectralData returns spectral profile values.
The following table shows some examples of how spectralMath and spectralData can be used.
Description | Example |
---|---|
Multiply the existing profiles | spectralMath(“profiles”, ‘y *=2’, ‘text’) |
Create a new profile with x and y values | spectralMath(‘x,y=[1,2,3],[20,30,25]’) |
Return spectral profile values from map with spectral data from spectral profiles in field column “profiles” | spectralData(“profiles”) |
Return xUnit string of the spectral profile e.g. ‘nm’ for wavelength unit | spectralData(“profiles”)[‘xUnit’] |
Overview of the spectral processing idea
The Spectral Processing framework allows you to use raster processing algorithms to create new profiles. Field values of your spectral library will be converted into artificial one-line raster images. In principally, this can be done with most of the field types:
Field Type | Raster Size (band, height, n) | type |
---|---|---|
Spectral Profile | nb, 1, n | int/float |
integer | 1, 1, n | integer |
float | 1, 1, n | float |
text | 1, 1, n | int (classification) |
These temporary raster images are input to standard QGIS processing algorithms or QGIS processing models. If they generate raster outputs, these outputs can be converted back into field values of the spectral library:
Raster Output | Spectral library Field Type |
---|---|
(>1, 1, n) int/float | Spectral Profile |
(1, 1, n) int | integer |
(1, 1, n) float | float |
This allows you to use the same algorithms to modify spectral profiles as you may want to use to manipulate raster images. Furthermore, you can make use the QGIS model builder to create (potentially very large and complex) models and use them for both, spectral libraries and raster image processing.
To use the Spectral Processing tool open
and choose the desired algorithm, e.g. Spectral resampling.
Select the input profiles to be translated to the temporary raster layer and specify the outputs. Select an existing field or enter a name to create a new field.
Spectral Processing Example
The Profile Plot displays spectral profiles. Toggling the Profile View icon shows or hides the plot panel.
This can be useful, for example to enlarge the attribute table and focus on attribute modifications.
You can adjust the extent of the visualized data range and units
in the plot context menu
using the mouse cursor while keeping the right mouse button pressed
in the visualization settings view
You can also export the entire plot scene or visible view box by clicking into the plot and select
.Export options of the spectral library
The visualization settings of the spectral library allow you to customize the view according to your needs. You can define multiple visualization groups that describe how profiles from a specific field and with specific attributes should be visualized.
Overview of the visualization settings in the Spectral Library window
It is also possible, to change the appearance of the Spectral Library window, i.e., bright or dark.
Moreover, activate or deactivate the crosshair and choose a color.
The Current Profiles section shows you all the spectra that have been collected but do not yet appear in the attribute table. Change the color and symbol, or add a line between the points by double clicking the profile below the Current Profile section and adjust the style settings.
Working with multiple visualization groups
The spectral library visualization settings also allow you to add several profile Groups with different style settings.
- Add a second visualization group with
.
- If you want rename Group “profiles”.
- Change the color for both groups in the Color.
- Under Field you can specify which spectral profile column of the attribute table you want to use.
If you have more than one column that stores spectral information, you can have different visualization groups using different profiles.
If you have only one column where spectral information is stored, but you have another column storing e.g. class names, you can use the Filter field to define an expression and select only specific class names, e.g. Impervious and Vegetation and visualize these profiles in different colors.
Spectra can be colorized according to their attributes, e.g. their class name.
In the Data Views panel on the left, right click
on the spectral library that we are currently using and select the Layer Properties.
Switch to the Symbology
tab and select the Categorized renderer at the top.
In the Column droplist select the desired column and click Classify.
Confirm with Ok and close the window.
In the Spectral Library Window activate the visualization settings with the
button.
Loading or Saving a spectral library means to load or save vector files.
Load any vector source in the Data Source Panel into a Spectral Library Viewer.
The vector layer does not need to contain any Spectral Profile fields. You can add or define them afterwards.
If your spectral library uses an in-memory vector layer backend, all data will be lost if the layer is closed. This is the case if the Spectral Library Viewer was opened from scratch with an empty spectral library. In this case, don’t forget to export collected profiles before closing the Spectral Library Viewer.
If your spectral library already uses a file backend (e.g. .gpkg, .geojson), Style and other layer specific information are not saved in the data source file, but the QGIS project or a QGIS specific sidecar .qml file.
Open
to create or update the .qml file and ensure that the Spectral Profile fields will be restored when re-opening the data set.
The Export dialog allows you to export all or selected profiles as Geopackage (.gpkg), GeoJSON (.geoson) or ENVI Spectral Library (.sli).
The ENVI Spectral Library does not allow saving profiles with different spectral settings (number of bands, wavelength units, FWHM, …) in the same file. Therefore, you need to select one (out of multiple) profile fields. Profiles with different spectral settings will be exported into different ENVI files.
To import none-vector files into an existing spectral librar use the Import Spectral Library
button.
Possible formats to be imported: ENVI Spectral Library, Geopackage, ASD Field Spectrometer measurements, Raster Layer.
You can also import ASD Field Spectrometer measurements and map and modify the imported profiles and attributes accordingly.
The EnMAP-Box stores the minimum data to plot a single profile in a JSON object. In its most simple way, this JSON object contains a single array “y” of length n, with n = number of spectral profile values:
{
"y": [43, 23, 45, 63,45]
}
In this case it can be assumed that the corresponding ‘x’ values are an increasing band index “x”: [0, 1, 2, 3, 4].
The JSON object can describe the “x”, the axis units and a vector of bad band values explicitly:
Member | Content |
---|---|
y | An array with n profile values |
x | An array with n profile value locations |
yUnit | String that describes the unit of y values |
xUnit | String that describes the x value unit |
bbl | A bad band list |
Other metadata to describe spectra profiles are stored in additional vector layer fields.
As JSON object, a single hyperspectral EnMAP profile may therefore look like:
{
"bbl":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
"x":[0.46,0.465,0.47,0.475,0.479,0.484,0.489,0.494,0.499,0.503,0.508,0.513,0.518,0.523,0.528,0.533,0.538,0.543,0.549,0.554,0.559,0.565,0.57,0.575,0.581,0.587,0.592,0.598,0.604,0.61,0.616,0.622,0.628,0.634,0.64,0.646,0.653,0.659,0.665,0.672,0.679,0.685,0.692,0.699,0.706,0.713,0.72,0.727,0.734,0.741,0.749,0.756,0.763,0.771,0.778,0.786,0.793,0.801,0.809,0.817,0.824,0.832,0.84,0.848,0.856,0.864,0.872,0.88,0.888,0.896,0.915,0.924,0.934,0.944,0.955,0.965,0.975,0.986,0.997,1.007,1.018,1.029,1.04,1.051,1.063,1.074,1.086,1.097,1.109,1.12,1.132,1.144,1.155,1.167,1.179,1.191,1.203,1.215,1.227,1.239,1.251,1.263,1.275,1.287,1.299,1.311,1.323,1.522,1.534,1.545,1.557,1.568,1.579,1.59,1.601,1.612,1.624,1.634,1.645,1.656,1.667,1.678,1.689,1.699,1.71,1.721,1.731,1.742,1.752,1.763,1.773,1.783,2.044,2.053,2.062,2.071,2.08,2.089,2.098,2.107,2.115,2.124,2.133,2.141,2.15,2.159,2.167,2.176,2.184,2.193,2.201,2.21,2.218,2.226,2.234,2.243,2.251,2.259,2.267,2.275,2.283,2.292,2.3,2.308,2.315,2.323,2.331,2.339,2.347,2.355,2.363,2.37,2.378,2.386,2.393,2.401,2.409],
"xUnit":"Micrometers",
"y":[405,397,412,410,402,413,421,427,444,446,445,445,476,491,495,504,504,519,532,530,536,539,533,527,529,527,529,526,530,524,520,521,522,523,507,514,505,502,494,497,543,603,703,769,845,930,1007,1096,1178,1249,1314,1359,1388,1386,1419,1432,1432,1435,1471,1498,1479,1487,1482,1499,1507,1517,1509,1534,1532,1507,1557,1527,1552,1605,1534,1555,1577,1564,1582,1600,1611,1643,1659,1678,1684,1672,1687,1659,1697,1624,1612,1602,1576,1515,1508,1513,1522,1542,1575,1602,1632,1649,1663,1639,1602,1587,1530,977,996,1026,1063,1086,1108,1123,1169,1177,1191,1194,1210,1222,1208,1201,1187,1182,1146,1157,1112,1093,1085,1096,1058,1041,754,781,804,796,780,792,812,825,851,803,812,836,834,818,823,842,842,860,851,880,844,856,847,846,819,842,820,754,768,731,728,750,695,735,675,718,640,601,684,744,635,568,696,637,592]}
}
Note that conceptually profile objects can differ in its wavelength etc.
Todo
…
Tools¶
Add Product¶
The Add Product menu allows to import satellite products into the EnMAP-Box. It is also possible to drag&drop products from the file explorer (e.g. Windows Explorer). The different import algorithms assign proper metadata like wavelength, band names and data offset and scale, resulting in analysis ready raster data.
- Usage
- Choose the product type from the Project > Add Product menu.
- Select the associated (metadata) file.
- Live demonstration
Add Web Map Services (WMS)¶
The Add Web Map Services (WMS) menu allows to add predefined WMS to the Data Sources panel:
- Usage
- Choose a WMS from the Project > Add Web Map Services (WMS) menu.
- Add the WMS to a Map View.
- Live demonstration
Band Statistics¶
The Band Statistics tool reports band histograms and basic statistics like min, max, mean and standard deviation.
- Usage
- Start the tool from the Tools > Band Statistics menu or from the layer context menu inside the Data Views panel.
- Select a raster layer.
- Add some bands.
- Interactively explore the map.
- Live demonstration
Bivariate Color Raster Renderer¶
The Bivariate Color Raster Renderer allows to visualize two bands using a 2d color ramp. Find a mapping example here: https://www.joshuastevens.net/cartography/make-a-bivariate-choropleth-map/
- Usage
- Start the tool from the Tools > Bivariate Color Raster Renderer menu or from the layer context menu inside the Data Views panel.
- Select a raster layer.
- Select two bands.
- Select or define a color plane.
- Interactively explore the map.
- Live demonstration
Class Fraction/Probability Renderer and Statistics¶
The Class Fraction/Probability Renderer and Statistics tool allows to visualize arbitrary many fraction/probability bands at the same time, using a weighted average of the original class colors, where the weights are given by the class fractions/probabilities.
- Usage
- Start the tool from the Tools > Class Fraction/Probability Renderer and Statistics menu or from the layer context menu inside the Data Views panel.
- Select a class fraction layer or a class probability layer.
- Select approriate class colors or paste a matching style from another layer.
- Interactively explore the map.
Note that the visibility of individual classes can be turned on and off.
- Live demonstration
Classification Statistics¶
The Classification Statistics tool reports class histograms and area covered in percentage, pixel and map units.
- Usage
- Start the tool from the Tools > Class Fraction/Probability Renderer and Statistics menu or from the layer context menu inside the Data Views panel.
- Select a categorized raster layer.
- Interactively explore the map.
- Live demonstration
CMYK Color Raster Renderer¶
The CMYK Color Raster Renderer allows to visualize 4 bands using the CMYK (Cyan, Magenta, Yellow, and Key/Black) color model. Find a mapping example here: https://adventuresinmapping.com/2018/10/31/cmyk-vice/
- Usage
- Start the tool from the Tools > CMYK Color Raster Renderer menu or from the layer context menu inside the Data Views panel.
- Select a raster layer.
- Select CMYK bands.
- Interactively explore the map.
- Live demonstration
Color Space Explorer¶
The Color Space Explorer allows a) to select random and predefined RBG band combinations, and b) to animate RGB bands.
- Usage
Start the tool from the Tools > Color Space Explorer menu or from the layer context menu inside the Data Views panel.
Select a raster layer.
Select RGB bands:
- manually
- randomly
- from predefined list of RGB band combinations
Animate bands using the Color Space Gradient Step Size settings.
Interactively explore the map.
- GUI
- Live demonstration
Decorrelation Stretch Renderer¶
The Decorrelation Stretch Renderer allows to visualize 3 band. It removes the high correlation commonly found in optical bands to produce a more colorful color composite image.
- Usage
- Start the tool from the Tools > Decorrelation Stretch Renderer menu or from the layer context menu inside the Data Views panel.
- Select a raster layer.
- Select RGB bands.
- Interactively explore the map.
- GUI
Enhanced Multiband Color Renderer¶
The Ehanced Multiband Color Renderer allows to visualize arbitrary many bands at the same time using individual color canons for each band.
- Usage
- Start the tool from the Tools > Enhanced Multiband Color Renderer menu or from the layer context menu inside the Data Views panel.
- Select a color for each band.
- Interactively explore the map.
- GUI
HSV Color Raster Renderer¶
The HSV Color Raster Renderer allows to visualize 3 bands using the HSV (Hue, Saturation, Value/Black) color model. Find a mapping example here: https://landmonitoring.earth/portal/ ; select Maps > Global Landcover Dynamics 2016-2020
- Usage
- Start the tool from the Tools > HSV Color Raster Renderer menu or from the layer context menu inside the Data Views panel.
- Select HSV bands.
- Interactively explore the map.
- GUI
Todo
Find a good dataset, that is comparable to the Global Landcover Dynamics 2016-2020 from GeoVille.
Image Cube¶
The Image Cube tool visualizes a raster image in an interactive 3D view:

- Select the raster image.
- Specify the:
- Top Plane renderer. It can be any raster renderer known from QIGS, e.g. a Multiband
- color renderer that shows the true color bands
- Cube & Slice renderer. This must be a render that uses a single band only, e.g. a Singleband grey or Pseudocolor renderer. It will colorize the band-related pixel values of the 3D image cube and planes relating to the X, Y or Z slice.
- Press Load Data to (re)load and render the raster image values.

The 3D scene contains the following elements:
- Top Plane - a raster layer for spatial orientation
- Image Cube - a volumetric representation of the raster image, showing the raster bands on the z axis
- X Slice - a slice along the raster’s X / column / sample dimension
- Y Slice - a slice along the raster’s Y / row / line dimension
- Z Slice - a slice along the raster’s Z / band dimension
- Box (Image) - a 3D bounding box along the maximum image extent
- Box (Subset) - a 3D bounding box to show the extent of the spatial subset that migh be used to focus on specific image areas

Metadata Viewer¶
The Metadata Viewer allows to view and edit GDAL metadata of a raster source.
- Usage
- Start the tool from the Tools > Metadata Viewer menu.
- Select a raster source.
- View and edit metadata.
- GUI
Multisource Multiband Color Raster Renderer¶
Todo
WriteTheDocs (use FORCE TSI stacks with TCB/G/W)
Raster Layer Styling¶
The Raster Layer Styling panel allows to quickly select a RGB, Gray or Pseudocolor visualizations.
- Usage
- GUI
- Live demonstration
It also supports the linking of the style between multiple raster layer.
- GUI
- Live demonstration
Raster Source Band Properties Editor¶
The Raster Source Band Properties Editor allows to view and edit band properties of GDAL raster sources, with special support for ENVI metadata.
- Usage
- Start the tool from the Tools > Raster Source Band Properties Editor menu.
- Select a raster source.
- View and edit metadata.
- GUI
Reclassify¶
The Reclassify tool is a convenient graphical user interface for reclassifying classification rasters.
Specify the file you want to reclassify under Input File. Either use the dropdown menu to select one of the
layers which are already loaded or use the button to open the file selection dialog.
Under Output Classification you can specify the classification scheme of the output classification which will be created.
- You can import schemes from existing rasters or text files by clicking the
button.
- Use the
button to manually add classes.
- To remove entries select the respective rows and click the
button.
- So save a classification scheme select the desired classes (or use Crtl + A to select all) and click on the
button.
- Likewise, you can copy and paste classes by selecting them and clicking the
Copy Classes
Paste Classes buttons.

- The table is sorted by the Label field in ascending order. The value in Label will become the pixel value of this class and can not be altered.
- Double-click into the Name field in order to edit the class name.
- Double-click into the Color field to pick a color.
Under Class Mapping you can reassign the old classes (From) to values of the new classification scheme (To)

Specify the output path for the reclassified image under Output File
Click OK to run the tool.
Scatter Plot¶
The Scatter Plot allows to plot two raster bands, or a raster band and a vector field against each other. The visualization of both, denstity and scatter is supported.
When plotting raster data against each other, we usually want to display the bin counts as colorized density.
- Usage
- Start the tool from the Tools > Scatter Plot menu or from the layer context menu inside the Data Views panel.
- Select two raster layer bands used for x and y values.
- Select Density option for Coloring and choose a color ramp.
- Interactively explore the map.
- GUI
- Live demonstration:
The tool can also be used to plot raster data versus vector attribute values, e.g. for accuracy assessment of quantitative maps.
- Usage
- Start the tool from the Tools > Scatter Plot menu or from the layer context menu inside the Data Views panel.
- Select a raster layer band used as x values, and vector layer field used as y values.
- Select Scatter option for Coloring, choose a color and a symbol.
- Active 1:1 line and Fitted line in the Analytics section.
- GUI
Virtual Raster Builder¶
See https://virtual-raster-builder.readthedocs.io/en/latest/
Applications¶
Agricultural Applications¶
Please visit LMU Vegetation Apps Documentation for more information.
Classification Dataset Manager¶
The Classification Dataset Manager allows to a) create a new dataset from various sources, b) presents basic information for each category like value, name, color and number of samples, c) supports editing of category names and colors, and d) let’s you easily draw a random sample.
- Usage
Start the tool from the Applications > Classification Dataset Manager menu.
Use the tool for different usecases like:
- create a dataset
- edit a dataset
- draw a random subsample
Inspect created datasets inside the Data Sources panel.
- GUI
- Live demonstration
Select one of the dataset creation options and follow the subsequent algorithm dialog.
- GUI
- Example data
Datasets used below are available in of the following locations:
- From categorized vector layer and feature raster
For details see the algorithm description.
- From categorized raster layer and feature raster
For details see the algorithm description.
- From categorized spectral library
library_berlin.gpkg
For details see the algorithm description.
- From categorized vector layer with attribute table
-
Attribute table with fields Sample_1, Sample_2, … Sample_177 used as features.
For details see the algorithm description.
- From table with categories and feature fields
Attribute table with fields Band_1, Band_2, … Band_177 used as features.
For details see the algorithm description.
- From Python code
For details see the algorithm description.
- From text files
For details see the algorithm description.
- From JSON file
For details see the algorithm description.
- Usage
- Select a classification dataset.
- Edit category names and colors inside the Categories tab.
- Edit feature names inside the Features tab.
- Save the edits.
- Usage
Select a classification dataset.
Set the sample size for each category to be drawn inside the Categories tab.
Alternatively, Set a relative or absolute sample size used for all categories.
Click Random Sample and follow the subsequent algorithm dialog.
Classification workflow¶
The Classification workflow algorithm let’s you easily perform classification analysis and mapping tasks using remote sensing data.
- Usage
- Start the algorithm from the Applications > Classification workflow menu.
- Select a Training dataset.
- Select a Classifier.
- Select a Raster layer with features used for mapping.
- If cross-validation accuracy assessment is desired, select the Number of cross-validation folds and a Output classifier performance report file destination (this step is skipped by default).
- If the classifier supports class probability, you may select an Output class probability layer file destination (this step is skipped by default).
- Click Run.
- GUI
- Live demonstration
Classification Workflow (advanced)¶
The Classification Workflow application let’s you easily perform classification analysis and mapping tasks using remote sensing data.
In the Quick Mapping section you can very easily define your training dataset, fit a classifier and predict a classification layer, with only a few clicks.
- Live demonstration
For a more elaborated analysis see the Detailed Analysis section.
In the Detailed Analysis section you have more control over individual analysis steps. When performing a detailed analysis, you can basically go through every subsection from left to right. But, depending on the usecase, it is also possible to skip individual steps you’re not interested in.
- Live demonstration
You have various options to create a dataset for subsequent analysis: select a Source option and click create dataset to create a new dataset`.
In the Editor, category colors and names, and feature names can be changed and saved.
By using the various controls in the Draw samples section, you can easily define a training-test-split setup. The number of training and test samples to be drawn for each category are listed, and also editable, inside the Editor.
Click split dataset to perform the split, resulting in a training and a test dataset, that can be used in subsequent analysis.
In the Classifier section you can either select a Predifined classifier or provide a user-defined Python Code snipped. See the https://scikit-learn.org/ documentation for a complete overview.
Click create classifier to create an (unfitted) classifier, that can be used in subsequent analysis.
In the Feature Clustering section you can perform an unsupervised Feature redundancy analysis, that clusters similar features together: select a Dataset, an Algorithm and click cluster features to create and an Output report.
After inspecting the report you can perform a Feature subset selection: select a suitable Number of features and click select features to create a training and a test dataset with fewer features, that are less correlated and can be used in subsequent analysis.
In the Feature Ranking section you can perform a supervised Feature importance analysis, that ranks features in terms of their importance for the classification task at hand: select a Dataset, an Algorithm and click :guilabel:`rank features to create and an Output report.
After inspecting the report you can perform a Feature subset selection: select a suitable Number of features and click select features to create a training and a test dataset with fewer features, that are most important and can be used in subsequent analysis.
In the Model section you can perform Model fitting: select a Dataset and click fit classifier to create a fitted Output classifier, that is used in subsequent analysis.
For Model performance analysis select an Algorithm and click assess performance to create an Output report.
In the Classification section you can perform Map prediction: select a Raster layer with features that matches the features used in Model fitting. Click predict output products to create an Output classification layer and/or an Output class probability layer. Note that outputs are opened inside the EnMAP-Box Data Sources panel.
For Map accuracy and area estimation select a Ground truth categorized layer and click assess performance to create an Output report.
In the Settings section you can specify the Output directory (e.g. C:/Users/USERNAME/AppData/Local/Temp/EnMAPBox/ClassificationWorkflow), that is used as the default file destination path, when creating file outputs. Note that each output file wigdet (e.g. Output dataset) has a default basename (e.g. dataset.pkl), that is used to create a default file destination (e.g. C:/Users/USERNAME/AppData/Local/Temp/EnMAPBox/ClassificationWorkflow/dataset.pkl). If the default file destination already exists, the basename is enumerated (e.g. .dataset_2.pkl) to avoid overwriting existing outputs.
Classification Workflow (deprecated)¶
Deprecated, use Classification workflow or Classification Workflow (advanced) instead.
You can find this application in the menu bar

Classification Workflow Application
See also
Have a look at the Getting Started for a use case example of the Classification Workflow Application.
Input Parameters:
Training Inputs
-
Three different types of input data sources are supported and have to be specified beforehand in the dropdown menu. Depending on the selected input type the user interface shows different options.
Raster / Classification
:- Raster: Specify input raster based on which samples will be drawn for training a classifier.
- Classification: Specify input raster which holds class information.
Raster / Vector Classification
:- Raster: Specify input raster based on which samples will be drawn for training a classifier.
- Reference: Specify vector dataset with reference information. Has to have a column in the attribute table with a
unique class identifier (numeric). The class colors and labels are derived from the current Symbology. To set or
change those settings, click the
button or go to the Layer Properties ( ). The vector dataset is rasterized/burned on-the-fly onto the grid of the input raster in order to extract the sample. If the vector source is a polygon dataset, only polygons which cover more than 75% of a pixel in the target grid are rasterized.
labelled Library
:- Library: Specify input spectral library.
-
Sampling
Once you specified all inputs in the Training inputs section, you can edit the class colors, names and class sample sizes in the Sampling submenu.
Note
If set, the class labels and color information is automatically retrieved from the layers current renderer settings (
).Training
In the Classifier
dropdown menu you can choose different classifiers (e.g. Random Forest, Support Vector Machine)
Model parameters: Specify the parameters of the selected classifier.
Hint
Scikit-learn python syntax is used here, which means you can specify model parameters accordingly. Have a look at the scikit-learn documentation on the individual parameters, e.g. for the RandomForestClassifier
Save model: Activate this option to save the model file (
.pkl
) to disk.
Mapping
Raster: Specify the raster you would like to apply the trained classifier to (usually -but not necessarily- this is the same as used for training)
Mask: Specify a mask layer if you want to exclude certain areas from the prediction.
Outputs:
Classification: Output path where to write the classification image to.
Probability: Output path of the class probability image.
Hint
This outputs the result of a classifiers
predict_proba
method. Note that depending on the classifier this option might not be available or has to be activated in the model parameters (e.g. for the Support Vector Machine, the linesvc = SVC(probability=False)
has to be altered tosvc = SVC(probability=True)
RGB: Generates a RGB visualisation based on the weighted sum of class colors and class probabilities.
Cross-validation Accuracy Assessment
EO Time Series Viewer¶
Please visit EO Time Series Viewer Documentation for more information.
EnPT (EnMAP Processing Tool)¶
Please visit EnPT Tutorial for more information.
GFZ EnGeoMAP¶
Please visit EnGeoMAP Tutorial for more information.
Image Math (deprecated)¶
Deprecated, use Raster math
Raster math¶
The Raster math algorithm is a powerful raster calculator inspired by the QGIS Raster calculator, the GDAL Raster calculator and ENVI Band Math. In addition to those tools, the EnMAP-Box Raster math calculator supports multi-band arrays, vector layer inputs, multi-line code fragments and metadata handling.
- Usage
Start the algorithm from the Applications > Raster math menu or from the Processing Toolbox panel.
Specify a single-line expression or a multi-line code fragment to be evaluated inside the Code editor.
Therefor select raster bands or numeric vector fields from the Available data sources tab.
[Optional] Select the destination Grid. If not specified, the grid of the first raster layer is used. Note that a) all input raster bands are resampled and b) all input vector fields are rasterized into the destination grid before the calculation.
[Optional] In case you want to perform a spatial operation, be sure to select a proper Block overlap or select Monolithic processing, to avoid artefacts at the block edges.
[Optional] Note that all inputs are converted to 32-bit floating-point values by default.
[Optional] You can select up to 10 additional raster inputs R1, …, R10 and vector inputs V1, …, V10. Additionally, a list of raster inputs RS can be selected.
Select an Output raster layer file destination an click Run.
- GUI
Use single-line expressions to evaluate simple numeric formulars.
- Example - sum up 3 raster bands using the ‘+’ operator
A raster band is represented as a 2d numpy array and can be selected using the <layer name>@<band number> syntax.
hires_berlin@1 + hires_berlin@2 + hires_berlin@3
- Example - sum up all bands of a raster using numpy.sum function
A raster is represented as a 3d numpy array and can be selected using the <layer name> syntax.
np.sum(enmap_berlin, axis=0)
An individual raster band can be accessed using the <layer name>@<band number> syntax, e.g. band number 42:
enmap_berlin@42
In case of a spectral raster, the band nearest to a target wavelength (in nanometers) can be selected using the <layer name>@<band number>nm syntax, e.g. NIR band at 865 nm:
enmap_berlin@865nm
Note that prominent target wavelength from the Landsat/Sentinel-2 sensors can be selected inside the Waveband locator tab.
All raster bands can be accessed at once using the <layer name> syntax, e.g.:
enmap_berlin
A band subset can be accessed using the <layer name>@<start>:<stop> syntax, e.g. band numbers 10 to 19:
enmap_berlin@10:20 # note that 20 is not included
# Note that you can also create a band subset by indexing the the full band array.
# This has the slight disadvantage, that all bands are read into memory first.
enmap_berlin[9:19]
Individual vector fields can be accessed using the <layer name>@”<field name>” syntax, e.g.:
landcover_berlin_polygon@"level_3_id"
Note that the vector field is automatically rasterized into the destination Grid.
A raster mask, is a predefined boolean array, which evaluates to False for every pixel containing the no data value, nan or inf. All other pixel evaluate to True.
Use the <layer name>Mask
syntax to access the 3d binary mask for all bands,
and the <layer name>Mask@<band number>
syntax for a 2d single band mask.
2d mask array for a single band: enmap_berlinMask@655nm
A vector mask, is a predefined boolean array, which evaluates to True for every pixel covered by a geometry.
All other pixel evaluate to False.
Use the <layer name>
syntax to access the 2d binary mask.
2d mask array for a vector layer: landcover_berlin_polygon
- Example - mask a raster using a polygon-vector
enmap_berlin * landcover_berlin_polygon
Note that the output raster is correctly masked, but we haven’t set an appropriate no data value, nor have we taken care of wavelength information or any other metadata. To properly do this, we need to use multi-line code fragments.
The computation is done block-wise by default to be memory efficient.
The actual block size depends on the system memory.
In rare cases it may be helpful to get some information about the current block, using the special variable block
.
get the current block extent:
block.extent
:<QgsRectangle: 380952.36999999999534339 5808372.34999999962747097, 387552.36999999999534339 5820372.34999999962747097>get the current block x/y offset:
block.xOffset, block.yOffset
:0, 0get the current block x/y size:
block.width, block.height
:220, 400
If the computation involves a spatial operation, e.g. a spatial convolution filter with a kernel, be sure to also specify a proper Block overlap. E.g. for a 5x5 kernel, set at least a block overlap of 2 pixel.
In cases where the spatial operation is not locally limitted to a fixed spatial neightbourhood, e.g. region growing or segmentation, Monolithic processing can be activated, where all data is processed in one big block.
To enable more complex computations, multiple outputs and metadata handling, we can use multi-line code fragments.
- Example - calculate the NDVI index
In this example we first specify
_nir
and_red
variables to then calculate the_ndvi
, which we pass to the specialoutputRaster
identifier, that is associated with the Output raster layer:nir_ = enmap_berlin@865nm red_ = enmap_berlin@655nm ndvi_ = (nir_ - red_) / (nir_ + red_) outputRaster = ndvi_
The underscore postfix
_
marks thenir_
,red_
andndvi_
variables as temporary. Instead ofnir_
we can also use_nir
,tmp_nir
ortemp_nir
.The explicite assignment
outputRaster = ndvi_
can be avoided, by selecting an Output raster layer file destination, where the file basename (without extension) matches the variable name, e.g. c:/ndvi.tif:nir_ = enmap_berlin@865nm red_ = enmap_berlin@655nm ndvi = (nir_ - red_) / (nir_ + red_) # ndvi matches with c:/ndvi.tif
If the file basename isn’t matching correctly, you will get the following error message inside the Log panel:
The following layers were not correctly generated. • C:/Users/Andreas/AppData/Local/Temp/processing_BVyjbt/3a6c795d9a594937acf441c5a372f448/outputRaster.tif You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.
Instead of using temporary variables, you can also just delete unwanted variables as a last step:
nir = enmap_berlin@865nm red = enmap_berlin@655nm ndvi = (nir - red) / (nir + red) del nir, red # delete temporary variables manually
- Example - calculate multiple outputs
To calculate multiple outputs, just define multiple non-temporary variables:
N = enmap_berlin@865nm / 1e4 # EVI needs data scaled to 0-1 range R = enmap_berlin@655nm / 1e4 B = enmap_berlin@482nm / 1e4 ndvi = (N - R) / (N + R) evi = 2.5 * (N - R) / (N + 6 * R - 7.5 * B + 1) del N, R, B
Note that you can only specify the file destination of one of the outputs, e.g. by setting Output raster layer to c:/results/ndvi.tif or c:/results/evi.tif. The other output is written into the same directory as a GeoTiff with the basename matching the variable name c:/results/<basename>.tif.
You may also keep the default file destination [Save to temporary file] as is, to write all outputs into a temp folder. In this case, it is fine to just ignore the error message:
The following layers were not correctly generated. • C:/Users/Andreas/AppData/Local/Temp/processing_BVyjbt/3a6c795d9a594937acf441c5a372f448/outputRaster.tif You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.
You have full access to the underlying raster metadata like:
band no data value:
enmap_berlin.noDataValue(bandNo=1)
:-99.0
band name:
enmap_berlin.bandName(bandNo=1)
:band 8 (0.460000 Micrometers)
band-level metadata dictionary:
enmap_berlin.metadata(bandNo=1)
:{'': {'wavelength': '0.460000', 'wavelength_units': 'Micrometers'}}
band-level metadata item:
enmap_berlin.metadataItem(key='wavelength_units', domain='', bandNo=1)
:Micrometers
dataset-level metadata dictionary:
enmap_berlin.metadata()
:{'IMAGE_STRUCTURE': {'INTERLEAVE': 'BAND'}, '': {'wavelength_units': 'Micrometers'}, 'ENVI': {'acquisition_time': '2009-08-20T09:44:50', 'bands': '177', 'band_names': ['band 8', 'band 9', 'band 10', 'band 11', 'band 12', 'band 13', 'band 14', 'band 15', 'band 16', 'band 17', 'band 18', 'band 19', 'band 20', 'band 21', 'band 22', 'band 23', 'band 24', 'band 25', 'band 26', 'band 27', 'band 28', 'band 29', 'band 30', 'band 31', 'band 32', 'band 33', 'band 34', 'band 35', 'band 36', 'band 37', 'band 38', 'band 39', 'band 40', 'band 41', 'band 42', 'band 43', 'band 44', 'band 45', 'band 46', 'band 47', 'band 48', 'band 49', 'band 50', 'band 51', 'band 52', 'band 53', 'band 54', 'band 55', 'band 56', 'band 57', 'band 58', 'band 59', 'band 60', 'band 61', 'band 62', 'band 63', 'band 64', 'band 65', 'band 66', 'band 67', 'band 68', 'band 69', 'band 70', 'band 71', 'band 72', 'band 73', 'band 74', 'band 75', 'band 76', 'band 77', 'band 91', 'band 92', 'band 93', 'band 94', 'band 95', 'band 96', 'band 97', 'band 98', 'band 99', 'band 100', 'band 101', 'band 102', 'band 103', 'band 104', 'band 105', 'band 106', 'band 107', 'band 108', 'band 109', 'band 110', 'band 111', 'band 112', 'band 113', 'band 114', 'band 115', 'band 116', 'band 117', 'band 118', 'band 119', 'band 120', 'band 121', 'band 122', 'band 123', 'band 124', 'band 125', 'band 126', 'band 127', 'band 144', 'band 145', 'band 146', 'band 147', 'band 148', 'band 149', 'band 150', 'band 151', 'band 152', 'band 153', 'band 154', 'band 155', 'band 156', 'band 157', 'band 158', 'band 159', 'band 160', 'band 161', 'band 162', 'band 163', 'band 164', 'band 165', 'band 166', 'band 167', 'band 168', 'band 195', 'band 196', 'band 197', 'band 198', 'band 199', 'band 200', 'band 201', 'band 202', 'band 203', 'band 204', 'band 205', 'band 206', 'band 207', 'band 208', 'band 209', 'band 210', 'band 211', 'band 212', 'band 213', 'band 214', 'band 215', 'band 216', 'band 217', 'band 218', 'band 219', 'band 220', 'band 221', 'band 222', 'band 223', 'band 224', 'band 225', 'band 226', 'band 227', 'band 228', 'band 229', 'band 230', 'band 231', 'band 232', 'band 233', 'band 234', 'band 235', 'band 236', 'band 237', 'band 238', 'band 239'], 'byte_order': '0', 'coordinate_system_string': ['PROJCS["UTM_Zone_33N"', 'GEOGCS["GCS_WGS_1984"', 'DATUM["D_WGS_1984"', 'SPHEROID["WGS_1984"', '6378137.0', '298.257223563]]', 'PRIMEM["Greenwich"', '0.0]', 'UNIT["Degree"', '0.0174532925199433]]', 'PROJECTION["Transverse_Mercator"]', 'PARAMETER["False_Easting"', '500000.0]', 'PARAMETER["False_Northing"', '0.0]', 'PARAMETER["Central_Meridian"', '15.0]', 'PARAMETER["Scale_Factor"', '0.9996]', 'PARAMETER["Latitude_Of_Origin"', '0.0]', 'UNIT["Meter"', '1.0]]'], 'data_ignore_value': '-99', 'data_type': '2', 'description': ['EnMAP02_Berlin_Urban_Gradient_2009.bsq', 'http://doi.org/10.5880/enmap.2016.008', 'spectral and spatial subset'], 'file_type': 'ENVI Standard', 'fwhm': ['0.005800', '0.005800', '0.005800', '0.005800', '0.005800', '0.005800', '0.005800', '0.005800', '0.005800', '0.005800', '0.005900', '0.005900', '0.006000', '0.006000', '0.006100', '0.006100', '0.006200', '0.006200', '0.006300', '0.006400', '0.006400', '0.006500', '0.006600', '0.006600', '0.006700', '0.006800', '0.006900', '0.006900', '0.007000', '0.007100', '0.007200', '0.007300', '0.007300', '0.007400', '0.007500', '0.007600', '0.007700', '0.007800', '0.007900', '0.007900', '0.008000', '0.008100', '0.008200', '0.008300', '0.008400', '0.008400', '0.008500', '0.008600', '0.008700', '0.008700', '0.008800', '0.008900', '0.008900', '0.009000', '0.009100', '0.009100', '0.009200', '0.009300', '0.009300', '0.009400', '0.009400', '0.009500', '0.009500', '0.009600', '0.009600', '0.009600', '0.009600', '0.009700', '0.009700', '0.009700', '0.011800', '0.011900', '0.012100', '0.012200', '0.012400', '0.012500', '0.012700', '0.012800', '0.012900', '0.013100', '0.013200', '0.013300', '0.013400', '0.013500', '0.013600', '0.013700', '0.013800', '0.013900', '0.014000', '0.014000', '0.014100', '0.014100', '0.014200', '0.014200', '0.014300', '0.014300', '0.014300', '0.014400', '0.014400', '0.014400', '0.014400', '0.014400', '0.014400', '0.014400', '0.014400', '0.014400', '0.014400', '0.013700', '0.013600', '0.013600', '0.013500', '0.013500', '0.013400', '0.013400', '0.013300', '0.013200', '0.013200', '0.013100', '0.013100', '0.013000', '0.012900', '0.012900', '0.012800', '0.012800', '0.012700', '0.012700', '0.012600', '0.012500', '0.012500', '0.012400', '0.012400', '0.012300', '0.010900', '0.010800', '0.010800', '0.010700', '0.010700', '0.010600', '0.010600', '0.010500', '0.010500', '0.010400', '0.010400', '0.010400', '0.010300', '0.010300', '0.010200', '0.010200', '0.010100', '0.010100', '0.010100', '0.010000', '0.010000', '0.009900', '0.009900', '0.009900', '0.009800', '0.009800', '0.009700', '0.009700', '0.009700', '0.009600', '0.009600', '0.009600', '0.009500', '0.009500', '0.009400', '0.009400', '0.009400', '0.009300', '0.009300', '0.009300', '0.009200', '0.009200', '0.009100', '0.009100', '0.009100'], 'header_offset': '0', 'interleave': 'bsq', 'lines': '400', 'reflectance_scale_factor': '10000', 'samples': '220', 'sensor_type': 'Unknown', 'wavelength': ['0.460000', '0.465000', '0.470000', '0.475000', '0.479000', '0.484000', '0.489000', '0.494000', '0.499000', '0.503000', '0.508000', '0.513000', '0.518000', '0.523000', '0.528000', '0.533000', '0.538000', '0.543000', '0.549000', '0.554000', '0.559000', '0.565000', '0.570000', '0.575000', '0.581000', '0.587000', '0.592000', '0.598000', '0.604000', '0.610000', '0.616000', '0.622000', '0.628000', '0.634000', '0.640000', '0.646000', '0.653000', '0.659000', '0.665000', '0.672000', '0.679000', '0.685000', '0.692000', '0.699000', '0.706000', '0.713000', '0.720000', '0.727000', '0.734000', '0.741000', '0.749000', '0.756000', '0.763000', '0.771000', '0.778000', '0.786000', '0.793000', '0.801000', '0.809000', '0.817000', '0.824000', '0.832000', '0.840000', '0.848000', '0.856000', '0.864000', '0.872000', '0.880000', '0.888000', '0.896000', '0.915000', '0.924000', '0.934000', '0.944000', '0.955000', '0.965000', '0.975000', '0.986000', '0.997000', '1.007000', '1.018000', '1.029000', '1.040000', '1.051000', '1.063000', '1.074000', '1.086000', '1.097000', '1.109000', '1.120000', '1.132000', '1.144000', '1.155000', '1.167000', '1.179000', '1.191000', '1.203000', '1.215000', '1.227000', '1.239000', '1.251000', '1.263000', '1.275000', '1.287000', '1.299000', '1.311000', '1.323000', '1.522000', '1.534000', '1.545000', '1.557000', '1.568000', '1.579000', '1.590000', '1.601000', '1.612000', '1.624000', '1.634000', '1.645000', '1.656000', '1.667000', '1.678000', '1.689000', '1.699000', '1.710000', '1.721000', '1.731000', '1.742000', '1.752000', '1.763000', '1.773000', '1.783000', '2.044000', '2.053000', '2.062000', '2.071000', '2.080000', '2.089000', '2.098000', '2.107000', '2.115000', '2.124000', '2.133000', '2.141000', '2.150000', '2.159000', '2.167000', '2.176000', '2.184000', '2.193000', '2.201000', '2.210000', '2.218000', '2.226000', '2.234000', '2.243000', '2.251000', '2.259000', '2.267000', '2.275000', '2.283000', '2.292000', '2.300000', '2.308000', '2.315000', '2.323000', '2.331000', '2.339000', '2.347000', '2.355000', '2.363000', '2.370000', '2.378000', '2.386000', '2.393000', '2.401000', '2.409000'], 'wavelength_units': 'Micrometers', 'y_start': '24', 'z_plot_titles': ['wavelength [!7l!3m]!N', 'reflectance [*10000]']}}}
dataset-level metadata item:
enmap_berlin.metadataItem(key='wavelength_units', domain='')
:Micrometers
In general, all the methods provided by the RasterReader class can be used: https://github.com/EnMAP-Box/enmap-box/blob/main/enmapboxprocessing/rasterreader.py
For outputs you can use all the methods provided by the RasterWriter class: https://github.com/EnMAP-Box/enmap-box/blob/main/enmapboxprocessing/rasterwriter.py
Also note the shortcuts inside the Available data sources tab context menu and the Data / Metadata tab.
- Example - calculate the NDVI index and set up metadata properly
This example shows how to properly calculate the NDVI index, masking no data pixel and set up output metadata:
# find bands red = enmap_berlin@655nm nir = enmap_berlin@865nm # calculate NDVI ndvi = (nir - red) / (nir + red) # mask no data region noDataValue = -9999 ndvi[~enmap_berlinMask@655nm] = noDataValue ndvi[~enmap_berlinMask@865nm] = noDataValue # set no data value and band name ndvi.setNoDataValue(noDataValue) ndvi.setBandName('NDVI', bandNo=1) # clean up temp variables del red, nir
- Example - copy raster data and metadata
This example shows how to properly copy a raster data and metadata:
# copy data copy = enmap_berlin # copy metadata copy.setMetadata(enmap_berlin.metadata()) for bandNo in enmap_berlin.bandNumbers(): copy.setMetadata(enmap_berlin.metadata(bandNo), bandNo) copy.setBandName(enmap_berlin.bandName(bandNo), bandNo) copy.setNoDataValue(enmap_berlin.noDataValue(bandNo), bandNo)
For some operations, we may need to input an arbitrary large list of rasters. Use the Raster layers mapped to RS in this case.
- Example - average a list of rasters
np.mean(RS, axis=0)
As for normal input raster, use the RSMask
syntax to access the binary no data value masks.
Regression Dataset Manager¶
todo
Regression Workflow (deprecated)¶
See also
Have a look at the Biomass Mapping Tutorial for a use case example of the Regression Workflow Application.
Input Parameters:
Training Inputs
- Raster: Specify input raster based on which samples will be drawn for training a regressor.
- Reference: Specify vector or raster dataset with reference information (regression target). In case of vector input, dataset has to have a numeric column in the attribute table with a target variable of interest. This vector dataset is rasterized/burned on-the-fly onto the grid of the input raster in order to extract the sample. If the vector source is a polygon dataset, all pixels will be drawn which intersect the polygon.
- Attribute: Attribute field in the reference vector layer which contains the regression target variable.
Sampling
Number of Strata
: Specify the desired number of strata sampling. If you don’t want to use stratified sampling, just enter
1
.Min & Max: Defines the value range in which samples should be drawn.
Sample size
: Specify the sample size per stratum, either relative in percent or in absolute pixel counts.
Every stratum is listed below with the value range that is covered by this stratum depicted in square brackets (e.g.,
Stratum 1: [1.0, 4.33]
). Furthermore, you can see and alter the number of pixels/samples for each stratum using thespinboxes.
Save sample: Activate this option and specify an output path to save the sample as a raster.
Training
In the Regressor
dropdown menu you can choose different regressors (e.g. Random Forest, Support Vector Regression, Kernel Ridge Regression)
Model parameters: Specify the parameters of the selected regressor.
Hint
Scikit-learn python syntax is used here, which means you can specify model parameters accordingly. Have a look at the scikit-learn documentation on the individual parameters, e.g. for the RandomForestRegressor
Save model: Activate this option to save the model file (
.pkl
) to disk.
Mapping
- Input Raster: Specify the raster you would like to apply the trained regressor to (usually -but not necessarily- this is the same as used for training)
Cross-validation Accuracy Assessment
Spectral Index Creator¶
todo
Example Data¶
Note
For opening the dataset go to the menubar

If you try to open the dataset for the first time, you will be asked to download the data from the repository:

After you downloaded the dataset, you can also use the processing algorithm Open Test Maps (in Auxillary) to open the dataset.
EnMAP (30m; 177 bands):
File name: enmap_berlin.bsq
Simulated EnMAP data (based on 3.6m HyMap imagery) acquired in August 2009 over south eastern part of Berlin. It has a spectral resolution of 177 bands and a spatial resolution of 30m.
HyMap (3.6m; Blue, Green, Red bands)
File name: hires_berlin.bsq
HyMap image acquired in August 2009 over south eastern part of Berlin. This dataset was reduced to 3 bands for true color display. The spatial resolution is 3.6m.
LandCover Vector Layer (Polygon):
File name: landcover_berlin_polygon.gpkg
Polygon vector geopackage containing land cover information on three classification levels. Derived from very high resolution aerial imagery and cadastral datasets.
- Level 1 classes: Impervious, Vegetation, Soil, Water
- Level 2 classes: Impervious, Low Vegetation, Soil, Tree, Water
- Level 3 classes: Roof, Pavement, Low Vegetation, Soil, Tree, Water
LandCover Vector Layer (Point):
File name: landcover_berlin_point.shp
Point vector geopackage containing land cover information on two classification levels.
- Level 1 classes: Impervious, Vegetation, Soil, Water
- Level 2 classes: Impervious, Low Vegetation, Soil, Tree, Water
Spectral Library:
File name: library_berlin.sli
Spectral library with 75 spectra (material level, level 2 and level 3 class information)
Earth Observation for QGIS (EO4Q)¶
Earth Observation for QGIS (EO4Q) is a collection of EnMAP-Box tools and applications designed to integrate well in both, EnMAP-Box and QGIS environments. In both environments, EO4Q applications can be started from the Earth Observation for QGIS (EO4Q) Toolbar:
GEE Time Series Explorer¶
The GEE Time Series Exlorer integrates Google Earth Engine (GEE) into QGIS/EnMAP-Box. It allows the interactive exploration of temporal raster data available in the Earth Engine Data Catalog .
A first version of the GEE Time Series Exlorer was released as a QGIS plugin. Future versions will be maintained as an EO4Q application that integrates into QGIS and EnMAP-Box GUI.
- Live demonstration
- Slides from the Living Planet Symposium 2022 talk in Bonn, Germany
- Janz, A. et al. (2022, May 26). GEE Time Series Explorer: Planetary-scale visualization and temporal profile sampling of EO imagery from the Earth Engine Data Catalog in QGIS and the EnMAP-Box [oral presentation]. Living Planet Symposium, Bonn, Germany
- How to cite
- Rufin, P., Rabe, A., Nill, L., and Hostert, P. (2021) GEE TIMESERIES EXPLORER FOR QGIS - INSTANT ACCESS TO PETABYTES OF EARTH OBSERVATION DATA , Int. Arch. Photogramm. Remote Sens. Spatial Inf. Sci., XLVI-4/W2-2021, 155-158, https://doi.org/10.5194/isprs-archives-XLVI-4-W2-2021-155-2021, 2021.
- Prerequisite
- The GEE Time Series Exlorer depends on the QGIS Google Earth Engine plugin . In order to access Earth Engine, you must have an Google account that is authorized for Earth Engine. If you haven’t used Earth Engine so far, the easiest way to make sure that everything is working on your system, is to follow the instruction here: https://gee-community.github.io/qgis-earthengine-plugin/
- Usage
- Load a collection, plot a temporal profile and visualize an image
- Select the Landsat 8 Surface Reflectance collection in the Data Catalog tab of the main panel.
- Select the NDVI band in the Profile Viewer panel.
- Activate the Current Location map tool |icon_location| and select a location on the map. This will plot the temporal profile for that location in the Profile Viewer panel.
- Select a data point in the plot to visualize the associated image. The image is displayed in it’s default visualization.
- Improve image contrast stretch
The default visualization may give a poor image contrast, which you may want to improve. In the Band Rendering tab of the main panel, you may set suitable min/max values manually, or specify lower/upper percentile cut off values, e.g. 2% to 98%. Note that the statistics are calculated for the current map extent.
- Visualize derived vegetation indices
Beside visualizing original image bands in Multiband color RGB, it is possible to visualize derived vegetation indices.
- Prepare a cloud-free composite
To create a composite that aggregates all images in a given date range, we just switch from Image Selection mode to Composite Selection mode in the Profile Viewer panel. In the plot we can now select a date range and create our first, very cloudy, composite. By applying a Pixel Quality Filter we can easily exclude all pixel affected by cloud and cloud shadow. And finally, we can improve the contrast stretch of the visualization.
Location Browser¶
The Location Browser panel allows to a) navigate to a map location directly, or to b) send a request to the Nominatim geocoding service.
- Usage
Start the tool from the View > Panels > Location Browser menu or from the Earth Observation for QGIS (EO4Q) Toolbar.
Go to locations directly by entering the coordinates in one of the following formats:
53.07478793449, 13.895089018465338
(longitude, latitude in decimal format)53°04'29.2"N, 13°53'42.3"E
(longitude, latitude in GPS format)13.895089018465338, 53.07478793449, [EPSG:4326]
(east, north, EPSG ID)
Or send a request to the Nominatim geocoding service and explore the results:
berlin
(free-form textual description of the location to be geocoded)
- GUI
- Live demonstration
Profile Analytics¶
The Profile Analytics panel allows to visualize various types of spectral, temporal and spatial profiles. Additionally, profile data can be analysed by user-defined functions (ufuncs). A ufunc has access to the plot widget and can draw additional plot items.
- Usage
Start the tool from the View > Panels > Profile Analytics menu or from the Earth Observation for QGIS (EO4Q) Toolbar.
Select the Source type, that is providing the profiles. Note that we’re currently only support raster layer as source, but we plan to have other sources like profiles from the GEE Time Series Explorer.
Select the Profile type you want to extract from the raster layer:
Select a Raster.
In case of a spatial profile (i.e. X-Profile, Y-Profile and Profile along a line), also select a Band. In case of a Z-Profile), the selected band is ignored.
Style the profile.
Apply data Scaling.
Choose an ufunc to perform Analytics on the profile data and add extra plot annotations. The ufunc has full access to the plot widget and can add plot items like:
- plot line (e.g. fitted data, vegetation regrowth, trend lines, etc.)
- plot marker symbols (e.g. forest clear cut events, mowing events, fire events, red-edge inflection point, etc.)
- plot text
- insert images
Examples can be found under
/enmapbox/eo4qapps/profileanalyticsapp/examples/
.Depending on the Profile type and availability of raster metadata, different X Axis units can be choosen:
Z-Profile values:
- can always be plotted against Band Numbers
- can be plotted against Wavelength, if band center wavelength is specified
- can be plotted against Date Time, if band (aquisition) date time is specified
X-Profile values are always plotted against the Column Number.
Y-Profile values are always plotted against the Row Number.
Profile along a line values are always plotted against the Distance from line start.
In case of X-Profile, Y-Profile and Z-Profile, use the Cursor Location map tool to select a location that specifies the profile.
In case of Profile along a line, use the Select Feature map tool to select a line-vector feature that specifies the profile.
- GUI
- Spectral Z-Profile
- Temporal Z-Profiles
- Temporal Z-Profile annotated with a Support Vector Regression fit (
svr_fitting.py
used as ufunc)
- Live demonstration
Raster Band Stacking¶
The Raster Band Stacking panel allows to stack bands into a new VRT raster layer. Raster bands can be selected inside the panel or added via drag&drop in various ways.
- Usage
- Start the tool from the View > Panels > Raster Band Stacking menu or from the Earth Observation for QGIS (EO4Q) Toolbar.
- Add raster sources and select bands:
- add a new raster source via the “+” button
- select raster(s) inside the Data Sources panel and drag&drop the selection into the table
- select band(s) inside the Data Sources panel and drag&drop the selection into the table
- select raster layer(s) inside the Data Views panel and drag&drop the selection into the table
- select raster files inside the file explorer (e.g. Windows Explorer) and drag&drop the selection into the table
- Prepare the final band stack inside the table by:
- changing individual band selections
- removing rows
- moving rows up and down
- Choose an output filename and create the band stack. By default, the output pixel grid (i.e. extent, resolution, crs) is derived automatically (i.e. gdal.BuildVrt defaults). To use a custom pixel grid, switch to the Raster option and select a raster.
- GUI
- Live demonstration
Sensor Product Import¶
The Sensor Product Import panel allows to import various sensor products via drag&drop. E.g. a downloaded Landsat product can be imported as is:
- Landsat 9 Product Example
All the surface reflectance bands are automatically stacked, band offset and scaling factors are applied, and proper metadata, like center wavelength and band names, are specified.
- Usage
- Start the tool from the View > Panels > Sensor Product Import menu or from the Earth Observation for QGIS (EO4Q) Toolbar.
- Drag&drop the product folder, or any file inside the product folder, into the Drop Product Here area.
- Run the import algorithm. Note that the result is stored next to the source product. When opening the product for the next time, this algorithm is not shown.
- Visualize the result raster.
- GUI
- Live demonstration
Processing Algorithms¶
Auxilliary¶
Create a paletted raster renderer from given categories and set it as the default style of the given raster layer. This will create/overwrite the QML sidecar file of the given raster layer.
Parameters
- Raster layer [raster]
- The raster layer for which to create the QML sidecar file.
- Band [band]
- The renderer band.
- Categories [string]
- Comma separated list of tuples with category value, name and color information. E.g. (1, ‘Urban’, ‘#FF0000’), (2, ‘Forest’, ‘#00FF00’), (3, ‘Water’, ‘#0000FF’)
Command-line usage
>qgis_process help enmapbox:CreateDefaultPalettedRasterRenderer
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
band: Band
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
categories: Categories
Argument type: string
Acceptable values:
- String value
----------------
Outputs
----------------
Classification¶
Rasterize a categorized vector layer into class fractions. Categories are rasterized at a x10 finer resolution and aggregated to class-wise fractions at destination resolution. This approach leads to fractions that are accurate to the percent.
Parameters
- Categorized vector layer [vector]
- A categorized vector layer to be rasterized.
- Grid [raster]
- The target grid.
Outputs
- Output class fraction layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:ClassFractionLayerFromCategorizedVectorLayer
:
----------------
Arguments
----------------
categorizedVector: Categorized vector layer
Argument type: vector
Acceptable values:
- Path to a vector layer
grid: Grid
Argument type: raster
Acceptable values:
- Path to a raster layer
outputFraction: Output class fraction layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputFraction: <outputRaster>
Output class fraction layer
Estimates map accuracy and area proportions for (simple) random sampling. We use the formulars for the stratified random sampling described in Stehman (2014): https://doi.org/10.1080/01431161.2014.930207. Note that (simple) random sampling is a special case of stratified random sampling, with exactly one stratum. Observed and predicted categories are matched by name.
Parameters
- Predicted classification layer [raster]
- A classification layer that is to be assessed.
- Observed categorized layer [layer]
- A categorized layer representing a (ground truth) observation sample, that was aquired using a (simple) random sampling approach.
- Open output report in webbrowser after running algorithm [boolean]
Whether to open the output report in the web browser.
Default: True
Outputs
- Output report [fileDestination]
- Report file destination.
Command-line usage
>qgis_process help enmapbox:ClassificationLayerAccuracyAndAreaReportForSimpleRandomSampling
:
----------------
Arguments
----------------
classification: Predicted classification layer
Argument type: raster
Acceptable values:
- Path to a raster layer
reference: Observed categorized layer
Argument type: layer
Acceptable values:
- Path to a vector, raster or mesh layer
openReport: Open output report in webbrowser after running algorithm
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outClassificationPerformance: Output report
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outClassificationPerformance: <outputHtml>
Output report
Estimates map accuracy and area proportions for stratified random sampling as described in Stehman (2014): https://doi.org/10.1080/01431161.2014.930207. Observed and predicted categories are matched by name.
Parameters
- Predicted classification layer [raster]
- A classification layer that is to be assessed.
- Observed categorized layer [layer]
- A categorized layer representing a (ground truth) observation sample, that was aquired using a stratified random sampling approach.
- Stratification layer [layer]
- A stratification layer that was used for drawing the observation sample. If not defined, the classification layer is used as stratification layer.
- Open output report in webbrowser after running algorithm [boolean]
Whether to open the output report in the web browser.
Default: True
Outputs
- Output report [fileDestination]
- Report file destination.
Command-line usage
>qgis_process help enmapbox:ClassificationLayerAccuracyAndAreaReportForStratifiedRandomSampling
:
----------------
Arguments
----------------
classification: Predicted classification layer
Argument type: raster
Acceptable values:
- Path to a raster layer
reference: Observed categorized layer
Argument type: layer
Acceptable values:
- Path to a vector, raster or mesh layer
stratification: Stratification layer (optional)
Argument type: layer
Acceptable values:
- Path to a vector, raster or mesh layer
openReport: Open output report in webbrowser after running algorithm
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outClassificationPerformance: Output report
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outClassificationPerformance: <outputHtml>
Output report
Creates classification layer from class probability layer or class fraction layer. Winner class is given by the class with maximum class probabiliy/fraction.
Parameters
- Class probability layer [raster]
- A class probability layer or class fraction layer to be classified.
Outputs
- Output classification layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:ClassificationLayerFromClassProbabilityfractionLayer
:
----------------
Arguments
----------------
probability: Class probability layer
Argument type: raster
Acceptable values:
- Path to a raster layer
outputClassification: Output classification layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputClassification: <outputRaster>
Output classification layer
The classification workflow combines classifier fitting, map prediction and accuracy assessment.
Parameters
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier.
- Classifier [string]
- Scikit-Learn Python code specifying a classifier.
- Raster layer with features [raster]
- A raster layer with bands used as features.
- Number of cross-validation folds [number]
The number of folds used for assessing cross-validation performance.
Default: 10
- Open output report in webbrowser after running algorithm [boolean]
Whether to open the output report in the web browser.
Default: True
Outputs
- Output classifier [fileDestination]
- Pickle file destination.
- Output classification layer [rasterDestination]
- Raster file destination.
- Output class probability layer [rasterDestination]
- Raster file destination.
- Output classifier performance report [fileDestination]
- Report file destination.
Command-line usage
>qgis_process help enmapbox:ClassificationWorkflow
:
----------------
Arguments
----------------
dataset: Training dataset
Argument type: file
Acceptable values:
- Path to a file
classifier: Classifier
Argument type: string
Acceptable values:
- String value
raster: Raster layer with features
Argument type: raster
Acceptable values:
- Path to a raster layer
nfold: Number of cross-validation folds (optional)
Default value: 10
Argument type: number
Acceptable values:
- A numeric value
openReport: Open output report in webbrowser after running algorithm
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputClassifier: Output classifier
Argument type: fileDestination
Acceptable values:
- Path for new file
outputClassification: Output classification layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputProbability: Output class probability layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputClassifierPerformance: Output classifier performance report (optional)
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassifier: <outputFile>
Output classifier
outputClassification: <outputRaster>
Output classification layer
outputProbability: <outputRaster>
Output class probability layer
outputClassifierPerformance: <outputHtml>
Output classifier performance report
Evaluates classifier performance.
Parameters
- Classifier [file]
- Classifier pickle file.
- Test dataset [file]
- Test dataset pickle file used for assessing the classifier performance.
- Number of cross-validation folds [number]
- The number of folds used for assessing cross-validation performance. If not specified (default), simple test performance is assessed.
- Open output report in webbrowser after running algorithm [boolean]
Whether to open the output report in the web browser.
Default: True
Outputs
- Output report [fileDestination]
- Report file destination.
Command-line usage
>qgis_process help enmapbox:ClassifierPerformanceReport
:
----------------
Arguments
----------------
classifier: Classifier
Argument type: file
Acceptable values:
- Path to a file
dataset: Test dataset
Argument type: file
Acceptable values:
- Path to a file
nfold: Number of cross-validation folds (optional)
Argument type: number
Acceptable values:
- A numeric value
openReport: Open output report in webbrowser after running algorithm
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputClassifierPerformance: Output report
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassifierPerformance: <outputHtml>
Output report
Implementation of the scikit-learn API for CatBoost classifier.
Parameters
- Classifier [string]
Scikit-learn python code. See CatBoostClassifier for information on different parameters.
Default:
from catboost import CatBoostClassifier classifier = CatBoostClassifier(n_estimators=100)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output classifier [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitCatboostclassifier
:
----------------
Arguments
----------------
classifier: Classifier
Default value: from catboost import CatBoostClassifier
classifier = CatBoostClassifier(n_estimators=100)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputClassifier: Output classifier
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassifier: <outputFile>
Output classifier
Gaussian process classification (GPC) based on Laplace approximation. The implementation is based on Algorithm 3.1, 3.2, and 5.1 of Gaussian Processes for Machine Learning (GPML) by Rasmussen and Williams. Internally, the Laplace approximation is used for approximating the non-Gaussian posterior by a Gaussian. Currently, the implementation is restricted to using the logistic link function. For multi-class classification, several binary one-versus rest classifiers are fitted. Note that this class thus does not implement a true multi-class Laplace approximation. See Gaussian Processes for further information.
Parameters
- Classifier [string]
Scikit-learn python code. See GaussianProcessClassifier for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from sklearn.gaussian_process import GaussianProcessClassifier from sklearn.gaussian_process.kernels import RBF gpc = GaussianProcessClassifier(RBF(), max_iter_predict=1) classifier = make_pipeline(StandardScaler(), gpc)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output classifier [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitGaussianprocessclassifier
:
----------------
Arguments
----------------
classifier: Classifier
Default value: from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.gaussian_process import GaussianProcessClassifier
from sklearn.gaussian_process.kernels import RBF
gpc = GaussianProcessClassifier(RBF(), max_iter_predict=1)
classifier = make_pipeline(StandardScaler(), gpc)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputClassifier: Output classifier
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassifier: <outputFile>
Output classifier
A generic classifier.
Parameters
- Classifier [string]
Scikit-learn python code.
Default:
from sklearn.dummy import DummyClassifier classifier = DummyClassifier()
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output classifier [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitGenericClassifier
:
----------------
Arguments
----------------
classifier: Classifier
Default value: from sklearn.dummy import DummyClassifier
classifier = DummyClassifier()
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputClassifier: Output classifier
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassifier: <outputFile>
Output classifier
Implementation of the scikit-learn API for LightGBM classifier.
Parameters
- Classifier [string]
Scikit-learn python code. See LGBMClassifier for information on different parameters.
Default:
from lightgbm import LGBMClassifier classifier = LGBMClassifier(n_estimators=100)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output classifier [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitLgbmclassifier
:
----------------
Arguments
----------------
classifier: Classifier
Default value: from lightgbm import LGBMClassifier
classifier = LGBMClassifier(n_estimators=100)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputClassifier: Output classifier
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassifier: <outputFile>
Output classifier
Linear Support Vector Classification. Similar to SVC with parameter kernel=’linear’, but implemented in terms of liblinear rather than libsvm, so it has more flexibility in the choice of penalties and loss functions and should scale better to large numbers of samples. This class supports both dense and sparse input and the multiclass support is handled according to a one-vs-the-rest scheme.
Parameters
- Classifier [string]
Scikit-learn python code. See LinearSVC, GridSearchCV, StandardScaler for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.model_selection import GridSearchCV from sklearn.preprocessing import StandardScaler from sklearn.svm import LinearSVC svc = LinearSVC() param_grid = {'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]} tunedSVC = GridSearchCV(cv=3, estimator=svc, scoring='f1_macro', param_grid=param_grid) classifier = make_pipeline(StandardScaler(), tunedSVC)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output classifier [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitLinearsvc
:
----------------
Arguments
----------------
classifier: Classifier
Default value: from sklearn.pipeline import make_pipeline
from sklearn.model_selection import GridSearchCV
from sklearn.preprocessing import StandardScaler
from sklearn.svm import LinearSVC
svc = LinearSVC()
param_grid = {'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]}
tunedSVC = GridSearchCV(cv=3, estimator=svc, scoring='f1_macro', param_grid=param_grid)
classifier = make_pipeline(StandardScaler(), tunedSVC)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputClassifier: Output classifier
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassifier: <outputFile>
Output classifier
Logistic Regression (aka logit, MaxEnt) classifier. In the multiclass case, the training algorithm uses the one-vs-rest (OvR) scheme if the ‘multi_class’ option is set to ‘ovr’, and uses the cross-entropy loss if the ‘multi_class’ option is set to ‘multinomial’.
Parameters
- Classifier [string]
Scikit-learn python code. See LogisticRegression for information on different parameters.
Default:
from sklearn.linear_model import LogisticRegression from sklearn.preprocessing import StandardScaler from sklearn.pipeline import make_pipeline logisticRegression = LogisticRegression() classifier = make_pipeline(StandardScaler(), logisticRegression)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output classifier [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitLogisticregression
:
----------------
Arguments
----------------
classifier: Classifier
Default value: from sklearn.linear_model import LogisticRegression
from sklearn.preprocessing import StandardScaler
from sklearn.pipeline import make_pipeline
logisticRegression = LogisticRegression()
classifier = make_pipeline(StandardScaler(), logisticRegression)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputClassifier: Output classifier
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassifier: <outputFile>
Output classifier
A random forest classifier. A random forest is a meta estimator that fits a number of decision tree classifiers on various sub-samples of the dataset and uses averaging to improve the predictive accuracy and control over-fitting. The sub-sample size is controlled with the max_samples parameter if bootstrap=True (default), otherwise the whole dataset is used to build each tree.
Parameters
- Classifier [string]
Scikit-learn python code. See RandomForestClassifier for information on different parameters.
Default:
from sklearn.ensemble import RandomForestClassifier classifier = RandomForestClassifier(n_estimators=100, oob_score=True)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output classifier [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitRandomforestclassifier4Modeler
:
----------------
Arguments
----------------
classifier: Classifier
Default value: from sklearn.ensemble import RandomForestClassifier
classifier = RandomForestClassifier(n_estimators=100, oob_score=True)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputClassifier: Output classifier
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassifier: <outputFile>
Output classifier
Spectral Angle Mapper (SAM). Samples are first normalizes to the unit sphere and then classified using nearest neighbour. See Docs Center > Using ENVI > Spectral Angle Mapper for a more details description.
Parameters
- Classifier [string]
Scikit-learn python code. See Normalizer, KNeighborsClassifier for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.preprocessing import Normalizer from sklearn.neighbors import KNeighborsClassifier classifier = make_pipeline(Normalizer(), KNeighborsClassifier(n_neighbors=1))
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output classifier [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitSpectralanglemapper
:
----------------
Arguments
----------------
classifier: Classifier
Default value: from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import Normalizer
from sklearn.neighbors import KNeighborsClassifier
classifier = make_pipeline(Normalizer(), KNeighborsClassifier(n_neighbors=1))
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputClassifier: Output classifier
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassifier: <outputFile>
Output classifier
C-Support Vector Classification. The implementation is based on libsvm. The fit time scales at least quadratically with the number of samples and may be impractical beyond tens of thousands of samples. The multiclass support is handled according to a one-vs-one scheme.
Parameters
- Classifier [string]
Scikit-learn python code. See SVC, GridSearchCV, StandardScaler for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.model_selection import GridSearchCV from sklearn.preprocessing import StandardScaler from sklearn.svm import SVC svc = SVC(probability=False) param_grid = {'kernel': ['poly'], 'coef0': [0], 'degree': [3], 'gamma': [0.001, 0.01, 0.1, 1, 10, 100, 1000], 'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]} tunedSVC = GridSearchCV(cv=3, estimator=svc, scoring='f1_macro', param_grid=param_grid) classifier = make_pipeline(StandardScaler(), tunedSVC)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output classifier [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitSvcPolynomialKernel
:
----------------
Arguments
----------------
classifier: Classifier
Default value: from sklearn.pipeline import make_pipeline
from sklearn.model_selection import GridSearchCV
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC
svc = SVC(probability=False)
param_grid = {'kernel': ['poly'],
'coef0': [0],
'degree': [3],
'gamma': [0.001, 0.01, 0.1, 1, 10, 100, 1000],
'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]}
tunedSVC = GridSearchCV(cv=3, estimator=svc, scoring='f1_macro', param_grid=param_grid)
classifier = make_pipeline(StandardScaler(), tunedSVC)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputClassifier: Output classifier
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassifier: <outputFile>
Output classifier
C-Support Vector Classification. The implementation is based on libsvm. The fit time scales at least quadratically with the number of samples and may be impractical beyond tens of thousands of samples. The multiclass support is handled according to a one-vs-one scheme.
Parameters
- Classifier [string]
Scikit-learn python code. See SVC, GridSearchCV, StandardScaler for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.model_selection import GridSearchCV from sklearn.preprocessing import StandardScaler from sklearn.svm import SVC svc = SVC(probability=False) param_grid = {'kernel': ['rbf'], 'gamma': [0.001, 0.01, 0.1, 1, 10, 100, 1000], 'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]} tunedSVC = GridSearchCV(cv=3, estimator=svc, scoring='f1_macro', param_grid=param_grid) classifier = make_pipeline(StandardScaler(), tunedSVC)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output classifier [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitSvcRbfKernel
:
----------------
Arguments
----------------
classifier: Classifier
Default value: from sklearn.pipeline import make_pipeline
from sklearn.model_selection import GridSearchCV
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVC
svc = SVC(probability=False)
param_grid = {'kernel': ['rbf'],
'gamma': [0.001, 0.01, 0.1, 1, 10, 100, 1000],
'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]}
tunedSVC = GridSearchCV(cv=3, estimator=svc, scoring='f1_macro', param_grid=param_grid)
classifier = make_pipeline(StandardScaler(), tunedSVC)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputClassifier: Output classifier
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassifier: <outputFile>
Output classifier
Implementation of the scikit-learn API for XGBoost classification.
Parameters
- Classifier [string]
Scikit-learn python code. See XGBClassifier for information on different parameters.
Default:
from xgboost import XGBClassifier classifier = XGBClassifier(n_estimators=100)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output classifier [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitXgbclassifier
:
----------------
Arguments
----------------
classifier: Classifier
Default value: from xgboost import XGBClassifier
classifier = XGBClassifier(n_estimators=100)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputClassifier: Output classifier
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassifier: <outputFile>
Output classifier
Implementation of the scikit-learn API for XGBoost random forest classification.
Parameters
- Classifier [string]
Scikit-learn python code. See XGBRFClassifier for information on different parameters.
Default:
from xgboost import XGBRFClassifier classifier = XGBRFClassifier(n_estimators=100)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output classifier [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitXgbrfclassifier
:
----------------
Arguments
----------------
classifier: Classifier
Default value: from xgboost import XGBRFClassifier
classifier = XGBRFClassifier(n_estimators=100)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputClassifier: Output classifier
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassifier: <outputFile>
Output classifier
Uses a fitted classifier to predict class probability layer from a raster layer with features.
Parameters
- Raster layer with features [raster]
- A raster layer with bands used as features. Classifier features and raster bands are matched by name.
- Classifier [file]
- A fitted classifier.
Outputs
- Output class probability layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:PredictClassProbabilityLayer
:
----------------
Arguments
----------------
raster: Raster layer with features
Argument type: raster
Acceptable values:
- Path to a raster layer
classifier: Classifier
Argument type: file
Acceptable values:
- Path to a file
outputProbability: Output class probability layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputProbability: <outputRaster>
Output class probability layer
Uses a fitted classifier to predict a classification layer from a raster layer with features. Used in the Cookbook Recipes: Classification, Graphical Modeler for information on different parameters.
Parameters
- Raster layer with features [raster]
- A raster layer with bands used as features. Classifier features and raster bands are matched by name to allow for classifiers trained on a subset of the raster bands. If raster bands and classifier features are not matching by name, but overall number of bands and features do match, raster bands are used in original order.
- Classifier [file]
- A fitted classifier.
Outputs
- Output classification layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:PredictClassificationLayer
:
----------------
Arguments
----------------
raster: Raster layer with features
Argument type: raster
Acceptable values:
- Path to a raster layer
classifier: Classifier
Argument type: file
Acceptable values:
- Path to a file
outputClassification: Output classification layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputClassification: <outputRaster>
Output classification layer
This algorithm reclassifies a raster by assigning new class values based on a class mapping.
Parameters
- Raster layer [raster]
- A raster layer to be reclassified.
- Class mapping [string]
- A list of source to target class value mappings. E.g. to merge source values 1 and 2 into target value 1, and source values 3 and 4 into target value 2, use {1:1, 2:1, 3:2, 4:2}
- Categories [string]
- A list of target categories in short notation: [(1, ‘Class A’, ‘#e60000’), (2, ‘Class B’, ‘#267300’)]
- No data value [number]
Value used to fill no data regions.
Default: 0
Outputs
- Output classification layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:ReclassifyRasterLayer
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
mapping: Class mapping
Argument type: string
Acceptable values:
- String value
categories: Categories (optional)
Argument type: string
Acceptable values:
- String value
noDataValue: No data value
Default value: 0
Argument type: number
Acceptable values:
- A numeric value
outputClassification: Output classification layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputClassification: <outputRaster>
Output classification layer
Clustering¶
Perform Affinity Propagation Clustering.
Parameters
- Clusterer [string]
Scikit-learn python code. See AffinityPropagation for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from sklearn.cluster import AffinityPropagation affinityPropagation = AffinityPropagation() clusterer = make_pipeline(StandardScaler(), affinityPropagation)
- Training dataset [file]
- Training dataset pickle file used for fitting the clusterer. If not specified, an unfitted clusterer is created.
Outputs
- Output clusterer [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitAffinitypropagation
:
----------------
Arguments
----------------
clusterer: Clusterer
Default value: from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.cluster import AffinityPropagation
affinityPropagation = AffinityPropagation()
clusterer = make_pipeline(StandardScaler(), affinityPropagation)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset
Argument type: file
Acceptable values:
- Path to a file
outputClusterer: Output clusterer
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClusterer: <outputFile>
Output clusterer
Implements the BIRCH clustering algorithm. It is a memory-efficient, online-learning algorithm provided as an alternative to MiniBatchKMeans. It constructs a tree data structure with the cluster centroids being read off the leaf. These can be either the final cluster centroids or can be provided as input to another clustering algorithm such as AgglomerativeClustering.
Parameters
- Clusterer [string]
Scikit-learn python code. See Birch for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from sklearn.cluster import Birch birch = Birch(n_clusters=3) clusterer = make_pipeline(StandardScaler(), birch)
- Training dataset [file]
- Training dataset pickle file used for fitting the clusterer. If not specified, an unfitted clusterer is created.
Outputs
- Output clusterer [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitBirch
:
----------------
Arguments
----------------
clusterer: Clusterer
Default value: from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.cluster import Birch
birch = Birch(n_clusters=3)
clusterer = make_pipeline(StandardScaler(), birch)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset
Argument type: file
Acceptable values:
- Path to a file
outputClusterer: Output clusterer
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClusterer: <outputFile>
Output clusterer
K-Means clustering.
Parameters
- Clusterer [string]
Scikit-learn python code. See KMeans for information on different parameters.
Default:
from sklearn.cluster import KMeans clusterer = KMeans(n_clusters=8)
- Training dataset [file]
- Training dataset pickle file used for fitting the clusterer. If not specified, an unfitted clusterer is created.
Outputs
- Output clusterer [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitKmeans
:
----------------
Arguments
----------------
clusterer: Clusterer
Default value: from sklearn.cluster import KMeans
clusterer = KMeans(n_clusters=8)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset
Argument type: file
Acceptable values:
- Path to a file
outputClusterer: Output clusterer
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClusterer: <outputFile>
Output clusterer
Mean shift clustering using a flat kernel. Mean shift clustering aims to discover “blobs” in a smooth density of samples. It is a centroid-based algorithm, which works by updating candidates for centroids to be the mean of the points within a given region. These candidates are then filtered in a post-processing stage to eliminate near-duplicates to form the final set of centroids. Seeding is performed using a binning technique for scalability.
Parameters
- Clusterer [string]
Scikit-learn python code. See MeanShift for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from sklearn.cluster import MeanShift meanShift = MeanShift() clusterer = make_pipeline(StandardScaler(), meanShift)
- Training dataset [file]
- Training dataset pickle file used for fitting the clusterer. If not specified, an unfitted clusterer is created.
Outputs
- Output clusterer [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitMeanshift
:
----------------
Arguments
----------------
clusterer: Clusterer
Default value: from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.cluster import MeanShift
meanShift = MeanShift()
clusterer = make_pipeline(StandardScaler(), meanShift)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset
Argument type: file
Acceptable values:
- Path to a file
outputClusterer: Output clusterer
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClusterer: <outputFile>
Output clusterer
Uses a fitted clusterer to predict an (unsupervised) classification layer from a raster layer with features.
Parameters
- Raster layer with features [raster]
- A raster layer with bands used as features. Clusterer features and raster bands are matched by name to allow for clusterers trained on a subset of the raster bands. If raster bands and clusterer features are not matching by name, but overall number of bands and features do match, raster bands are used in original order.
- Clusterer [file]
- A fitted clusterer.
Outputs
- Output classification layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:PredictUnsupervisedClassificationLayer
:
----------------
Arguments
----------------
raster: Raster layer with features
Argument type: raster
Acceptable values:
- Path to a raster layer
clusterer: Clusterer
Argument type: file
Acceptable values:
- Path to a file
outputClassification: Output classification layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputClassification: <outputRaster>
Output classification layer
Convolution, morphology and filtering¶
2D Airy Disk filter. This kernel models the diffraction pattern of a circular aperture. This kernel is normalized to a peak value of 1
Parameters
- Raster layer [raster]
- Raster layer to be filtered.
- Kernel [string]
Python code. See AiryDisk2DKernel for information on different parameters.
Default:
from astropy.convolution import AiryDisk2DKernel kernel = AiryDisk2DKernel(radius=1)
- Normalize kernel [boolean]
Whether to normalize the kernel to have a sum of one.
Default: False
- Interpolate no data pixel [boolean]
Whether to interpolate no data pixel. Will result in renormalization of the kernel at each position ignoring pixels with no data values.
Default: True
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialConvolutionAiryDiskFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
kernel: Kernel
Default value: from astropy.convolution import AiryDisk2DKernel
kernel = AiryDisk2DKernel(radius=1)
Argument type: string
Acceptable values:
- String value
normalize: Normalize kernel
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
interpolate: Interpolate no data pixel
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
2D Box filter. The Box filter or running mean is a smoothing filter. It is not isotropic and can produce artifact, when applied repeatedly to the same data.
Parameters
- Raster layer [raster]
- Raster layer to be filtered.
- Kernel [string]
Python code. See Box2DKernel for information on different parameters.
Default:
from astropy.convolution import Box2DKernel kernel = Box2DKernel(width=5)
- Normalize kernel [boolean]
Whether to normalize the kernel to have a sum of one.
Default: False
- Interpolate no data pixel [boolean]
Whether to interpolate no data pixel. Will result in renormalization of the kernel at each position ignoring pixels with no data values.
Default: True
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialConvolutionBoxFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
kernel: Kernel
Default value: from astropy.convolution import Box2DKernel
kernel = Box2DKernel(width=5)
Argument type: string
Acceptable values:
- String value
normalize: Normalize kernel
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
interpolate: Interpolate no data pixel
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Create a spatial 2D filter kernel from list or array.
Parameters
- Raster layer [raster]
- Raster layer to be filtered.
- Kernel [string]
Python code. See CustomKernel for information on different parameters.
Default:
from astropy.convolution import CustomKernel array = [[1, 1, 1], [1, 1, 1], [1, 1, 1]] kernel = CustomKernel(array)
- Normalize kernel [boolean]
Whether to normalize the kernel to have a sum of one.
Default: False
- Interpolate no data pixel [boolean]
Whether to interpolate no data pixel. Will result in renormalization of the kernel at each position ignoring pixels with no data values.
Default: True
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialConvolutionCustomFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
kernel: Kernel
Default value: from astropy.convolution import CustomKernel
array = [[1, 1, 1],
[1, 1, 1],
[1, 1, 1]]
kernel = CustomKernel(array)
Argument type: string
Acceptable values:
- String value
normalize: Normalize kernel
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
interpolate: Interpolate no data pixel
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
2D Gaussian filter. The Gaussian filter is a filter with great smoothing properties. It is isotropic and does not produce artifacts.
Parameters
- Raster layer [raster]
- Raster layer to be filtered.
- Kernel [string]
Python code. See Gaussian2DKernel for information on different parameters.
Default:
from astropy.convolution import Gaussian2DKernel kernel = Gaussian2DKernel(x_stddev=1, y_stddev=1)
- Normalize kernel [boolean]
Whether to normalize the kernel to have a sum of one.
Default: False
- Interpolate no data pixel [boolean]
Whether to interpolate no data pixel. Will result in renormalization of the kernel at each position ignoring pixels with no data values.
Default: True
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialConvolutionGaussianFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
kernel: Kernel
Default value: from astropy.convolution import Gaussian2DKernel
kernel = Gaussian2DKernel(x_stddev=1, y_stddev=1)
Argument type: string
Acceptable values:
- String value
normalize: Normalize kernel
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
interpolate: Interpolate no data pixel
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
2D Moffat filter. This kernel is a typical model for a seeing limited PSF.
Parameters
- Raster layer [raster]
- Raster layer to be filtered.
- Kernel [string]
Python code. See Moffat2DKernel for information on different parameters.
Default:
from astropy.convolution import Moffat2DKernel kernel = Moffat2DKernel(gamma=2, alpha=2)
- Normalize kernel [boolean]
Whether to normalize the kernel to have a sum of one.
Default: False
- Interpolate no data pixel [boolean]
Whether to interpolate no data pixel. Will result in renormalization of the kernel at each position ignoring pixels with no data values.
Default: True
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialConvolutionMoffatFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
kernel: Kernel
Default value: from astropy.convolution import Moffat2DKernel
kernel = Moffat2DKernel(gamma=2, alpha=2)
Argument type: string
Acceptable values:
- String value
normalize: Normalize kernel
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
interpolate: Interpolate no data pixel
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
2D Ricker Wavelet filter kernel (sometimes known as a Mexican Hat kernel). The Ricker Wavelet, or inverted Gaussian-Laplace filter, is a bandpass filter. It smooths the data and removes slowly varying or constant structures (e.g. background). It is useful for peak or multi-scale detection.
Parameters
- Raster layer [raster]
- Raster layer to be filtered.
- Kernel [string]
Python code. See RickerWavelet2DKernel for information on different parameters.
Default:
from astropy.convolution import RickerWavelet2DKernel kernel = RickerWavelet2DKernel(width=1)
- Normalize kernel [boolean]
Whether to normalize the kernel to have a sum of one.
Default: False
- Interpolate no data pixel [boolean]
Whether to interpolate no data pixel. Will result in renormalization of the kernel at each position ignoring pixels with no data values.
Default: True
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialConvolutionRickerWaveletFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
kernel: Kernel
Default value: from astropy.convolution import RickerWavelet2DKernel
kernel = RickerWavelet2DKernel(width=1)
Argument type: string
Acceptable values:
- String value
normalize: Normalize kernel
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
interpolate: Interpolate no data pixel
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
2D Ring filter. The Ring filter kernel is the difference between two Top-Hat kernels of different width. This kernel is useful for, e.g., background estimation.
Parameters
- Raster layer [raster]
- Raster layer to be filtered.
- Kernel [string]
Python code. See Ring2DKernel for information on different parameters.
Default:
from astropy.convolution import Ring2DKernel kernel = Ring2DKernel(radius_in=3, width=2)
- Normalize kernel [boolean]
Whether to normalize the kernel to have a sum of one.
Default: False
- Interpolate no data pixel [boolean]
Whether to interpolate no data pixel. Will result in renormalization of the kernel at each position ignoring pixels with no data values.
Default: True
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialConvolutionRingFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
kernel: Kernel
Default value: from astropy.convolution import Ring2DKernel
kernel = Ring2DKernel(radius_in=3, width=2)
Argument type: string
Acceptable values:
- String value
normalize: Normalize kernel
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
interpolate: Interpolate no data pixel
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
2D Savitsky-Golay filter. See wikipedia for details.
Parameters
- Raster layer [raster]
- Raster layer to be filtered.
- Kernel [string]
Python code. See sgolay2d from the SciPy cookbook for information on different parameters.
Default:
from astropy.convolution import Kernel2D from enmapboxprocessing.algorithm.spatialconvolutionsavitskygolay2dalgorithm import sgolay2d kernel = Kernel2D(array=sgolay2d(window_size=11, order=3, derivative=None))
- Normalize kernel [boolean]
Whether to normalize the kernel to have a sum of one.
Default: False
- Interpolate no data pixel [boolean]
Whether to interpolate no data pixel. Will result in renormalization of the kernel at each position ignoring pixels with no data values.
Default: True
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialConvolutionSavitskygolayFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
kernel: Kernel
Default value: from astropy.convolution import Kernel2D
from enmapboxprocessing.algorithm.spatialconvolutionsavitskygolay2dalgorithm import sgolay2d
kernel = Kernel2D(array=sgolay2d(window_size=11, order=3, derivative=None))
Argument type: string
Acceptable values:
- String value
normalize: Normalize kernel
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
interpolate: Interpolate no data pixel
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
2D Top-Hat filter. The Top-Hat filter is an isotropic smoothing filter. It can produce artifacts when applied repeatedly on the same data.
Parameters
- Raster layer [raster]
- Raster layer to be filtered.
- Kernel [string]
Python code. See Tophat2DKernel for information on different parameters.
Default:
from astropy.convolution import Tophat2DKernel kernel = Tophat2DKernel(radius=1)
- Normalize kernel [boolean]
Whether to normalize the kernel to have a sum of one.
Default: False
- Interpolate no data pixel [boolean]
Whether to interpolate no data pixel. Will result in renormalization of the kernel at each position ignoring pixels with no data values.
Default: True
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialConvolutionTophatFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
kernel: Kernel
Default value: from astropy.convolution import Tophat2DKernel
kernel = Tophat2DKernel(radius=1)
Argument type: string
Acceptable values:
- String value
normalize: Normalize kernel
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
interpolate: Interpolate no data pixel
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
2D Trapezoid filter.
Parameters
- Raster layer [raster]
- Raster layer to be filtered.
- Kernel [string]
Python code. See TrapezoidDisk2DKernel for information on different parameters.
Default:
from astropy.convolution import TrapezoidDisk2DKernel kernel = TrapezoidDisk2DKernel(radius=3, slope=1)
- Normalize kernel [boolean]
Whether to normalize the kernel to have a sum of one.
Default: False
- Interpolate no data pixel [boolean]
Whether to interpolate no data pixel. Will result in renormalization of the kernel at each position ignoring pixels with no data values.
Default: True
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialConvolutionTrapezoidFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
kernel: Kernel
Default value: from astropy.convolution import TrapezoidDisk2DKernel
kernel = TrapezoidDisk2DKernel(radius=3, slope=1)
Argument type: string
Acceptable values:
- String value
normalize: Normalize kernel
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
interpolate: Interpolate no data pixel
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial Gaussian Gradient Magnitude filter.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See gaussian_gradient_magnitude for information on different parameters.
Default:
from scipy.ndimage.filters import gaussian_gradient_magnitude function = lambda array: gaussian_gradient_magnitude(array, sigma=1)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialGaussianGradientMagnitudeFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.filters import gaussian_gradient_magnitude
function = lambda array: gaussian_gradient_magnitude(array, sigma=1)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial generic (user-defined) filter.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See generic_filter for information on different parameters.
Default:
from scipy.ndimage.filters import generic_filter import numpy as np def filter_function(invalues): # do whatever you want to create the output value, e.g. np.nansum outvalue = np.nansum(invalues) # replace this line with your code! return outvalue function = lambda array: generic_filter(array, function=filter_function, size=3)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialGenericFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.filters import generic_filter
import numpy as np
def filter_function(invalues):
# do whatever you want to create the output value, e.g. np.nansum
outvalue = np.nansum(invalues) # replace this line with your code!
return outvalue
function = lambda array: generic_filter(array, function=filter_function, size=3)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial Laplace filter. See Wikipedia for general information.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See laplace for information on different parameters.
Default:
from scipy.ndimage.filters import laplace function = lambda array: laplace(array)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialLaplaceFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.filters import laplace
function = lambda array: laplace(array)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial Maximum filter.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See maximum_filter for information on different parameters.
Default:
from scipy.ndimage.filters import maximum_filter function = lambda array: maximum_filter(array, size=3)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialMaximumFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.filters import maximum_filter
function = lambda array: maximum_filter(array, size=3)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial Median filter.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See median_filter for information on different parameters.
Default:
from scipy.ndimage.filters import median_filter function = lambda array: median_filter(array, size=3)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialMedianFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.filters import median_filter
function = lambda array: median_filter(array, size=3)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial Minimum filter.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See minimum_filter for information on different parameters.
Default:
from scipy.ndimage.filters import minimum_filter function = lambda array: minimum_filter(array, size=3)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialMinimumFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.filters import minimum_filter
function = lambda array: minimum_filter(array, size=3)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial morphological Binary Closing filter. See Wikipedia for general information.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See binary_closing, generate_binary_structure, iterate_structure for information on different parameters.
Default:
from scipy.ndimage.morphology import binary_closing, generate_binary_structure, iterate_structure structure = generate_binary_structure(rank=2, connectivity=1) structure = iterate_structure(structure=structure, iterations=1) function = lambda array: binary_closing(array, structure=structure, iterations=1)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialMorphologicalBinaryClosingFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.morphology import binary_closing, generate_binary_structure, iterate_structure
structure = generate_binary_structure(rank=2, connectivity=1)
structure = iterate_structure(structure=structure, iterations=1)
function = lambda array: binary_closing(array, structure=structure, iterations=1)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial morphological Binary Dilation filter. See Wikipedia for general information.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See binary_closing, generate_binary_structure, iterate_structure for information on different parameters.
Default:
from scipy.ndimage.morphology import binary_dilation, generate_binary_structure, iterate_structure structure = generate_binary_structure(rank=2, connectivity=1) structure = iterate_structure(structure=structure, iterations=1) function = lambda array: binary_dilation(array, structure=structure, iterations=1)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialMorphologicalBinaryDilationFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.morphology import binary_dilation, generate_binary_structure, iterate_structure
structure = generate_binary_structure(rank=2, connectivity=1)
structure = iterate_structure(structure=structure, iterations=1)
function = lambda array: binary_dilation(array, structure=structure, iterations=1)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial morphological Binary Erosion filter. See Wikipedia for general information.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See binary_closing, generate_binary_structure, iterate_structure for information on different parameters.
Default:
from scipy.ndimage.morphology import binary_erosion, generate_binary_structure, iterate_structure structure = generate_binary_structure(rank=2, connectivity=1) structure = iterate_structure(structure=structure, iterations=1) function = lambda array: binary_erosion(array, structure=structure, iterations=1)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialMorphologicalBinaryErosionFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.morphology import binary_erosion, generate_binary_structure, iterate_structure
structure = generate_binary_structure(rank=2, connectivity=1)
structure = iterate_structure(structure=structure, iterations=1)
function = lambda array: binary_erosion(array, structure=structure, iterations=1)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial morphological Binary Fill Holes filter.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See binary_closing, generate_binary_structure, iterate_structure for information on different parameters.
Default:
from scipy.ndimage.morphology import binary_fill_holes, generate_binary_structure, iterate_structure structure = generate_binary_structure(rank=2, connectivity=1) structure = iterate_structure(structure=structure, iterations=1) function = lambda array: binary_fill_holes(array, structure=structure)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialMorphologicalBinaryFillHolesFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.morphology import binary_fill_holes, generate_binary_structure, iterate_structure
structure = generate_binary_structure(rank=2, connectivity=1)
structure = iterate_structure(structure=structure, iterations=1)
function = lambda array: binary_fill_holes(array, structure=structure)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial morphological Binary Opening filter. See Wikipedia for general information.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See binary_closing, generate_binary_structure, iterate_structure for information on different parameters.
Default:
from scipy.ndimage.morphology import binary_opening, generate_binary_structure, iterate_structure structure = generate_binary_structure(rank=2, connectivity=1) structure = iterate_structure(structure=structure, iterations=1) function = lambda array: binary_opening(array, structure=structure, iterations=1)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialMorphologicalBinaryOpeningFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.morphology import binary_opening, generate_binary_structure, iterate_structure
structure = generate_binary_structure(rank=2, connectivity=1)
structure = iterate_structure(structure=structure, iterations=1)
function = lambda array: binary_opening(array, structure=structure, iterations=1)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial morphological Binary Propagation filter.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See binary_closing, generate_binary_structure, iterate_structure for information on different parameters.
Default:
from scipy.ndimage.morphology import binary_propagation, generate_binary_structure, iterate_structure structure = generate_binary_structure(rank=2, connectivity=1) structure = iterate_structure(structure=structure, iterations=1) function = lambda array: binary_propagation(array, structure=structure)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialMorphologicalBinaryPropagationFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.morphology import binary_propagation, generate_binary_structure, iterate_structure
structure = generate_binary_structure(rank=2, connectivity=1)
structure = iterate_structure(structure=structure, iterations=1)
function = lambda array: binary_propagation(array, structure=structure)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial morphological Black Top-Hat filter. See Wikipedia for general information.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See binary_closing, generate_binary_structure, iterate_structure for information on different parameters.
Default:
from scipy.ndimage.morphology import black_tophat, generate_binary_structure, iterate_structure structure = generate_binary_structure(rank=2, connectivity=1) structure = iterate_structure(structure=structure, iterations=1) function = lambda array: black_tophat(array, structure=structure)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialMorphologicalBlackTophatFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.morphology import black_tophat, generate_binary_structure, iterate_structure
structure = generate_binary_structure(rank=2, connectivity=1)
structure = iterate_structure(structure=structure, iterations=1)
function = lambda array: black_tophat(array, structure=structure)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial morphological Gradient filter. See Wikipedia for general information.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See binary_closing, generate_binary_structure, iterate_structure for information on different parameters.
Default:
from scipy.ndimage.morphology import morphological_gradient, generate_binary_structure, iterate_structure structure = generate_binary_structure(rank=2, connectivity=1) structure = iterate_structure(structure=structure, iterations=1) function = lambda array: morphological_gradient(array, structure=structure)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialMorphologicalGradientFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.morphology import morphological_gradient, generate_binary_structure, iterate_structure
structure = generate_binary_structure(rank=2, connectivity=1)
structure = iterate_structure(structure=structure, iterations=1)
function = lambda array: morphological_gradient(array, structure=structure)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial morphological Grey Dilation filter. See Wikipedia for general information.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See grey_dilation, generate_binary_structure, iterate_structure for information on different parameters.
Default:
from scipy.ndimage.morphology import grey_dilation, generate_binary_structure, iterate_structure structure = generate_binary_structure(rank=2, connectivity=1) structure = iterate_structure(structure=structure, iterations=1) function = lambda array: grey_dilation(array, structure=structure)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialMorphologicalGreyDilationFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.morphology import grey_dilation, generate_binary_structure, iterate_structure
structure = generate_binary_structure(rank=2, connectivity=1)
structure = iterate_structure(structure=structure, iterations=1)
function = lambda array: grey_dilation(array, structure=structure)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial morphological Grey Erosion filter. See Wikipedia for general information.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See grey_erosion, generate_binary_structure, iterate_structure for information on different parameters.
Default:
from scipy.ndimage.morphology import grey_erosion, generate_binary_structure, iterate_structure structure = generate_binary_structure(rank=2, connectivity=1) structure = iterate_structure(structure=structure, iterations=1) function = lambda array: grey_erosion(array, structure=structure)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialMorphologicalGreyErosionFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.morphology import grey_erosion, generate_binary_structure, iterate_structure
structure = generate_binary_structure(rank=2, connectivity=1)
structure = iterate_structure(structure=structure, iterations=1)
function = lambda array: grey_erosion(array, structure=structure)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial morphological Grey Opening filter. See Wikipedia for general information.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See grey_opening, generate_binary_structure, iterate_structure for information on different parameters.
Default:
from scipy.ndimage.morphology import grey_opening, generate_binary_structure, iterate_structure structure = generate_binary_structure(rank=2, connectivity=1) structure = iterate_structure(structure=structure, iterations=1) function = lambda array: grey_opening(array, structure=structure)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialMorphologicalGreyOpeningFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.morphology import grey_opening, generate_binary_structure, iterate_structure
structure = generate_binary_structure(rank=2, connectivity=1)
structure = iterate_structure(structure=structure, iterations=1)
function = lambda array: grey_opening(array, structure=structure)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial morphological Laplace filter. See Wikipedia for general information.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See morphological_laplace for information on different parameters.
Default:
from scipy.ndimage.morphology import morphological_laplace function = lambda array: morphological_laplace(array, size=(3, 3))
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialMorphologicalLaplaceFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.morphology import morphological_laplace
function = lambda array: morphological_laplace(array, size=(3, 3))
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial morphological White Top-Hat filter. See Wikipedia for general information.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See scipy.ndimage.white_tophat for information on different parameters.
Default:
from scipy.ndimage.morphology import white_tophat function = lambda array: white_tophat(array, size=(3, 3))
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialMorphologicalWhiteTophatFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.morphology import white_tophat
function = lambda array: white_tophat(array, size=(3, 3))
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial Percentile filter.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See percentile_filter for information on different parameters.
Default:
from scipy.ndimage.filters import percentile_filter function = lambda array: percentile_filter(array, percentile=50, size=3)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialPercentileFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.filters import percentile_filter
function = lambda array: percentile_filter(array, percentile=50, size=3)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial Prewitt filter. See Wikipedia for general information.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See prewitt for information on different parameters.
Default:
from scipy.ndimage.filters import prewitt function = lambda array: prewitt(array, axis=0)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialPrewittFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.filters import prewitt
function = lambda array: prewitt(array, axis=0)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Spatial Sobel filter. See Wikipedia for general information.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code. See sobel for information on different parameters.
Default:
from scipy.ndimage.filters import sobel function = lambda array: sobel(array, axis=0)
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpatialSobelFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: from scipy.ndimage.filters import sobel
function = lambda array: sobel(array, axis=0)
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
1D Box filter. The Box filter or running mean is a smoothing filter. It is not isotropic and can produce artifacts, when applied repeatedly to the same data.
Parameters
- Raster layer [raster]
- Raster layer to be filtered.
- Kernel [string]
Python code. See Box1DKernel for information on different parameters.
Default:
from astropy.convolution import Box1DKernel kernel = Box1DKernel(width=5)
- Normalize kernel [boolean]
Whether to normalize the kernel to have a sum of one.
Default: False
- Interpolate no data pixel [boolean]
Whether to interpolate no data pixel. Will result in renormalization of the kernel at each position ignoring pixels with no data values.
Default: True
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpectralConvolutionBoxFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
kernel: Kernel
Default value: from astropy.convolution import Box1DKernel
kernel = Box1DKernel(width=5)
Argument type: string
Acceptable values:
- String value
normalize: Normalize kernel
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
interpolate: Interpolate no data pixel
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
1D Gaussian filter. The Gaussian filter is a filter with great smoothing properties. It is isotropic and does not produce artifacts.
Parameters
- Raster layer [raster]
- Raster layer to be filtered.
- Kernel [string]
Python code. See Gaussian1DKernel for information on different parameters.
Default:
from astropy.convolution import Gaussian1DKernel kernel = Gaussian1DKernel(stddev=1)
- Normalize kernel [boolean]
Whether to normalize the kernel to have a sum of one.
Default: False
- Interpolate no data pixel [boolean]
Whether to interpolate no data pixel. Will result in renormalization of the kernel at each position ignoring pixels with no data values.
Default: True
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpectralConvolutionGaussianFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
kernel: Kernel
Default value: from astropy.convolution import Gaussian1DKernel
kernel = Gaussian1DKernel(stddev=1)
Argument type: string
Acceptable values:
- String value
normalize: Normalize kernel
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
interpolate: Interpolate no data pixel
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
1D Ricker Wavelet filter kernel (sometimes known as a Mexican Hat kernel). The Ricker Wavelet, or inverted Gaussian-Laplace filter, is a bandpass filter. It smooths the data and removes slowly varying or constant structures (e.g. background). It is useful for peak or multi-scale detection.
Parameters
- Raster layer [raster]
- Raster layer to be filtered.
- Kernel [string]
Python code. See RickerWavelet1DKernel for information on different parameters.
Default:
from astropy.convolution import RickerWavelet1DKernel kernel = RickerWavelet1DKernel(width=1)
- Normalize kernel [boolean]
Whether to normalize the kernel to have a sum of one.
Default: False
- Interpolate no data pixel [boolean]
Whether to interpolate no data pixel. Will result in renormalization of the kernel at each position ignoring pixels with no data values.
Default: True
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpectralConvolutionRickerWaveletFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
kernel: Kernel
Default value: from astropy.convolution import RickerWavelet1DKernel
kernel = RickerWavelet1DKernel(width=1)
Argument type: string
Acceptable values:
- String value
normalize: Normalize kernel
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
interpolate: Interpolate no data pixel
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
1D Savitsky-Golay filter. See wikipedia for details.
Parameters
- Raster layer [raster]
- Raster layer to be filtered.
- Kernel [string]
Python code. See scipy.signal.savgol_coeffs for information on different parameters.
Default:
from astropy.convolution import Kernel1D from scipy.signal import savgol_coeffs kernel = Kernel1D(array=savgol_coeffs(window_length=11, polyorder=3, deriv=0))
- Normalize kernel [boolean]
Whether to normalize the kernel to have a sum of one.
Default: False
- Interpolate no data pixel [boolean]
Whether to interpolate no data pixel. Will result in renormalization of the kernel at each position ignoring pixels with no data values.
Default: True
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpectralConvolutionSavitskygolayFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
kernel: Kernel
Default value: from astropy.convolution import Kernel1D
from scipy.signal import savgol_coeffs
kernel = Kernel1D(array=savgol_coeffs(window_length=11, polyorder=3, deriv=0))
Argument type: string
Acceptable values:
- String value
normalize: Normalize kernel
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
interpolate: Interpolate no data pixel
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
1D Trapezoid filter.
Parameters
- Raster layer [raster]
- Raster layer to be filtered.
- Kernel [string]
Python code. See Trapezoid1DKernel for information on different parameters.
Default:
from astropy.convolution import Trapezoid1DKernel kernel = Trapezoid1DKernel(width=3, slope=1)
- Normalize kernel [boolean]
Whether to normalize the kernel to have a sum of one.
Default: False
- Interpolate no data pixel [boolean]
Whether to interpolate no data pixel. Will result in renormalization of the kernel at each position ignoring pixels with no data values.
Default: True
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpectralConvolutionTrapezoidFilter
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
kernel: Kernel
Default value: from astropy.convolution import Trapezoid1DKernel
kernel = Trapezoid1DKernel(width=3, slope=1)
Argument type: string
Acceptable values:
- String value
normalize: Normalize kernel
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
interpolate: Interpolate no data pixel
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Dataset creation¶
Create a classification dataset by sampling data for pixels that match the given categories and store the result as a pickle file. If the layer is not categorized, or the band with class values is selected manually, categories are derived from sampled data itself. To be more precise: i) category values are derived from unique raster band values (after excluding no data or zero data pixel), ii) category names are set equal to the category values, and iii) category colors are picked randomly.
Parameters
- Categorized raster layer [raster]
- Categorized raster layer specifying sample locations and target data y. If required, the layer is reprojected and resampled internally to match the feature raster grid.
- Raster layer with features [raster]
- Raster layer used for sampling feature data X.
- Band with class values [band]
- Band with class values. If not selected, the band defined by the renderer is used. If that is also not specified, the first band is used.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateClassificationDatasetFromCategorizedRasterLayerAndFeatureRaster
:
----------------
Arguments
----------------
categorizedRaster: Categorized raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
featureRaster: Raster layer with features
Argument type: raster
Acceptable values:
- Path to a raster layer
categoryBand: Band with class values (optional)
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
outputClassificationDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassificationDataset: <outputFile>
Output dataset
Create a classification dataset from spectral profiles that matches the given categories and store the result as a pickle file. If the spectral library is not categorized, or the field with class values is selected manually, categories are derived from target data y. To be more precise: i) category values are derived from unique attribute values (after excluding no data or zero data values), ii) category names are set equal to the category values, and iii) category colors are picked randomly.
Parameters
- Categorized spectral library [vector]
- Categorized spectral library with feature data X (i.e. spectral profiles) and target data y. It is assumed, but not enforced, that the spectral characteristics of all spectral profiles match. If not all spectral profiles share the same number of spectral bands, an error is raised.
- Field with class values [field]
- Field with class values used as target data y. If not selected, the field defined by the renderer is used. If that is also not specified, an error is raised.
- Field with spectral profiles used as features [field]
- Field with spectral profiles used as feature data X. If not selected, the default field named “profiles” is used. If that is also not available, an error is raised.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateClassificationDatasetFromCategorizedSpectralLibrary
:
----------------
Arguments
----------------
categorizedLibrary: Categorized spectral library
Argument type: vector
Acceptable values:
- Path to a vector layer
categoryField: Field with class values (optional)
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
field: Field with spectral profiles used as features (optional)
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
outputClassificationDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassificationDataset: <outputFile>
Output dataset
Create a classification dataset by sampling data for pixels that match the given categories and store the result as a pickle file. If the layer is not categorized, or the field with class values is selected manually, categories are derived from the sampled target data y. To be more precise: i) category values are derived from unique attribute values (after excluding no data or zero data values), ii) category names are set equal to the category values, and iii) category colors are picked randomly.
Parameters
- Categorized vector layer [vector]
- Categorized vector layer specifying sample locations and target data y. If required, the layer is reprojected and rasterized internally to match the feature raster grid.
- Raster layer with features [raster]
- Raster layer used for sampling feature data X.
- Field with class values [field]
- Field with class values used as target data y. If not selected, the field defined by the renderer is used. If that is also not specified, an error is raised.
- Minimum pixel coverage [number]
Exclude all pixel where (polygon) coverage is smaller than given threshold.
Default: 50
- Majority voting [boolean]
Whether to use majority voting. Turn off to use simple nearest neighbour resampling, which is much faster, but may result in highly inaccurate class decisions.
Default: True
Outputs
- Output dataset [fileDestination]
- Dataset file destination .
Command-line usage
>qgis_process help enmapbox:CreateClassificationDatasetFromCategorizedVectorLayerAndFeatureRaster
:
----------------
Arguments
----------------
categorizedVector: Categorized vector layer
Argument type: vector
Acceptable values:
- Path to a vector layer
featureRaster: Raster layer with features
Argument type: raster
Acceptable values:
- Path to a raster layer
categoryField: Field with class values (optional)
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
coverage: Minimum pixel coverage
Default value: 50
Argument type: number
Acceptable values:
- A numeric value
majorityVoting: Majority voting
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputClassificationDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassificationDataset: <outputFile>
Output dataset
Create a classification dataset from attribute table rows that matches the given categories and store the result as a pickle file. If the layer is not categorized, or the field with class values is selected manually, categories are derived from the target data y. To be more precise: i) category values are derived from unique attribute values (after excluding no data or zero data values), ii) category names are set equal to the category values, and iii) category colors are picked randomly.
Parameters
- Categorized vector layer [vector]
- Categorized vector layer specifying feature data X and target data y.
- Fields with features [field]
- Fields with values used as feature data X.
- Field with class values [field]
- Field with class values used as target data y. If not selected, the field defined by the renderer is used. If that is also not specified, an error is raised.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateClassificationDatasetFromCategorizedVectorLayerWithAttributeTable
:
----------------
Arguments
----------------
categorizedVector: Categorized vector layer
Argument type: vector
Acceptable values:
- Path to a vector layer
featureFields: Fields with features
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
categoryField: Field with class values (optional)
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
outputClassificationDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassificationDataset: <outputFile>
Output dataset
Create a classification dataset from a JSON file and store the result as a pickle file. Example file (classifier.pkl.json) can be found in the EnMAP-Box testdata folder).
Parameters
- JSON file [file]
- JSON file containing all information.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateClassificationDatasetFromJsonFile
:
----------------
Arguments
----------------
jsonFile: JSON file
Argument type: file
Acceptable values:
- Path to a file
outputClassificationDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassificationDataset: <outputFile>
Output dataset
Create a classification dataset from Python code and store the result as a pickle file.
Parameters
- Code [string]
Python code specifying the classification dataset.
Default:
from enmapboxprocessing.typing import Number, List, Category, ClassifierDump # specify categories and feature names categories: List[Category] = [ Category(value=1, name='class 1', color='#ff0000'), Category(value=2, name='class 2', color='#00ff00') ] features: List[str] = ['Feature 1', 'Feature 2', 'Feature 3'] # specify features X as 2d-array with shape (samples, features) X: List[List[Number]] = [ [1, 2, 3], [4, 5, 6] ] # specify targets y as 2d-array with shape (samples, 1) y: List[List[int]] = [ [1], [2] ]
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateClassificationDatasetFromPythonCode
:
----------------
Arguments
----------------
code: Code
Default value: from enmapboxprocessing.typing import Number, List, Category, ClassifierDump
# specify categories and feature names
categories: List[Category] = [
Category(value=1, name='class 1', color='#ff0000'),
Category(value=2, name='class 2', color='#00ff00')
]
features: List[str] = ['Feature 1', 'Feature 2', 'Feature 3']
# specify features X as 2d-array with shape (samples, features)
X: List[List[Number]] = [
[1, 2, 3],
[4, 5, 6]
]
# specify targets y as 2d-array with shape (samples, 1)
y: List[List[int]] = [
[1], [2]
]
Argument type: string
Acceptable values:
- String value
outputClassificationDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassificationDataset: <outputFile>
Output dataset
Create a classification dataset from attribute table rows that match the given categories and store the result as a pickle file.
Parameters
- Table [vector]
- Table with feature data X and target data y.
- Fields with features [field]
- Fields used as features. Values may be given as strings, but must be castable to float.
- Field with class values [field]
- Field used as class value.
- Field with class names [field]
- Field used as class name. If not specified, class values are used as class names.
- Field with class colors [field]
- Field used as class color. Values may be given as hex-colors, rgb-colors or int-colors.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateClassificationDatasetFromTableWithCategoriesAndFeatureFields
:
----------------
Arguments
----------------
table: Table
Argument type: vector
Acceptable values:
- Path to a vector layer
featureFields: Fields with features
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
valueField: Field with class values
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
nameField: Field with class names (optional)
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
colorField: Field with class colors (optional)
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
outputClassificationDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassificationDataset: <outputFile>
Output dataset
Create a classification dataset from tabulated text files and store the result as a pickle file. The format matches that of the FORCE Higher Level Sampling Submodule. Example files (force_features.csv and force_labels.csv) can be found in the EnMAP-Box testdata folder).
Parameters
- File with features [file]
- Text file with tabulated feature data X (no headers). Each row represents the feature vector of a sample.
- File with class values [file]
- Text file with tabulated target data y (no headers). Each row represents the class value of a sample.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateClassificationDatasetFromTextFiles
:
----------------
Arguments
----------------
featureFile: File with features
Argument type: file
Acceptable values:
- Path to a file
valueFile: File with class values
Argument type: file
Acceptable values:
- Path to a file
outputClassificationDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassificationDataset: <outputFile>
Output dataset
Create a regression dataset from attribute table rows that matches the given target variables and store the result as a pickle file.
Parameters
- Continuous-valued vector layer [vector]
- Continuous-valued vector layer specifying feature data X and target data y.
- Fields with features [field]
- Fields with values used as feature data X.
- Fields with targets [field]
- Fields with values used as used as target data y. If not selected, the fields defined by the renderer are used. If those are also not specified, an error is raised.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateRegressionDatasetFromContinuousvaluedLayerWithAttributeTable
:
----------------
Arguments
----------------
continuousVector: Continuous-valued vector layer
Argument type: vector
Acceptable values:
- Path to a vector layer
featureFields: Fields with features
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
targetFields: Fields with targets (optional)
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
outputRegressionDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressionDataset: <outputFile>
Output dataset
Create a regression dataset by sampling data for labeled pixels and store the result as a pickle file.
Parameters
- Continuous-valued raster layer [raster]
- Continuous-valued raster layer specifying sample locations and target data Y.If required, the layer is reprojected and resampled internally to match the feature raster grid.
- Raster layer with features [raster]
- Raster layer used for sampling feature data X.
- Targets [band]
- Bands with continuous-valued variables used as targets. An empty selection defaults to all bands in native order.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateRegressionDatasetFromContinuousvaluedRasterLayerAndFeatureRaster
:
----------------
Arguments
----------------
continuousRaster: Continuous-valued raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
featureRaster: Raster layer with features
Argument type: raster
Acceptable values:
- Path to a raster layer
targets: Targets (optional)
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
outputRegressionDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressionDataset: <outputFile>
Output dataset
Create a regression dataset from spectral profiles that matches the given target variables and store the result as a pickle file.
Parameters
- Continuous-valued spectral library [vector]
- Continuous-valued spectral library with feature data X (i.e. spectral profiles) and target data y. It is assumed, but not enforced, that the spectral characteristics of all spectral profiles match. If not all spectral profiles share the same number of spectral bands, an error is raised.
- Fields with target values [field]
- Fields with continuous-valued values used as target data y. If not selected, the fields defined by the renderer is used. If those are also not specified, an error is raised.
- Field with spectral profiles used as features [field]
- Field with spectral profiles used as feature data X. If not selected, the default field named “profiles” is used. If that is also not available, an error is raised.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateRegressionDatasetFromContinuousvaluedSpectralLibrary
:
----------------
Arguments
----------------
continuousLibrary: Continuous-valued spectral library
Argument type: vector
Acceptable values:
- Path to a vector layer
targetFields: Fields with target values (optional)
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
field: Field with spectral profiles used as features (optional)
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
outputRegressionDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressionDataset: <outputFile>
Output dataset
Create a regression dataset by sampling data and store the result as a pickle file.
Parameters
- Continuous-valued vector layer [vector]
- Continuous-valued vector layer specifying sample locations and target data y. If required, the layer is reprojected and rasterized internally to match the feature raster grid.
- Raster layer with features [raster]
- Raster layer used for sampling feature data X.
- Fields with targets [field]
- Fields used as target data y. If not selected, the fields defined by the renderer are used. If those are also not specified, an error is raised.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateRegressionDatasetFromContinuousvaluedVectorLayerAndFeatureRaster
:
----------------
Arguments
----------------
continuousVector: Continuous-valued vector layer
Argument type: vector
Acceptable values:
- Path to a vector layer
featureRaster: Raster layer with features
Argument type: raster
Acceptable values:
- Path to a raster layer
targetFields: Fields with targets (optional)
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
outputRegressionDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressionDataset: <outputFile>
Output dataset
Create a regression dataset from a JSON file and store the result as a pickle file. Example file (regressor.pkl.json) can be found in the EnMAP-Box testdata folder).
Parameters
- JSON file [file]
- JSON file containing all information.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateRegressionDatasetFromJsonFile
:
----------------
Arguments
----------------
jsonFile: JSON file
Argument type: file
Acceptable values:
- Path to a file
outputRegressionDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressionDataset: <outputFile>
Output dataset
Create a regression dataset from Python code and store the result as a pickle file.
Parameters
- Code [string]
Python code specifying the regression dataset.
Default:
from enmapboxprocessing.typing import Number, List, Target, RegressorDump # specify targets and feature names targets: List[Target] = [ Target(name='variable 1', color='#ff0000'), Target(name='variable 2', color='#00ff00') ] features: List[str] = ['Feature 1', 'Feature 2', 'Feature 3'] # specify features X as 2d-array with shape (samples, features) X: List[List[Number]] = [ [1, 2, 3], [4, 5, 6] ] # specify targets y as 2d-array with shape (samples, targets) y: List[List[float]] = [ [1.1, 1.2], [2.1, 2.2] ]
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateRegressionDatasetFromPythonCode
:
----------------
Arguments
----------------
code: Code
Default value: from enmapboxprocessing.typing import Number, List, Target, RegressorDump
# specify targets and feature names
targets: List[Target] = [
Target(name='variable 1', color='#ff0000'),
Target(name='variable 2', color='#00ff00')
]
features: List[str] = ['Feature 1', 'Feature 2', 'Feature 3']
# specify features X as 2d-array with shape (samples, features)
X: List[List[Number]] = [
[1, 2, 3],
[4, 5, 6]
]
# specify targets y as 2d-array with shape (samples, targets)
y: List[List[float]] = [
[1.1, 1.2], [2.1, 2.2]
]
Argument type: string
Acceptable values:
- String value
outputRegressionDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressionDataset: <outputFile>
Output dataset
Create a regression dataset from attribute table rows and store the result as a pickle file.
Parameters
- Table [vector]
- Table with feature data X and target data y.
- Fields with features [field]
- Fields used as features. Values may be given as strings, but must be castable to float.
- Fields with targets [field]
- Fields used as targets. Values may be given as strings, but must be castable to float.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateRegressionDatasetFromTableWithTargetAndFeatureFields
:
----------------
Arguments
----------------
table: Table
Argument type: vector
Acceptable values:
- Path to a vector layer
featureFields: Fields with features
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
targetFields: Fields with targets
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
outputRegressionDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressionDataset: <outputFile>
Output dataset
Create a regression dataset from tabulated text files and store the result as a pickle file. The format matches that of the FORCE Higher Level Sampling Submodule. Example files (force_features.csv and force_labels.csv) can be found in the EnMAP-Box testdata folder).
Parameters
- File with features [file]
- Text file with tabulated feature data X (no headers). Each row represents the feature vector of a sample.
- File with target values [file]
- Text file with tabulated target data y (no headers). Each row represents the target values of a sample.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateRegressionDatasetFromTextFiles
:
----------------
Arguments
----------------
featureFile: File with features
Argument type: file
Acceptable values:
- Path to a file
valueFile: File with target values
Argument type: file
Acceptable values:
- Path to a file
outputRegressionDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressionDataset: <outputFile>
Output dataset
Create synthetically mixed regression datasets, one for each category. Results are stored as <category.name>.pkl files inside the destination folder.
Parameters
- Classification dataset [file]
- A classification dataset with spectral endmembers used for synthetical mixing.
- Number of mixtures per class [number]
Number of mixtures per class
Default: 1000
- Proportion of background mixtures (%) [number]
Proportion of background mixtures.
Default: 0
- Include original endmembers [boolean]
Whether to include the original library spectra into the dataset.
Default: True
- Mixing complexity probabilities [string]
A list of probabilities for using 2, 3, 4, … endmember mixing models. Trailing 0 probabilities can be skipped. The default values of 0.5, 0.5,results in 50% 2-endmember and 50% 3-endmember models.
Default: 0.5, 0.5
- Allow within-class mixtures [boolean]
Whether to allow mixtures with profiles belonging to the same class.
Default: True
- Class probabilities [string]
- A list of probabilities for drawing profiles from each class. If not specified, class probabilities are proportional to the class size.
Outputs
- Output folder [folderDestination]
- Folder destination.
Command-line usage
>qgis_process help enmapbox:CreateRegressionDatasetSynthmixFromClassificationDataset
:
----------------
Arguments
----------------
dataset: Classification dataset
Argument type: file
Acceptable values:
- Path to a file
n: Number of mixtures per class
Default value: 1000
Argument type: number
Acceptable values:
- A numeric value
background: Proportion of background mixtures (%)
Default value: 0
Argument type: number
Acceptable values:
- A numeric value
includeEndmember: Include original endmembers
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
mixingProbabilities: Mixing complexity probabilities (optional)
Default value: 0.5, 0.5
Argument type: string
Acceptable values:
- String value
allowWithinClassMixtures: Allow within-class mixtures
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
classProbabilities: Class probabilities (optional)
Argument type: string
Acceptable values:
- String value
outputFolder: Output folder
Argument type: folderDestination
Acceptable values:
- Path for an existing or new folder
----------------
Outputs
----------------
outputFolder: <outputFolder>
Output folder
Create an unsupervised dataset by sampling data from valid pixels and store the result as a pickle file. A pixel is concidered valid, if the pixel profile is free of no data values, and not excluded by the (optionally) selected mask layer.
Parameters
- Raster layer with features [raster]
- Raster layer used for sampling feature data X.
- Mask layer [layer]
- A mask layer for limitting sample locations.
- Sample size [number]
Approximate number of samples drawn from raster. If 0, whole raster will be used. Note that this is only a hint for limiting the number of rows and columns.
Default: 0
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateUnsupervisedDatasetFromFeatureRaster
:
----------------
Arguments
----------------
featureRaster: Raster layer with features
Argument type: raster
Acceptable values:
- Path to a raster layer
mask: Mask layer (optional)
Argument type: layer
Acceptable values:
- Path to a vector, raster or mesh layer
sampleSize: Sample size (optional)
Default value: 0
Argument type: number
Acceptable values:
- A numeric value
outputUnsupervisedDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputUnsupervisedDataset: <outputFile>
Output dataset
Create a unsupervised dataset from a JSON file and store the result as a pickle file.
Parameters
- JSON file [file]
- JSON file containing all information.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateUnsupervisedDatasetFromJsonFile
:
----------------
Arguments
----------------
jsonFile: JSON file
Argument type: file
Acceptable values:
- Path to a file
outputUnsupervisedDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputUnsupervisedDataset: <outputFile>
Output dataset
Create an unsupervised dataset from Python code and store the result as a pickle file.
Parameters
- Code [string]
Python code specifying the unsupervised dataset.
Default:
from enmapboxprocessing.typing import Number, List # specify feature names features: List[str] = ['Feature 1', 'Feature 2', 'Feature 3'] # specify features X as 2d-array with shape (samples, features) X: List[List[Number]] = [ [1, 2, 3], [4, 5, 6] ]
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateUnsupervisedDatasetFromPythonCode
:
----------------
Arguments
----------------
code: Code
Default value: from enmapboxprocessing.typing import Number, List
# specify feature names
features: List[str] = ['Feature 1', 'Feature 2', 'Feature 3']
# specify features X as 2d-array with shape (samples, features)
X: List[List[Number]] = [
[1, 2, 3],
[4, 5, 6]
]
Argument type: string
Acceptable values:
- String value
outputUnsupervisedDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputUnsupervisedDataset: <outputFile>
Output dataset
Create an unsupervised dataset from spectral profiles and store the result as a pickle file.
Parameters
- Spectral library [vector]
- Spectral library with feature data X (i.e. spectral profiles). It is assumed, but not enforced, that the spectral characteristics of all spectral profiles match. If not all spectral profiles share the same number of spectral bands, an error is raised.
- Field with spectral profiles used as features [field]
- Field with spectral profiles used as feature data X. If not selected, the default field named “profiles” is used. If that is also not available, an error is raised.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateUnsupervisedDatasetFromSpectralLibrary
:
----------------
Arguments
----------------
library: Spectral library
Argument type: vector
Acceptable values:
- Path to a vector layer
field: Field with spectral profiles used as features (optional)
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
outputUnsupervisedDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputUnsupervisedDataset: <outputFile>
Output dataset
Create an unsupervised dataset from a tabulated text file and store the result as a pickle file. The format matches that of the FORCE Higher Level Sampling Submodule. An example file (force_features.csv) can be found in the EnMAP-Box testdata folder).
Parameters
- File with features [file]
- Text file with tabulated feature data X (no headers). Each row represents the feature vector of a sample.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateUnsupervisedDatasetFromTextFile
:
----------------
Arguments
----------------
featureFile: File with features
Argument type: file
Acceptable values:
- Path to a file
outputUnsupervisedDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputUnsupervisedDataset: <outputFile>
Output dataset
Create an unsupervised dataset from attribute table and store the result as a pickle file.
Parameters
- Vector layer [vector]
- Vector layer specifying feature data X.
- Fields with features [field]
- Fields with values used as feature data X.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:CreateUnsupervisedDatasetFromVectorLayerWithAttributeTable
:
----------------
Arguments
----------------
vector: Vector layer
Argument type: vector
Acceptable values:
- Path to a vector layer
featureFields: Fields with features
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
outputUnsupervisedDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputUnsupervisedDataset: <outputFile>
Output dataset
Merges a list of classification datasets.
Parameters
- Datasets [multilayer]
- Classification datasets to be merged.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:MergeClassificationDatasets
:
----------------
Arguments
----------------
datasets: Datasets
Argument type: multilayer
outputClassificationDataset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputClassificationDataset: <outputFile>
Output dataset
Split a dataset by randomly drawing samples.
Parameters
- Classification dataset [file]
- Classification dataset pickle file with feature data X and target data y to draw from.
- Number of samples per category [string]
- Number of samples to draw from each category. Set a single value N to draw N samples for each category. Set a list of values N1, N2, … Ni, … to draw Ni samples for category i.
- Draw with replacement [boolean]
Whether to draw samples with replacement.
Default: False
- Draw proportional [boolean]
Whether to interprete number of samples N or Ni as percentage to be drawn from each category.
Default: False
- Random seed [number]
- The seed for the random generator can be provided.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.Stores sampled data.
- Output dataset complement [fileDestination]
- Pickle file destination.Stores remaining data that was not sampled.
Command-line usage
>qgis_process help enmapbox:RandomSamplesFromClassificationDataset
:
----------------
Arguments
----------------
dataset: Classification dataset
Argument type: file
Acceptable values:
- Path to a file
n: Number of samples per category
Argument type: string
Acceptable values:
- String value
replace: Draw with replacement
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
proportional: Draw proportional
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
seed: Random seed (optional)
Argument type: number
Acceptable values:
- A numeric value
outputDatasetRandomSample: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
outputDatasetRandomSampleComplement: Output dataset complement (optional)
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputDatasetRandomSample: <outputFile>
Output dataset
outputDatasetRandomSampleComplement: <outputFile>
Output dataset complement
Split a dataset by randomly drawing samples.
Parameters
- Regression dataset [file]
- Regression dataset pickle file with feature data X and target data y to draw from.
- Number of stratification bins [number]
Number of bins used to stratify the target range.
Default: 1
- Number of samples per bin [string]
- Number of samples to draw from each bin. Set a single value N to draw N samples for each bin. Set a list of values N1, N2, … Ni, … to draw Ni samples for bin i.
- Draw with replacement [boolean]
Whether to draw samples with replacement.
Default: False
- Draw proportional [boolean]
Whether to interprete number of samples N or Ni as percentage to be drawn from each bin.
Default: False
- Random seed [number]
- The seed for the random generator can be provided.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.Stores sampled data.
- Output dataset complement [fileDestination]
- Pickle file destination.Stores remaining data that was not sampled.
Command-line usage
>qgis_process help enmapbox:RandomSamplesFromRegressionDataset
:
----------------
Arguments
----------------
dataset: Regression dataset
Argument type: file
Acceptable values:
- Path to a file
bins: Number of stratification bins
Default value: 1
Argument type: number
Acceptable values:
- A numeric value
n: Number of samples per bin
Argument type: string
Acceptable values:
- String value
replace: Draw with replacement
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
proportional: Draw proportional
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
seed: Random seed (optional)
Argument type: number
Acceptable values:
- A numeric value
outputDatasetRandomSample: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
outputDatasetRandomSampleComplement: Output dataset complement (optional)
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputDatasetRandomSample: <outputFile>
Output dataset
outputDatasetRandomSampleComplement: <outputFile>
Output dataset complement
Subset and/or reorder features in feature data X.
Parameters
- Dataset [file]
- Dataset pickle file to select features from.
- Selected features [string]
- Comma separated list of feature names or positions. E.g. use <code>1, ‘Feature 2’, 3</code> to select the first three features.
Outputs
- Output dataset [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:SelectFeaturesFromDataset
:
----------------
Arguments
----------------
dataset: Dataset
Argument type: file
Acceptable values:
- Path to a file
featureList: Selected features
Argument type: string
Acceptable values:
- String value
outputDatasetFeatureSubset: Output dataset
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputDatasetFeatureSubset: <outputFile>
Output dataset
Debugging¶
Export data¶
Save a spectral library as a human-readable GeoJSON text file. All binary profile fields will be converted into human-readable dictionary strings.
Parameters
- Spectral library [vector]
- The spectral library to be stored as GeoJSON text file.
Outputs
- Output file [fileDestination]
- Destination GeoJSON file.
Command-line usage
>qgis_process help enmapbox:SaveSpectralLibraryAsGeojsonFile
:
----------------
Arguments
----------------
library: Spectral library
Argument type: vector
Acceptable values:
- Path to a vector layer
outputFile: Output file
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputFile: <outputFile>
Output file
Feature selection¶
Permutation feature importance is a model inspection technique that is especially useful for non-linear or opaque estimators. The permutation feature importance is defined to be the decrease in a model score when a single feature value is randomly shuffled. This procedure breaks the relationship between the feature and the target, thus the drop in the model score is indicative of how much the model depends on the feature. This technique benefits from being model agnostic and can be calculated many times with different permutations of the feature.
Parameters
- Classifier [file]
- Classifier pickle file. In case of an unfitted classifier, also specify a training dataset.
- Training dataset [file]
- Training dataset pickle file used for (re-)fitting the classifier. Can be skipped in case of a fitted classifier.
- Test dataset [file]
- Test dataset pickle file used for performance evaluation. If skipped, the training dataset is used.
- Evaluation metric [enum]
An evaluation metric to use. See Metrics and scoring: quantifying the quality of predictions for further information.
Default: 7
- Number of repetitions [number]
Number of times to permute a feature.
Default: 10
- Random seed [number]
- The seed for the random generator can be provided.
- Open output report in webbrowser after running algorithm [boolean]
Whether to open the output report in the web browser.
Default: True
Outputs
- Output report [fileDestination]
- Report file destination.
Command-line usage
>qgis_process help enmapbox:ClassifierFeatureRankingPermutationImportance
:
----------------
Arguments
----------------
classifier: Classifier
Argument type: file
Acceptable values:
- Path to a file
trainDataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
testDataset: Test dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
evaluationMetric: Evaluation metric
Default value: 7
Argument type: enum
Available values:
- 0: accuracy
- 1: balanced_accuracy
- 2: top_k_accuracy
- 3: average_precision
- 4: neg_brier_score
- 5: f1
- 6: f1_micro
- 7: f1_macro
- 8: f1_weighted
- 9: f1_samples
- 10: neg_log_loss
- 11: precision
- 12: recall
- 13: jaccard
- 14: roc_auc
- 15: roc_auc_ovr
- 16: roc_auc_ovo
- 17: roc_auc_ovr_weighted
- 18: roc_auc_ovo_weighted
Acceptable values:
- Number of selected option, e.g. '1'
- Comma separated list of options, e.g. '1,3'
repeats: Number of repetitions
Default value: 10
Argument type: number
Acceptable values:
- A numeric value
seed: Random seed (optional)
Argument type: number
Acceptable values:
- A numeric value
openReport: Open output report in webbrowser after running algorithm
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputPermutationImportanceRanking: Output report
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputPermutationImportanceRanking: <outputHtml>
Output report
Evaluate feature multicollinearity by performing hierarchical/agglomerative clustering with Ward linkage using squared Spearman rank-order correlation as distance between features. The result report includes i) pairwise squared Spearman rank-order correlation matrix, ii) clustering dendrogram, iii) inter-cluster correlation distribution, iv) intra-cluster correlation distribution, and v) a clustering hierarchy table detailing selected cluster representatives for each cluster size n. For further analysis, all relevant results are also stored as a JSON sidecar file next to the report.
Parameters
- Dataset [file]
- Dataset pickle file with feature data X to be evaluated.
- Do not report plots [boolean]
Skip the creation of plots, which can take a lot of time for large features sets.
Default: False
- Open output report in webbrowser after running algorithm [boolean]
Whether to open the output report in the web browser.
Default: True
Outputs
- Output report [fileDestination]
- Report file destination.
Command-line usage
>qgis_process help enmapbox:HierarchicalFeatureClustering
:
----------------
Arguments
----------------
dataset: Dataset
Argument type: file
Acceptable values:
- Path to a file
noPlot: Do not report plots
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
openReport: Open output report in webbrowser after running algorithm
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputHierarchicalFeatureClustering: Output report
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputHierarchicalFeatureClustering: <outputHtml>
Output report
Import data¶
Prepare a spectral raster layer from the given product. Wavelength and FWHM information is set and data is scaled according to data gain/offset values.
Parameters
- Metadata file [file]
- The metadata XML file associated with the product. Instead of executing this algorithm, you may drag&drop the metadata XML file directly from your system file browser onto the EnMAP-Box map view area.
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:ImportDesisL1BProduct
:
----------------
Arguments
----------------
file: Metadata file
Argument type: file
Acceptable values:
- Path to a file
outputDesisL1CRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputDesisL1CRaster: <outputRaster>
Output raster layer
Prepare a spectral raster layer from the given product. Wavelength and FWHM information is set and data is scaled according to data gain/offset values. Note that the DESIS L1C spectral data file is band interleaved by pixel and compressed, which is very disadvantageous for visualization in QGIS / EnMAP-Box. For faster exploration concider saving the resulting VRT raster layer as GTiff format via the “Translate raster layer” algorithm.
Parameters
- Metadata file [file]
- The metadata XML file associated with the product. Instead of executing this algorithm, you may drag&drop the metadata XML file directly from your system file browser onto the EnMAP-Box map view area.
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:ImportDesisL1CProduct
:
----------------
Arguments
----------------
file: Metadata file
Argument type: file
Acceptable values:
- Path to a file
outputDesisL1CRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputDesisL1CRaster: <outputRaster>
Output raster layer
Prepare a spectral raster layer from the given product. Wavelength and FWHM information is set and data is scaled into the 0 to 10000 range. Note that the DESIS L2D spectral data file is band interleaved by pixel and compressed, which is very disadvantageous for visualization in QGIS / EnMAP-Box. For faster exploration concider saving the resulting VRT raster layer as GTiff format via the “Translate raster layer” algorithm.
Parameters
- Metadata file [file]
- The metadata XML file associated with the product. Instead of executing this algorithm, you may drag&drop the metadata XML file directly from your system file browser onto the EnMAP-Box map view area.
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:ImportDesisL2AProduct
:
----------------
Arguments
----------------
file: Metadata file
Argument type: file
Acceptable values:
- Path to a file
outputDesisL2ARaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputDesisL2ARaster: <outputRaster>
Output raster layer
Prepare VNIR and SWIR spectral raster layer from the given product. Wavelength and FWHM information is set and data is scaled according to data gain/offset values.
Parameters
- Metadata file [file]
- The metadata XML file associated with the product. Instead of executing this algorithm, you may drag&drop the metadata XML file directly from your system file browser onto the EnMAP-Box map view area.
Outputs
- Output VNIR raster layer [rasterDestination]
- Raster file destination.
- Output SWIR raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:ImportEnmapL1BProduct
:
----------------
Arguments
----------------
file: Metadata file
Argument type: file
Acceptable values:
- Path to a file
outputEnmapL1BRasterVnir: Output VNIR raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputEnmapL1BRasterSwir: Output SWIR raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputEnmapL1BRasterVnir: <outputRaster>
Output VNIR raster layer
outputEnmapL1BRasterSwir: <outputRaster>
Output SWIR raster layer
Prepare a spectral raster layer from the given product. Wavelength and FWHM information is set and data is scaled according to data gain/offset values.
Parameters
- Metadata file [file]
- The metadata XML file associated with the product. Instead of executing this algorithm, you may drag&drop the metadata XML file directly from your system file browser onto the EnMAP-Box map view area.
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:ImportEnmapL1CProduct
:
----------------
Arguments
----------------
file: Metadata file
Argument type: file
Acceptable values:
- Path to a file
outputEnmapL1CRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputEnmapL1CRaster: <outputRaster>
Output raster layer
Prepare a spectral raster layer from the given product. Wavelength and FWHM information is set and data is scaled into the 0 to 10000 range.
Parameters
- Metadata file [file]
- The metadata XML file associated with the product. Instead of executing this algorithm, you may drag&drop the metadata XML file directly from your system file browser onto the EnMAP-Box map view area.
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:ImportEnmapL2AProduct
:
----------------
Arguments
----------------
file: Metadata file
Argument type: file
Acceptable values:
- Path to a file
outputEnmapL2ARaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputEnmapL2ARaster: <outputRaster>
Output raster layer
Prepare a spectral raster layer from the given product. Wavelength information is set and data is scaled into the 0 to 1 range.Supports Landsat 4 to 9, collection 1 and 2.
Parameters
- Metadata file [file]
- The *.MTL.txt metadata file associated with the product. Instead of executing this algorithm, you may drag&drop the metadata MTL.txt file directly from your system file browser onto the EnMAP-Box map view area.
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:ImportLandsatL2Product
:
----------------
Arguments
----------------
file: Metadata file
Argument type: file
Acceptable values:
- Path to a file
outputLandsatL2Raster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputLandsatL2Raster: <outputRaster>
Output raster layer
Import PRISMA L1 product from HE5 file to QGIS/GDAL conform GTiff/VRT file format.Note that for the spectral cube and error matrix, the interleave is transposed and stored as GTiff to enable proper visualization in QGIS.All other sub-datasets are stored as light-weight VRT files. For further details visit the PRISMA Documentation Area.
Parameters
- File [file]
- The HE5 product file. The main data contained in the PRS_L1_HRC Swath is the Radiometric Calibrated Coregistersed Hyperspectral Cube. All bands of VNIR Cube and all bands of SWIR Cube are keystone corrected with respect to VNIR Cube band 128 only considering shift Across track. The PRS_L1_PCO Swath basically contains the Radiometric Calibrated Coregistered Panchromatic Image. The PAN Cube is coregistered with respect to VNIR Cube taking into account of the Along Track coregistration. PAN Cube also takes into account the Across track offset PAN – VNIR. All pixel of PAN Cube are keystone corrected with respect to VNIR Cube band 128 only considering shift Across track. Instead of executing this algorithm, you may drag&drop the HE5 file directly from your system file browser on the EnMAP-Box map view area.
- Spectral region [enum]
Spectral region to be imported.
Default: 0
Outputs
- Output VNIR/SWIR Cube raster layer [rasterDestination]
- VNIR/SWIR Cube GTiff raster file destination.
- Output PAN raster layer [rasterDestination]
- PAN VRT raster file destination.
- Output Cloud Mask raster layer [rasterDestination]
- Cloud Mask VRT raster file destination.
- Output Land Cover Mask raster layer [rasterDestination]
- Land Cover Mask VRT raster file destination.
- Output Sun Glint Mask raster layer [rasterDestination]
- Sun Glint Mask VRT raster file destination.
- Output VNIR/SWIR Error Matrix raster layer [rasterDestination]
- VNIR/SWIR Pixel Error Matrix GTiff raster file destination.
- Output VNIR/SWIR Geolocation Fields raster layer [rasterDestination]
- VNIR/SWIR Geolocation Fields VRT raster file destination. Includes Latitude and Longitude bands.
- Output PAN Geolocation Fields raster layer [rasterDestination]
- PAN Geolocation Fields VRT raster file destination. Includes Latitude and Longitude bands.
- Output PAN Error Matrix raster layer [rasterDestination]
- PAN Pixel Error Matrix VRT raster file destination.
Command-line usage
>qgis_process help enmapbox:ImportPrismaL1Product
:
----------------
Arguments
----------------
file: File
Argument type: file
Acceptable values:
- Path to a file
spectralRegion: Spectral region
Default value: 0
Argument type: enum
Available values:
- 0: VNIR/SWIR combined
- 1: VNIR only
- 2: SWIR only
Acceptable values:
- Number of selected option, e.g. '1'
- Comma separated list of options, e.g. '1,3'
outputPrismaL1_spectralCube: Output VNIR/SWIR Cube raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL1_panCube: Output PAN raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL1_cloudMask: Output Cloud Mask raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL1_landCoverMask: Output Land Cover Mask raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL1_sunGlintMask: Output Sun Glint Mask raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrisma1_spectralErrorMatrix: Output VNIR/SWIR Error Matrix raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL1_spectralGeolocationFields: Output VNIR/SWIR Geolocation Fields raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL1_panGeolocationFields: Output PAN Geolocation Fields raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL1_panErrorMatrix: Output PAN Error Matrix raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputPrismaL1_spectralCube: <outputRaster>
Output VNIR/SWIR Cube raster layer
outputPrismaL1_panCube: <outputRaster>
Output PAN raster layer
outputPrismaL1_cloudMask: <outputRaster>
Output Cloud Mask raster layer
outputPrismaL1_landCoverMask: <outputRaster>
Output Land Cover Mask raster layer
outputPrismaL1_sunGlintMask: <outputRaster>
Output Sun Glint Mask raster layer
outputPrisma1_spectralErrorMatrix: <outputRaster>
Output VNIR/SWIR Error Matrix raster layer
outputPrismaL1_spectralGeolocationFields: <outputRaster>
Output VNIR/SWIR Geolocation Fields raster layer
outputPrismaL1_panGeolocationFields: <outputRaster>
Output PAN Geolocation Fields raster layer
outputPrismaL1_panErrorMatrix: <outputRaster>
Output PAN Error Matrix raster layer
Import PRISMA L2B product from HE5 file to QGIS/GDAL conform GTiff/VRT file format.Note that for the spectral cube and error matrix, the interleave is transposed and stored as GTiff to enable proper visualization in QGIS.All other sub-datasets are stored as light-weight VRT files. For further details visit the PRISMA Documentation Area.
Parameters
- File [file]
- The HE5 product file. The main data contained in the PRS_L2B_HCO Swath is the surface spectral radiance Coregistersed Hyperspectral Cube (in instrument geometric reference). The main data contained in the PRS_L2B_PCO Swath is the surface panchromatic reflectance image (in instrument geometric reference). Instead of executing this algorithm, you may drag&drop the HE5 file directly from your system file browser on the EnMAP-Box map view area.
- Spectral region [enum]
Spectral region to be imported.
Default: 0
Outputs
- Output VNIR/SWIR Cube raster layer [rasterDestination]
- VNIR/SWIR Cube GTiff raster file destination.
- Output PAN raster layer [rasterDestination]
- PAN VRT raster file destination.
- Output VNIR/SWIR Error Matrix raster layer [rasterDestination]
- VNIR/SWIR Pixel Error Matrix GTiff raster file destination.
- Output VNIR/SWIR Geolocation Fields raster layer [rasterDestination]
- VNIR/SWIR Geolocation Fields VRT raster file destination. Includes Latitude and Longitude bands.
- Output VNIR/SWIR Geometric Fields raster layer [rasterDestination]
- VNIR/SWIR Geometric Fields VRT raster file destination. Includes Observing Angle, Relative Azimuth Angle and Solar Zenith Angle bands.
- Output PAN Geolocation Fields raster layer [rasterDestination]
- PAN Geolocation Fields VRT raster file destination. Includes Latitude and Longitude bands.
- Output PAN Error Matrix raster layer [rasterDestination]
- PAN Pixel Error Matrix VRT raster file destination.
Command-line usage
>qgis_process help enmapbox:ImportPrismaL2BProduct
:
----------------
Arguments
----------------
file: File
Argument type: file
Acceptable values:
- Path to a file
spectralRegion: Spectral region
Default value: 0
Argument type: enum
Available values:
- 0: VNIR/SWIR combined
- 1: VNIR only
- 2: SWIR only
Acceptable values:
- Number of selected option, e.g. '1'
- Comma separated list of options, e.g. '1,3'
outputPrismaL2B_spectralCube: Output VNIR/SWIR Cube raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL2B_panCube: Output PAN raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrisma2B_spectralErrorMatrix: Output VNIR/SWIR Error Matrix raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL2B_spectralGeolocationFields: Output VNIR/SWIR Geolocation Fields raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL2B_spectralGeometricFields: Output VNIR/SWIR Geometric Fields raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL2B_panGeolocationFields: Output PAN Geolocation Fields raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL2B_panErrorMatrix: Output PAN Error Matrix raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputPrismaL2B_spectralCube: <outputRaster>
Output VNIR/SWIR Cube raster layer
outputPrismaL2B_panCube: <outputRaster>
Output PAN raster layer
outputPrisma2B_spectralErrorMatrix: <outputRaster>
Output VNIR/SWIR Error Matrix raster layer
outputPrismaL2B_spectralGeolocationFields: <outputRaster>
Output VNIR/SWIR Geolocation Fields raster layer
outputPrismaL2B_spectralGeometricFields: <outputRaster>
Output VNIR/SWIR Geometric Fields raster layer
outputPrismaL2B_panGeolocationFields: <outputRaster>
Output PAN Geolocation Fields raster layer
outputPrismaL2B_panErrorMatrix: <outputRaster>
Output PAN Error Matrix raster layer
Import PRISMA L2C product from HE5 file to QGIS/GDAL conform GTiff/VRT file format.Note that for the spectral cube and error matrix, the interleave is transposed and stored as GTiff to enable proper visualization in QGIS.All other sub-datasets are stored as light-weight VRT files. For further details visit the PRISMA Documentation Area.
Parameters
- File [file]
- The HE5 product file. The main data contained in the PRS_L2C_HRO Swath is the surface spectral reflectance Coregistersed Hyperspectral Cube (in instrument geometric reference). The main data contained in the PRS_L2C_PCO Swath is the surface panchromatic reflectance image (in instrument geometric reference). Instead of executing this algorithm, you may drag&drop the HE5 file directly from your system file browser on the EnMAP-Box map view area.
- Spectral region [enum]
Spectral region to be imported.
Default: 0
Outputs
- Output VNIR/SWIR Cube raster layer [rasterDestination]
- VNIR/SWIR Cube GTiff raster file destination.
- Output PAN raster layer [rasterDestination]
- PAN VRT raster file destination.
- Output VNIR/SWIR Error Matrix raster layer [rasterDestination]
- VNIR/SWIR Pixel Error Matrix GTiff raster file destination.
- Output VNIR/SWIR Geolocation Fields raster layer [rasterDestination]
- VNIR/SWIR Geolocation Fields VRT raster file destination. Includes Latitude and Longitude bands.
- Output VNIR/SWIR Geometric Fields raster layer [rasterDestination]
- VNIR/SWIR Geometric Fields VRT raster file destination. Includes Observing Angle, Relative Azimuth Angle and Solar Zenith Angle bands.
- Output PAN Geolocation Fields raster layer [rasterDestination]
- PAN Geolocation Fields VRT raster file destination. Includes Latitude and Longitude bands.
- Output PAN Error Matrix raster layer [rasterDestination]
- PAN Pixel Error Matrix VRT raster file destination.
Command-line usage
>qgis_process help enmapbox:ImportPrismaL2CProduct
:
----------------
Arguments
----------------
file: File
Argument type: file
Acceptable values:
- Path to a file
spectralRegion: Spectral region
Default value: 0
Argument type: enum
Available values:
- 0: VNIR/SWIR combined
- 1: VNIR only
- 2: SWIR only
Acceptable values:
- Number of selected option, e.g. '1'
- Comma separated list of options, e.g. '1,3'
outputPrismaL2C_spectralCube: Output VNIR/SWIR Cube raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL2C_panCube: Output PAN raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrisma2C_spectralErrorMatrix: Output VNIR/SWIR Error Matrix raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL2C_spectralGeolocationFields: Output VNIR/SWIR Geolocation Fields raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL2C_spectralGeometricFields: Output VNIR/SWIR Geometric Fields raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL2C_panGeolocationFields: Output PAN Geolocation Fields raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL2C_panErrorMatrix: Output PAN Error Matrix raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputPrismaL2C_spectralCube: <outputRaster>
Output VNIR/SWIR Cube raster layer
outputPrismaL2C_panCube: <outputRaster>
Output PAN raster layer
outputPrisma2C_spectralErrorMatrix: <outputRaster>
Output VNIR/SWIR Error Matrix raster layer
outputPrismaL2C_spectralGeolocationFields: <outputRaster>
Output VNIR/SWIR Geolocation Fields raster layer
outputPrismaL2C_spectralGeometricFields: <outputRaster>
Output VNIR/SWIR Geometric Fields raster layer
outputPrismaL2C_panGeolocationFields: <outputRaster>
Output PAN Geolocation Fields raster layer
outputPrismaL2C_panErrorMatrix: <outputRaster>
Output PAN Error Matrix raster layer
Import PRISMA L2D product from HE5 file to QGIS/GDAL conform GTiff/VRT file format with proper coordinate reference system.Note that for the spectral cube and error matrix, the interleave is transposed and stored as GTiff to enable proper visualization in QGIS.All other sub-datasets are stored as light-weight VRT files. For further details visit the PRISMA Documentation Area.
Parameters
- File [file]
- The HE5 product file. The main data contained in the PRS_L2d_HCO Swath is the surface spectral reflectance Coregistersed Hyperspectral Cube (in instrument geometric reference). The main data contained in the PRS_L2d_PCO Swath is the surface panchromatic reflectance image (in instrument geometric reference). Instead of executing this algorithm, you may drag&drop the HE5 file directly from your system file browser on the EnMAP-Box map view area.
- Spectral region [enum]
Spectral region to be imported.
Default: 0
- Bad band threshold [number]
- If the proportion of erroneous pixels in the VNIR/SWIR Pixel Error Matrix,exceeds the bad band threshold (a value between 0 and 1), the band is marked as a bad band. If specified, Output VNIR/SWIR Error Matrix raster layer needs to be specified as well.
- Select bad pixel [enum]
Pixels concidered to be erroneous.
Default: [0]
Outputs
- Output VNIR/SWIR Cube raster layer [rasterDestination]
- VNIR/SWIR Cube GTiff raster file destination. The surface spectral reflectance Coregistersed Hyperspectral Cube (in instrument geometric reference).
- Output PAN raster layer [rasterDestination]
- PAN VRT raster file destination. The surface panchromatic reflectance image (in instrument geometric reference).
- Output VNIR/SWIR Geolocation Fields raster layer [rasterDestination]
- VNIR/SWIR Geolocation Fields VRT raster file destination. Includes Latitude and Longitude bands.
- Output VNIR/SWIR Geometric Fields raster layer [rasterDestination]
- VNIR/SWIR Geometric Fields VRT raster file destination. Includes Observing Angle, Relative Azimuth Angle and Solar Zenith Angle bands.
- Output VNIR/SWIR Error Matrix raster layer [rasterDestination]
- VNIR/SWIR Pixel Error Matrix GTiff raster file destination.
- Output PAN Geolocation Fields raster layer [rasterDestination]
- PAN Geolocation Fields VRT raster file destination. Includes Latitude and Longitude bands.
- Output PAN Error Matrix raster layer [rasterDestination]
- PAN Pixel Error Matrix VRT raster file destination.
Command-line usage
>qgis_process help enmapbox:ImportPrismaL2DProduct
:
----------------
Arguments
----------------
file: File
Argument type: file
Acceptable values:
- Path to a file
spectralRegion: Spectral region
Default value: 0
Argument type: enum
Available values:
- 0: VNIR/SWIR combined
- 1: VNIR only
- 2: SWIR only
Acceptable values:
- Number of selected option, e.g. '1'
- Comma separated list of options, e.g. '1,3'
badBandThreshold: Bad band threshold (optional)
Argument type: number
Acceptable values:
- A numeric value
badPixelType: Select bad pixel (optional)
Default value:
Argument type: enum
Available values:
- 0: Invalid pixel from L1 product
- 1: Negative value after atmospheric correction
- 2: Saturated value after atmospheric correction
Acceptable values:
- Number of selected option, e.g. '1'
- Comma separated list of options, e.g. '1,3'
outputPrismaL2D_spectralCube: Output VNIR/SWIR Cube raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL2D_panCube: Output PAN raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL2D_spectralGeolocationFields: Output VNIR/SWIR Geolocation Fields raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL2D_spectralGeometricFields: Output VNIR/SWIR Geometric Fields raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL2D_spectralErrorMatrix: Output VNIR/SWIR Error Matrix raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL2D_panGeolocationFields: Output PAN Geolocation Fields raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputPrismaL2D_panErrorMatrix: Output PAN Error Matrix raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputPrismaL2D_spectralCube: <outputRaster>
Output VNIR/SWIR Cube raster layer
outputPrismaL2D_panCube: <outputRaster>
Output PAN raster layer
outputPrismaL2D_spectralGeolocationFields: <outputRaster>
Output VNIR/SWIR Geolocation Fields raster layer
outputPrismaL2D_spectralGeometricFields: <outputRaster>
Output VNIR/SWIR Geometric Fields raster layer
outputPrismaL2D_spectralErrorMatrix: <outputRaster>
Output VNIR/SWIR Error Matrix raster layer
outputPrismaL2D_panGeolocationFields: <outputRaster>
Output PAN Geolocation Fields raster layer
outputPrismaL2D_panErrorMatrix: <outputRaster>
Output PAN Error Matrix raster layer
Prepare a spectral raster layer from the given product. Wavelength information is set and data is scaled into the 0 to 10000 range.
Parameters
- Metadata file [file]
- The MTD_MSIL2A.xml metadata file associated with the product. Instead of executing this algorithm, you may drag&drop the metadata file directly from your system file browser onto the EnMAP-Box map view area.
- Band list [enum]
Bands to be stacked together. Defaults to all 10m and 20m bands ordered by center wavelength. Note that the destination pixel size matches the smallest/finest pixel size over all selected bands.
Default: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:ImportSentinel2L2AProduct
:
----------------
Arguments
----------------
file: Metadata file
Argument type: file
Acceptable values:
- Path to a file
bandList: Band list (optional)
Default value:
Argument type: enum
Available values:
- 0: B1, Coastal aerosol (443 Nanometers)[60 Meter]
- 1: B2, Blue (492 Nanometers)[10 Meter]
- 2: B3, Green (560 Nanometers)[10 Meter]
- 3: B4, Red (665 Nanometers)[10 Meter]
- 4: B5, Vegetation red edge (704 Nanometers)[20 Meter]
- 5: B6, Vegetation red edge (741 Nanometers)[20 Meter]
- 6: B7, Vegetation red edge (783 Nanometers)[20 Meter]
- 7: B8, NIR (833 Nanometers)[10 Meter]
- 8: B8A, Narrow NIR (865 Nanometers)[20 Meter]
- 9: B9, Water vapour (945 Nanometers)[60 Meter]
- 10: B11, SWIR (1614 Nanometers)[20 Meter]
- 11: B12, SWIR (2202 Nanometers)[20 Meter]
Acceptable values:
- Number of selected option, e.g. '1'
- Comma separated list of options, e.g. '1,3'
outputSentinel2L2ARaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputSentinel2L2ARaster: <outputRaster>
Output raster layer
Masking¶
Areas where the mask layer evaluates to false are set to the source no data value (0, if undefined).
Parameters
- Raster layer [raster]
- Source raster layer.
- Mask layer [layer]
- A mask layer.
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:ApplyMaskLayerToRasterLayer
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
mask: Mask layer
Argument type: layer
Acceptable values:
- Path to a vector, raster or mesh layer
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Create a mask raster layer by applying a user-defined evaluation function band-wise to a source raster layer.
Parameters
- Raster layer [raster]
- Raster layer to be processed band-wise.
- Function [string]
Python code defining the evaluation function. The defined function must return a binary-valued array with same shape as the input array.
Default:
import numpy as np def function(array: np.ndarray, noDataValue: float): # if source no data value is not defined, use zero as no data value if noDataValue is None: noDataValue = 0 # mask no data pixel marray = np.not_equal(array, noDataValue) # mask inf and nan pixel marray[np.logical_not(np.isfinite(array))] = 0 # include further masking criteria here pass return marray
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:CreateMaskRasterLayer
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Function
Default value: import numpy as np
def function(array: np.ndarray, noDataValue: float):
# if source no data value is not defined, use zero as no data value
if noDataValue is None:
noDataValue = 0
# mask no data pixel
marray = np.not_equal(array, noDataValue)
# mask inf and nan pixel
marray[np.logical_not(np.isfinite(array))] = 0
# include further masking criteria here
pass
return marray
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Interprete a layer as a mask layer.
Parameters
- Layer [layer]
- A layer to be interpreted as a mask layer.
- Grid [raster]
- The target grid. Can be skipped if the source layer is a raster layer.
Outputs
- Output mask raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:LayerToMaskRasterLayer
:
----------------
Arguments
----------------
raster: Layer
Argument type: layer
Acceptable values:
- Path to a vector, raster or mesh layer
grid: Grid (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
outputMask: Output mask raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputMask: <outputRaster>
Output mask raster layer
Raster analysis¶
Compute various aggregation functions over all bands, while ignoring no data values.
Parameters
- Raster layer [raster]
- A raster layer with bands to be aggregated.
- Aggregation functions [enum]
- Functions to be used. Number and order of selected functions equals number and order of output bands.
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:AggregateRasterLayerBands
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
function: Aggregation functions
Argument type: enum
Available values:
- 0: arithmetic mean
- 1: standard deviation
- 2: variance
- 3: minimum
- 4: median
- 5: maximum
- 6: sum
- 7: product
- 8: range
- 9: interquartile range
- 10: any true
- 11: all true
- 12: arg minimum
- 13: arg maximum
- 14: 0-th percentile
- 15: 1-th percentile
- 16: 2-th percentile
- 17: 3-th percentile
- 18: 4-th percentile
- 19: 5-th percentile
- 20: 6-th percentile
- 21: 7-th percentile
- 22: 8-th percentile
- 23: 9-th percentile
- 24: 10-th percentile
- 25: 11-th percentile
- 26: 12-th percentile
- 27: 13-th percentile
- 28: 14-th percentile
- 29: 15-th percentile
- 30: 16-th percentile
- 31: 17-th percentile
- 32: 18-th percentile
- 33: 19-th percentile
- 34: 20-th percentile
- 35: 21-th percentile
- 36: 22-th percentile
- 37: 23-th percentile
- 38: 24-th percentile
- 39: 25-th percentile
- 40: 26-th percentile
- 41: 27-th percentile
- 42: 28-th percentile
- 43: 29-th percentile
- 44: 30-th percentile
- 45: 31-th percentile
- 46: 32-th percentile
- 47: 33-th percentile
- 48: 34-th percentile
- 49: 35-th percentile
- 50: 36-th percentile
- 51: 37-th percentile
- 52: 38-th percentile
- 53: 39-th percentile
- 54: 40-th percentile
- 55: 41-th percentile
- 56: 42-th percentile
- 57: 43-th percentile
- 58: 44-th percentile
- 59: 45-th percentile
- 60: 46-th percentile
- 61: 47-th percentile
- 62: 48-th percentile
- 63: 49-th percentile
- 64: 50-th percentile
- 65: 51-th percentile
- 66: 52-th percentile
- 67: 53-th percentile
- 68: 54-th percentile
- 69: 55-th percentile
- 70: 56-th percentile
- 71: 57-th percentile
- 72: 58-th percentile
- 73: 59-th percentile
- 74: 60-th percentile
- 75: 61-th percentile
- 76: 62-th percentile
- 77: 63-th percentile
- 78: 64-th percentile
- 79: 65-th percentile
- 80: 66-th percentile
- 81: 67-th percentile
- 82: 68-th percentile
- 83: 69-th percentile
- 84: 70-th percentile
- 85: 71-th percentile
- 86: 72-th percentile
- 87: 73-th percentile
- 88: 74-th percentile
- 89: 75-th percentile
- 90: 76-th percentile
- 91: 77-th percentile
- 92: 78-th percentile
- 93: 79-th percentile
- 94: 80-th percentile
- 95: 81-th percentile
- 96: 82-th percentile
- 97: 83-th percentile
- 98: 84-th percentile
- 99: 85-th percentile
- 100: 86-th percentile
- 101: 87-th percentile
- 102: 88-th percentile
- 103: 89-th percentile
- 104: 90-th percentile
- 105: 91-th percentile
- 106: 92-th percentile
- 107: 93-th percentile
- 108: 94-th percentile
- 109: 95-th percentile
- 110: 96-th percentile
- 111: 97-th percentile
- 112: 98-th percentile
- 113: 99-th percentile
- 114: 100-th percentile
Acceptable values:
- Number of selected option, e.g. '1'
- Comma separated list of options, e.g. '1,3'
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Calculate convex hull and continuum-removed raster layers.
Parameters
- Raster layer [raster]
- Raster layer with spectral profiles.
- X units [enum]
The x units used for convex hull calculations. In case of Nanometers, only spectral bands are used.
Default: 0
Outputs
- Output convex hull raster layer [rasterDestination]
- Raster file destination.
- Output continuum removed raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:ConvexHullAndContinuumremoval
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
xUnits: X units
Default value: 0
Argument type: enum
Available values:
- 0: Band numbers
- 1: Nanometers
Acceptable values:
- Number of selected option, e.g. '1'
- Comma separated list of options, e.g. '1,3'
outputConvexHull: Output convex hull raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputContinuumRemoved: Output continuum removed raster layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputConvexHull: <outputRaster>
Output convex hull raster layer
outputContinuumRemoved: <outputRaster>
Output continuum removed raster layer
Create a stack of Awesome Spectral Indices and/or custom indices. Credits: the Awesome Spectral Indices project provides a ready-to-use curated list of Spectral Indices for Remote Sensing applications, maintained by David Montero Loaiza. Note that the list of available indices was last updated on 2021-11-15. Should you need other indices added after this date, please file an issue.
Parameters
- Raster layer [raster]
- A spectral raster layer.
- Indices [string]
The list of indices to be created. Usage examples: Create (predefined) NDVI: <code>NDVI</code> Create stack of NDVI and EVI: <code>NDVI, EVI</code> Create custom index: <code>MyNDVI = (N - R) / (N + R)</code> See the full list of predefined Awesome Spectral Indices.
Default: NDVI
- Scale factor [number]
- Spectral reflectance scale factor. Some indices require data to be scaled into the 0 to 1 range. If your data is scaled differently, specify an appropriate scale factor.E.g. for Int16 data scaled into the 0 to 10000 range, use a value of 10000.
Outputs
- Output VRT layer [rasterDestination]
- VRT file destination.
Command-line usage
>qgis_process help enmapbox:CreateSpectralIndices
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
indices: Indices
Default value: NDVI
Argument type: string
Acceptable values:
- String value
scale: Scale factor (optional)
Argument type: number
Acceptable values:
- A numeric value
A: Aerosols band (optional)
Default value: -1
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
B: Blue band (optional)
Default value: -1
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
G: Green band (optional)
Default value: -1
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
R: Red band (optional)
Default value: -1
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
RE1: Red Edge 1 band (optional)
Default value: -1
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
RE2: Red Edge 2 band (optional)
Default value: -1
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
RE3: Red Edge 3 band (optional)
Default value: -1
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
RE4: Red Edge 4 band (optional)
Default value: -1
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
N: NIR band (optional)
Default value: -1
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
S1: SWIR 1 band (optional)
Default value: -1
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
S2: SWIR 2 band (optional)
Default value: -1
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
T1: Thermal 1 band (optional)
Default value: -1
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
T2: Thermal 2 band (optional)
Default value: -1
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
L: Canopy background adjustment (optional)
Default value: 1
Argument type: number
Acceptable values:
- A numeric value
g: Gain factor (optional)
Default value: 2.5
Argument type: number
Acceptable values:
- A numeric value
C1: Coefficient 1 for the aerosol resistance term (optional)
Default value: 6
Argument type: number
Acceptable values:
- A numeric value
C2: Coefficient 2 for the aerosol resistance term (optional)
Default value: 7.5
Argument type: number
Acceptable values:
- A numeric value
cexp: Exponent used for OCVI (optional)
Default value: 1.16
Argument type: number
Acceptable values:
- A numeric value
nexp: Exponent used for GDVI (optional)
Default value: 2
Argument type: number
Acceptable values:
- A numeric value
alpha: Weighting coefficient used for WDRVI (optional)
Default value: 0.1
Argument type: number
Acceptable values:
- A numeric value
gamma: Weighting coefficient used for ARVI (optional)
Default value: 1
Argument type: number
Acceptable values:
- A numeric value
sla: Soil line slope (optional)
Default value: 1
Argument type: number
Acceptable values:
- A numeric value
slb: Soil line intercept (optional)
Default value: 0
Argument type: number
Acceptable values:
- A numeric value
outputVrt: Output VRT layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputVrt: <outputRaster>
Output VRT layer
Aggregates raster layer pixel profiles by categories.
Parameters
- Raster layer [raster]
- Raster layer to be aggregated.
- Categorized raster layer [raster]
- Categorized raster layer specifying the zones.
Outputs
- Output table [vectorDestination]
- Table file destination.
Command-line usage
>qgis_process help enmapbox:RasterLayerZonalAggregation
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
categorizedRaster: Categorized raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
outputTable: Output table
Argument type: vectorDestination
Acceptable values:
- Path for new vector layer
----------------
Outputs
----------------
outputTable: <outputVector>
Output table
Perform mathematical calculations on raster layer and vector layer data. Use any NumPy-based arithmetic, or even arbitrary Python code. See the RasterMath cookbook recipe for detailed usage instructions.
Parameters
- Code [string]
- The mathematical calculation to be performed on the selected input arrays. Select inputs in the available data sources section or use the raster layer R1, …, R10 and vector layer V1, …, V10. In the code snippets section you can find some prepdefined code snippets ready to use. See the RasterMath cookbook recipe for detailed usage instructions.
- Grid [raster]
- The destination grid. If not specified, the grid of the first raster layer is used.
- 32-bit floating-point inputs [boolean]
Whether to cast inputs to 32-bit floating point.
Default: True
- Block overlap [number]
- The number of columns and rows to read from the neighbouring blocks. Needs to be specified only when performing spatial operations, to avoid artifacts at block borders.
- Monolithic processing [boolean]
Whether to read all data for the full extent at once, instead of block-wise processing. This may be useful for some spatially unbound operations, like segmentation or region growing, when calculating global statistics, or if RAM is not an issue at all.
Default: False
- Raster layers mapped to RS [multilayer]
- Additional list of raster layers mapped to a list variable RS.
Outputs
- Output raster layer [rasterDestination]
- Raster file destination for writing the default output variable. Additional outputs are written into the same directory. See the RasterMath cookbook recipe for detailed usage instructions.
Command-line usage
>qgis_process help enmapbox:RasterMath
:
----------------
Arguments
----------------
code: Code
Argument type: string
Acceptable values:
- String value
grid: Grid (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
floatInput: 32-bit floating-point inputs
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
overlap: Block overlap (optional)
Argument type: number
Acceptable values:
- A numeric value
monolithic: Monolithic processing (optional)
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
R1: Raster layer mapped to R1 (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
R2: Raster layer mapped to R2 (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
R3: Raster layer mapped to R3 (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
R4: Raster layer mapped to R4 (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
R5: Raster layer mapped to R5 (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
R6: Raster layer mapped to R6 (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
R7: Raster layer mapped to R7 (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
R8: Raster layer mapped to R8 (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
R9: Raster layer mapped to R9 (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
R10: Raster layer mapped to R10 (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
V1: Vector layer mapped to V1 (optional)
Argument type: vector
Acceptable values:
- Path to a vector layer
V2: Vector layer mapped to V2 (optional)
Argument type: vector
Acceptable values:
- Path to a vector layer
V3: Vector layer mapped to V3 (optional)
Argument type: vector
Acceptable values:
- Path to a vector layer
V4: Vector layer mapped to V4 (optional)
Argument type: vector
Acceptable values:
- Path to a vector layer
V5: Vector layer mapped to V5 (optional)
Argument type: vector
Acceptable values:
- Path to a vector layer
V6: Vector layer mapped to V6 (optional)
Argument type: vector
Acceptable values:
- Path to a vector layer
V7: Vector layer mapped to V7 (optional)
Argument type: vector
Acceptable values:
- Path to a vector layer
V8: Vector layer mapped to V8 (optional)
Argument type: vector
Acceptable values:
- Path to a vector layer
V9: Vector layer mapped to V9 (optional)
Argument type: vector
Acceptable values:
- Path to a vector layer
V10: Vector layer mapped to V10 (optional)
Argument type: vector
Acceptable values:
- Path to a vector layer
RS: Raster layers mapped to RS (optional)
Argument type: multilayer
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Creates a new point layer with the same attributes of the input layer and the raster values corresponding to the pixels covered by polygons or point location. The resulting point vector contains 1) all input attributes from the Locations vector, 2) attributes SAMPLE_{i}, one for each input raster band, 3) two attributes PIXEL_X, PIXEL_Y for storing the raster pixel locations (zero-based),and 4), in case of polygon locations, an attribute COVER for storing the pixel coverage (%). Note that we assume non-overlapping feature geometries! In case of overlapping geometries, split the Locations layer into non-overlapping subsets, perform the sampling for each subset individually, and finally concatenate the results.
Parameters
- Raster layer [raster]
- A raster layer to sample data from.
- Vector layer [vector]
- A vector layer defining the locations to sample.
- Pixel coverage (%) [range]
Samples with polygon pixel coverage outside the given range are excluded. This parameter has no effect in case of point locations.
Default: [50, 100]
Outputs
- Output point layer [vectorDestination]
- Vector file destination.
Command-line usage
>qgis_process help enmapbox:SampleRasterLayerValues
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
vector: Vector layer
Argument type: vector
Acceptable values:
- Path to a vector layer
coverageRange: Pixel coverage (%) (optional)
Default value:
Argument type: range
Acceptable values:
- Two comma separated numeric values, e.g. '1,10'
outputPointsData: Output point layer
Argument type: vectorDestination
Acceptable values:
- Path for new vector layer
----------------
Outputs
----------------
outputPointsData: <outputVector>
Output point layer
Create a single-band VRT raster layer specifying a VRT Python Pixel Function. Use any NumPy-based arithmetic, or even arbitrary Python code.
Parameters
- Raster layer [raster]
- Input raster layer.
- Selected bands [band]
- List of input bands.
- Code [string]
- The mathematical calculation to be performed on the selected input bands in_ar.Result must be copied to out_ar. For detailed usage information read the VRT Python Pixel Function docs.
- Data type [enum]
Output data type.
Default: 5
- No data value [number]
- Output no data value.
- Band name [string]
- Output band name.
- Buffer radius [number]
- The number of columns and rows to read from the neighbouring blocks. Needs to be specified only when performing spatial operations, to avoid artifacts at block borders.
Outputs
- Output VRT layer [rasterDestination]
- VRT file destination.
Command-line usage
>qgis_process help enmapbox:VrtBandMath
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
bandList: Selected bands
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
code: Code
Argument type: string
Acceptable values:
- String value
dataType: Data type (optional)
Default value: 5
Argument type: enum
Available values:
- 0: Byte
- 1: Int16
- 2: UInt16
- 3: UInt32
- 4: Int32
- 5: Float32
- 6: Float64
Acceptable values:
- Number of selected option, e.g. '1'
- Comma separated list of options, e.g. '1,3'
noData: No data value (optional)
Argument type: number
Acceptable values:
- A numeric value
bandName: Band name (optional)
Argument type: string
Acceptable values:
- String value
overlap: Buffer radius (optional)
Argument type: number
Acceptable values:
- A numeric value
outputVrt: Output VRT layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputVrt: <outputRaster>
Output VRT layer
Raster conversion¶
Create an RGB image from a class fraction layer or class probability layer.The RGB pixel color of a single pixel is given by the weighted mean of the given category colors.The weights are given by class fractions/probabilities (i.e. values between 0 and 1). For example, pure pixels with cover fractions of 1 appear in its pure category color. A mixed-pixel with a 50% fractions in two categories colored in red and green,appears in a dull yellow ( 0.5 x (255, 0, 0) + 0.5 x (0, 255, 0) = (127, 127, 0) ).
Parameters
- Class probability/fraction layer [raster]
- A class fraction layer or class probability layer used as weights for calculating final pixel colors.
- Colors [string]
- Comma separated list of hex-color strings (e.g. ‘#FF0000’ for red) representing (pure) category colors, one color for each band in the given class probability/fraction layer. If not specified, colors have to be specified by a categorized layer (Colors from categorized layer).
- Colors from categorized layer [layer]
- A categorized layer with (pure) category colors, one category for each band in the given class probability/fraction layer. If not specified, colors have to be specified by list (Colors).
Outputs
- Output RGB image [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:CreateRgbImageFromClassProbabilityfractionLayer
:
----------------
Arguments
----------------
probability: Class probability/fraction layer
Argument type: raster
Acceptable values:
- Path to a raster layer
colors: Colors (optional)
Argument type: string
Acceptable values:
- String value
colorsLayer: Colors from categorized layer (optional)
Argument type: layer
Acceptable values:
- Path to a vector, raster or mesh layer
outputRGBImage: Output RGB image
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRGBImage: <outputRaster>
Output RGB image
Saves a raster layer as a GeoTiff, ENVI or VRT file. This is a slimmed down version of the more powerful “Translate raster layer” algorithm.
Parameters
- Raster layer [raster]
- Source raster layer.
- Copy metadata [boolean]
Whether to copy metadata from source to destination.
Default: True
- Copy style [boolean]
Whether to copy style from source to destination.
Default: True
- Output options [string]
Output format and creation options.
Default: **
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SaveRasterLayerAs
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
copyMetadata: Copy metadata
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
copyStyle: Copy style
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
creationProfile: Output options (optional)
Default value:
Argument type: string
Acceptable values:
- String value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Translates categorized raster layer into target grid. Resampling is done via a two-step majority voting approach. First, the categorized raster layer is resampled at x10 finer resolution, and subsequently aggregated back to the target resolution using majority voting. This approach leads to pixel-wise class decisions that are accurate to the percent.
Parameters
- Categorized raster layer [raster]
- A categorized raster layer to be resampled.
- Grid [raster]
- The target grid.
- Majority voting [boolean]
Whether to use majority voting. Turn off to use simple nearest neighbour resampling, which is much faster, but may result in highly inaccurate decisions.
Default: True
Outputs
- Output categorized raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:TranslateCategorizedRasterLayer
:
----------------
Arguments
----------------
categorizedRaster: Categorized raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
grid: Grid
Argument type: raster
Acceptable values:
- Path to a raster layer
majorityVoting: Majority voting
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputTranslatedCategorizedRaster: Output categorized raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputTranslatedCategorizedRaster: <outputRaster>
Output categorized raster layer
Convert raster data between different formats, potentially performing some operations like spatial subsetting, spatial resampling, reprojection, band subsetting, band reordering, data scaling, no data value specification, and data type conversion.
Parameters
- Raster layer [raster]
- Source raster layer.
- Selected bands [band]
- Bands to subset and rearrange. An empty selection defaults to all bands in native order.
- Grid [raster]
- The destination grid.
- Copy metadata [boolean]
Whether to copy GDAL metadata from source to destination.
Default: False
- Copy style [boolean]
Whether to copy style from source to destination.
Default: False
- Exclude bad bands [boolean]
Whether to exclude bad bands (given by BBL metadata item inside ENVI domain). Also see The ENVI Header Format for more details: https://www.l3harrisgeospatial.com/docs/ENVIHeaderFiles.html
Default: False
- Write ENVI header [boolean]
Whether to write an ENVI header *.hdr sidecar file with spectral metadata required for proper visualization in ENVI software.
Default: True
- Spectral raster layer for band subsetting [raster]
- A spectral raster layer used for specifying a band subset by matching the center wavelength.
- Selected spectral bands [band]
- Spectral bands used to match source raster bands.An empty selection defaults to all bands in native order.
- Data offset value [number]
- A data offset value applied to each band.
- Data gain/scale value [number]
- A data gain/scale value applied to each band.
- Spatial extent [extent]
- Spatial extent for clipping the destination grid, which is given by the source Raster or the selected Grid. In both cases, the extent is aligned with the actual pixel grid to avoid subpixel shifts.
- Column subset [range]
- Column subset range in pixels to extract.
- Row subset [range]
- Rows subset range in pixels to extract.
- Resample algorithm [enum]
Spatial resample algorithm.
Default: 0
- Source no data value [number]
- The value to be used instead of the original raster layer no data value.
- No data value [number]
- The value to be used instead of the default destination no data value.
- Unset source no data value [boolean]
Whether to unset (i.e. not use) the source no data value.
Default: False
- Unset no data value [boolean]
Whether to unset the destination no data value.
Default: False
- Working Data type [enum]
- Working data type that is applied before resampling.
- Data type [enum]
- Output data type.
- Output options [string]
Output format and creation options. The default format is GeoTiff with creation options: INTERLEAVE=BAND, COMPRESS=LZW, TILED=YES, BIGTIFF=YES
Default: **
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:TranslateRasterLayer
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
bandList: Selected bands (optional)
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
grid: Grid (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
copyMetadata: Copy metadata
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
copyStyle: Copy style
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
excludeBadBands: Exclude bad bands
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
writeEnviHeader: Write ENVI header
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
spectralSubset: Spectral raster layer for band subsetting (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
spectralBandList: Selected spectral bands (optional)
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
offset: Data offset value (optional)
Argument type: number
Acceptable values:
- A numeric value
scale: Data gain/scale value (optional)
Argument type: number
Acceptable values:
- A numeric value
extent: Spatial extent (optional)
Argument type: extent
Acceptable values:
- A comma delimited string of x min, x max, y min, y max. E.g. '4,10,101,105'
- Path to a layer. The extent of the layer is used.
sourceColumns: Column subset (optional)
Argument type: range
Acceptable values:
- Two comma separated numeric values, e.g. '1,10'
sourceRows: Row subset (optional)
Argument type: range
Acceptable values:
- Two comma separated numeric values, e.g. '1,10'
resampleAlg: Resample algorithm
Default value: 0
Argument type: enum
Available values:
- 0: NearestNeighbour
- 1: Bilinear
- 2: Cubic
- 3: CubicSpline
- 4: Lanczos
- 5: Average
- 6: Mode
- 7: Min
- 8: Q1
- 9: Med
- 10: Q3
- 11: Max
Acceptable values:
- Number of selected option, e.g. '1'
- Comma separated list of options, e.g. '1,3'
sourceNoData: Source no data value (optional)
Argument type: number
Acceptable values:
- A numeric value
noData: No data value (optional)
Argument type: number
Acceptable values:
- A numeric value
unsetSourceNoData: Unset source no data value
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
unsetNoData: Unset no data value
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
workingType: Working Data type (optional)
Argument type: enum
Available values:
- 0: Byte
- 1: Int16
- 2: UInt16
- 3: UInt32
- 4: Int32
- 5: Float32
- 6: Float64
Acceptable values:
- Number of selected option, e.g. '1'
- Comma separated list of options, e.g. '1,3'
dataType: Data type (optional)
Argument type: enum
Available values:
- 0: Byte
- 1: Int16
- 2: UInt16
- 3: UInt32
- 4: Int32
- 5: Float32
- 6: Float64
Acceptable values:
- Number of selected option, e.g. '1'
- Comma separated list of options, e.g. '1,3'
creationProfile: Output options (optional)
Default value:
Argument type: string
Acceptable values:
- String value
outputTranslatedRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputTranslatedRaster: <outputRaster>
Output raster layer
Write/update the ENVI *.hdr header file to enable full compatibility to the ENVI software. The header file stores wavelength, FWHM and bad band multiplier (BBL) information.
Parameters
- Raster layer [raster]
- Source GeoTiff /ENVI raster layer.
Command-line usage
>qgis_process help enmapbox:WriteEnviHeader
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
----------------
Outputs
----------------
Raster miscellaneous¶
Create an empty raster that can be used as a grid.
Parameters
- CRS [crs]
- Destination coordinate reference system.
- Extent [extent]
- Destination extent.
- Size units [enum]
- Units to use when defining target raster size/resolution.
- Width / horizontal resolution [number]
Target width if size units is “Pixels”, or horizontal resolution if size units is “Georeferenced units”.
Default: 0
- Height / vertical resolution [number]
Target height if size units is “Pixels”, or vertical resolution if size units is “Georeferenced units”.
Default: 0
Outputs
- Output grid [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:CreateGrid
:
----------------
Arguments
----------------
crs: CRS
Argument type: crs
Acceptable values:
- CRS as an auth ID (e.g. 'EPSG:3111')
- CRS as a PROJ4 string (e.g. 'PROJ4:…')
- CRS as a WKT string (e.g. 'WKT:…')
- Path to a layer. The CRS of the layer is used.
extent: Extent
Argument type: extent
Acceptable values:
- A comma delimited string of x min, x max, y min, y max. E.g. '4,10,101,105'
- Path to a layer. The extent of the layer is used.
unit: Size units
Argument type: enum
Available values:
- 0: Pixels
- 1: Georeferenced units
Acceptable values:
- Number of selected option, e.g. '1'
- Comma separated list of options, e.g. '1,3'
width: Width / horizontal resolution
Default value: 0
Argument type: number
Acceptable values:
- A numeric value
hight: Height / vertical resolution
Default value: 0
Argument type: number
Acceptable values:
- A numeric value
outputGrid: Output grid
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputGrid: <outputRaster>
Output grid
Set band properties for the given GDAL raster source. Be sure to close the raster in QGIS beforehand.
Parameters
- GDAL raster source [file]
- GDAL raster source.
- Band names [string]
- List of band name strings (e.g).
- Center wavelength values [string]
- List of band center wavelength values in nanometers. Use nan value to unset property.
- Full width at half maximum (FWHM) values [string]
- List of band FWHM values in nanometers. Use nan value to unset property.
- Bad band multipliers [string]
- List of bad band multiplier values (BBL).
- Start times [string]
- List of band start time timestamps strings. Format is: 2009-08-20T09:44:50. Use empty string to unset property
- End times [string]
- List of band end time timestamps strings. Format is: 2009-08-20T09:44:50. Use empty string to unset property
- Offsets [string]
- List of band data offset values.
- Scales [string]
- List of band data scale/gain values.
- No data values [string]
- List of band no data values. Use None to unset property.
Command-line usage
>qgis_process help enmapbox:EditRasterSourceBandProperties
:
----------------
Arguments
----------------
source: GDAL raster source
Argument type: file
Acceptable values:
- Path to a file
names: Band names (optional)
Argument type: string
Acceptable values:
- String value
wavelengths: Center wavelength values (optional)
Argument type: string
Acceptable values:
- String value
fwhms: Full width at half maximum (FWHM) values (optional)
Argument type: string
Acceptable values:
- String value
badBandMultipliers: Bad band multipliers (optional)
Argument type: string
Acceptable values:
- String value
startTimes: Start times (optional)
Argument type: string
Acceptable values:
- String value
endTimes: End times (optional)
Argument type: string
Acceptable values:
- String value
offsets: Offsets (optional)
Argument type: string
Acceptable values:
- String value
scales: Scales (optional)
Argument type: string
Acceptable values:
- String value
noDataValues: No data values (optional)
Argument type: string
Acceptable values:
- String value
----------------
Outputs
----------------
Stack raster layers and store the result as a VRT file.This is a slimmed down version of the more powerful/complicated GDAL “Build virtual raster” algorithm. If you also want to delete or rearrange individual bands, just use the “Subset raster layer bands” algorithm afterwards.
Parameters
- Raster layers [multilayer]
- Source raster layers.
- Grid [raster]
- Reference grid specifying the destination extent, pixel size and projection. If not defined, gdal.BuildVrt defaults are used.
- Band [number]
- Specify a band number used for stacking, instead of using all bands.
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:StackRasterLayers
:
----------------
Arguments
----------------
rasters: Raster layers
Argument type: multilayer
grid: Grid (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
band: Band (optional)
Argument type: number
Acceptable values:
- A numeric value
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Subsets raster layer bands and stores the result as a VRT file.This is a slimmed down version of the more powerful “Translate raster layer” algorithm.
Parameters
- Raster layer [raster]
- Source raster layer.
- Selected bands [band]
- Bands to subset and rearrange. An empty selection defaults to all bands in native order.
- Exclude bad bands [boolean]
Whether to exclude bad bands.
Default: False
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SubsetRasterLayerBands
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
bandList: Selected bands (optional)
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
excludeBadBands: Exclude bad bands
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Raster projections¶
Geolocate a raster layer using geolocation arrays. See Geolocation Arrays in the GDAL documentation for details on the concept and parameters.
Parameters
- Raster layer [raster]
- A raster layer to be geolocated.
- X locations raster layer [raster]
- A raster layer containing the x geolocation array.
- Y locations raster layer [raster]
- A raster layer containing the y geolocation array.
- Grid [raster]
- The destination grid. If skipped, the grid CRS is set to the CRS of the geolocation arrays, extent and resolution is controlled by gdal.Warp defaults.
- Locations CRS [crs]
The coordinate reference system of the geolocation arrays.
Default: <QgsCoordinateReferenceSystem: EPSG:4326>
- No data value [number]
- Value used to fill no data regions introduced by warping.
- X locations band [band]
- The x coordinates band.
- Y locations band [band]
- The y coordinates band.
- Pixel offset [number]
Pixel offset into geo-located data of left geolocation pixel.
Default: 0
- Line offset [number]
Line offset into geo-located data of top geolocation pixel.
Default: 0
- Pixel step [number]
Each geolocation pixel represents this many geolocated pixels.
Default: 1
- Line step [number]
Each geolocation pixel represents this many geolocated lines.
Default: 1
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:GeolocateRasterLayer
:
----------------
Arguments
----------------
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
xRaster: X locations raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
yRaster: Y locations raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
grid: Grid (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
crs: Locations CRS (optional)
Default value: EPSG:4326
Argument type: crs
Acceptable values:
- CRS as an auth ID (e.g. 'EPSG:3111')
- CRS as a PROJ4 string (e.g. 'PROJ4:…')
- CRS as a WKT string (e.g. 'WKT:…')
- Path to a layer. The CRS of the layer is used.
noDataValue: No data value (optional)
Argument type: number
Acceptable values:
- A numeric value
xBand: X locations band (optional)
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
yBand: Y locations band (optional)
Argument type: band
Acceptable values:
- Integer value representing an existing raster band number
pixelOffset: Pixel offset (optional)
Default value: 0
Argument type: number
Acceptable values:
- A numeric value
lineOffset: Line offset (optional)
Default value: 0
Argument type: number
Acceptable values:
- A numeric value
pixelStep: Pixel step (optional)
Default value: 1
Argument type: number
Acceptable values:
- A numeric value
lineStep: Line step (optional)
Default value: 1
Argument type: number
Acceptable values:
- A numeric value
outputGeolocatedRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputGeolocatedRaster: <outputRaster>
Output raster layer
Regression¶
Implementation of the scikit-learn API for CatBoost regressor.
Parameters
- Regressor [string]
Scikit-learn python code. See CatBoostRegressor for information on different parameters.
Default:
from catboost import CatBoostRegressor regressor = CatBoostRegressor(n_estimators=100)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output regressor [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitCatboostregressor
:
----------------
Arguments
----------------
regressor: Regressor
Default value: from catboost import CatBoostRegressor
regressor = CatBoostRegressor(n_estimators=100)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputRegressor: Output regressor
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressor: <outputFile>
Output regressor
Gaussian process regression (GPR).
Parameters
- Regressor [string]
Scikit-learn python code. See GaussianProcessRegressor for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from sklearn.gaussian_process import GaussianProcessRegressor from sklearn.gaussian_process.kernels import RBF gpr = GaussianProcessRegressor(RBF()) regressor = make_pipeline(StandardScaler(), gpr)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output regressor [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitGaussianprocessregressor
:
----------------
Arguments
----------------
regressor: Regressor
Default value: from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process.kernels import RBF
gpr = GaussianProcessRegressor(RBF())
regressor = make_pipeline(StandardScaler(), gpr)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputRegressor: Output regressor
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressor: <outputFile>
Output regressor
A generic regressor.
Parameters
- Regressor [string]
Scikit-learn python code.
Default:
from sklearn.dummy import DummyRegressor regressor = DummyRegressor()
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output regressor [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitGenericRegressor
:
----------------
Arguments
----------------
regressor: Regressor
Default value: from sklearn.dummy import DummyRegressor
regressor = DummyRegressor()
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputRegressor: Output regressor
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressor: <outputFile>
Output regressor
Kernel ridge regression. Kernel ridge regression (KRR) combines ridge regression (linear least squares with l2-norm regularization) with the kernel trick. It thus learns a linear function in the space induced by the respective kernel and the data. For non-linear kernels, this corresponds to a non-linear function in the original space. The form of the model learned by KRR is identical to support vector regression (SVR). However, different loss functions are used: KRR uses squared error loss while support vector regression uses epsilon-insensitive loss, both combined with l2 regularization. In contrast to SVR, fitting a KRR model can be done in closed-form and is typically faster for medium-sized datasets. On the other hand, the learned model is non-sparse and thus slower than SVR, which learns a sparse model for epsilon > 0, at prediction-time.
Parameters
- Regressor [string]
Scikit-learn python code. See KernelRidge for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.model_selection import GridSearchCV from sklearn.preprocessing import StandardScaler from sklearn.kernel_ridge import KernelRidge krr = KernelRidge() param_grid = {'kernel': ['rbf'], 'gamma': [0.001, 0.01, 0.1, 1, 10, 100, 1000], 'alpha': [0.001, 0.01, 0.1, 1, 10, 100, 1000]} tunedKRR = GridSearchCV(cv=3, estimator=krr, scoring='neg_mean_absolute_error', param_grid=param_grid) regressor = make_pipeline(StandardScaler(), tunedKRR)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output regressor [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitKernelridge
:
----------------
Arguments
----------------
regressor: Regressor
Default value: from sklearn.pipeline import make_pipeline
from sklearn.model_selection import GridSearchCV
from sklearn.preprocessing import StandardScaler
from sklearn.kernel_ridge import KernelRidge
krr = KernelRidge()
param_grid = {'kernel': ['rbf'],
'gamma': [0.001, 0.01, 0.1, 1, 10, 100, 1000],
'alpha': [0.001, 0.01, 0.1, 1, 10, 100, 1000]}
tunedKRR = GridSearchCV(cv=3, estimator=krr, scoring='neg_mean_absolute_error', param_grid=param_grid)
regressor = make_pipeline(StandardScaler(), tunedKRR)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputRegressor: Output regressor
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressor: <outputFile>
Output regressor
Implementation of the scikit-learn API for LightGBM regressor.
Parameters
- Regressor [string]
Scikit-learn python code. See LGBMRegressor for information on different parameters.
Default:
from lightgbm import LGBMRegressor regressor = LGBMRegressor(n_estimators=100)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output regressor [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitLgbmregressor
:
----------------
Arguments
----------------
regressor: Regressor
Default value: from lightgbm import LGBMRegressor
regressor = LGBMRegressor(n_estimators=100)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputRegressor: Output regressor
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressor: <outputFile>
Output regressor
Ordinary least squares Linear Regression. LinearRegression fits a linear model with coefficients w = (w1, …, wp) to minimize the residual sum of squares between the observed targets in the dataset, and the targets predicted by the linear approximation.
Parameters
- Regressor [string]
Scikit-learn python code. See LinearRegression for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from sklearn.linear_model import LinearRegression linearRegression = LinearRegression() regressor = make_pipeline(StandardScaler(), linearRegression)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output regressor [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitLinearregression
:
----------------
Arguments
----------------
regressor: Regressor
Default value: from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LinearRegression
linearRegression = LinearRegression()
regressor = make_pipeline(StandardScaler(), linearRegression)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputRegressor: Output regressor
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressor: <outputFile>
Output regressor
Linear Support Vector Regression. Similar to SVR with parameter kernel=’linear’, but implemented in terms of liblinear rather than libsvm, so it has more flexibility in the choice of penalties and loss functions and should scale better to large numbers of samples.
Parameters
- Regressor [string]
Scikit-learn python code. See LinearSVR for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.model_selection import GridSearchCV from sklearn.multioutput import MultiOutputRegressor from sklearn.preprocessing import StandardScaler from sklearn.svm import LinearSVR svr = LinearSVR() param_grid = {'epsilon': [0.], 'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]} tunedSVR = GridSearchCV(cv=3, estimator=svr, scoring='neg_mean_absolute_error', param_grid=param_grid) scaledAndTunedSVR = make_pipeline(StandardScaler(), tunedSVR) regressor = MultiOutputRegressor(scaledAndTunedSVR)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output regressor [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitLinearsvr
:
----------------
Arguments
----------------
regressor: Regressor
Default value: from sklearn.pipeline import make_pipeline
from sklearn.model_selection import GridSearchCV
from sklearn.multioutput import MultiOutputRegressor
from sklearn.preprocessing import StandardScaler
from sklearn.svm import LinearSVR
svr = LinearSVR()
param_grid = {'epsilon': [0.], 'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]}
tunedSVR = GridSearchCV(cv=3, estimator=svr, scoring='neg_mean_absolute_error', param_grid=param_grid)
scaledAndTunedSVR = make_pipeline(StandardScaler(), tunedSVR)
regressor = MultiOutputRegressor(scaledAndTunedSVR)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputRegressor: Output regressor
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressor: <outputFile>
Output regressor
Partial Least Squares regression.
Parameters
- Regressor [string]
Scikit-learn python code. See PLSRegression for information on different parameters.
Default:
from sklearn.cross_decomposition import PLSRegression regressor = PLSRegression(n_components=2)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output regressor [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitPlsregression
:
----------------
Arguments
----------------
regressor: Regressor
Default value: from sklearn.cross_decomposition import PLSRegression
regressor = PLSRegression(n_components=2)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputRegressor: Output regressor
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressor: <outputFile>
Output regressor
A random forest regressor. A random forest is a meta estimator that fits a number of classifying decision trees on various sub-samples of the dataset and uses averaging to improve the predictive accuracy and control over-fitting. The sub-sample size is controlled with the max_samples parameter if bootstrap=True (default), otherwise the whole dataset is used to build each tree.
Parameters
- Regressor [string]
Scikit-learn python code. See RandomForestRegressor for information on different parameters.
Default:
from sklearn.ensemble import RandomForestRegressor regressor = RandomForestRegressor(n_estimators=100, oob_score=True)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output regressor [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitRandomforestregressor
:
----------------
Arguments
----------------
regressor: Regressor
Default value: from sklearn.ensemble import RandomForestRegressor
regressor = RandomForestRegressor(n_estimators=100, oob_score=True)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputRegressor: Output regressor
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressor: <outputFile>
Output regressor
Epsilon-Support Vector Regression. The free parameters in the model are C and epsilon. The implementation is based on libsvm. The fit time complexity is more than quadratic with the number of samples which makes it hard to scale to datasets with more than a couple of 10000 samples.
Parameters
- Regressor [string]
Scikit-learn python code. See SVR, GridSearchCV, StandardScaler for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.model_selection import GridSearchCV from sklearn.preprocessing import StandardScaler from sklearn.svm import SVR svr = SVR() param_grid = {'kernel': ['poly'], 'epsilon': [0.], 'coef0': [0], 'degree': [3], 'gamma': [0.001, 0.01, 0.1, 1, 10, 100, 1000], 'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]} tunedSVR = GridSearchCV(cv=3, estimator=svr, scoring='neg_mean_absolute_error', param_grid=param_grid) regressor = make_pipeline(StandardScaler(), tunedSVR)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output regressor [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitSvrPolynomialKernel
:
----------------
Arguments
----------------
regressor: Regressor
Default value: from sklearn.pipeline import make_pipeline
from sklearn.model_selection import GridSearchCV
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVR
svr = SVR()
param_grid = {'kernel': ['poly'],
'epsilon': [0.],
'coef0': [0],
'degree': [3],
'gamma': [0.001, 0.01, 0.1, 1, 10, 100, 1000],
'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]}
tunedSVR = GridSearchCV(cv=3, estimator=svr, scoring='neg_mean_absolute_error', param_grid=param_grid)
regressor = make_pipeline(StandardScaler(), tunedSVR)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputRegressor: Output regressor
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressor: <outputFile>
Output regressor
Epsilon-Support Vector Regression. The free parameters in the model are C and epsilon. The implementation is based on libsvm. The fit time complexity is more than quadratic with the number of samples which makes it hard to scale to datasets with more than a couple of 10000 samples.
Parameters
- Regressor [string]
Scikit-learn python code. See SVR, GridSearchCV, StandardScaler for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.model_selection import GridSearchCV from sklearn.preprocessing import StandardScaler from sklearn.svm import SVR svr = SVR() param_grid = {'kernel': ['rbf'], 'epsilon': [0.], 'gamma': [0.001, 0.01, 0.1, 1, 10, 100, 1000], 'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]} tunedSVR = GridSearchCV(cv=3, estimator=svr, scoring='neg_mean_absolute_error', param_grid=param_grid) regressor = make_pipeline(StandardScaler(), tunedSVR)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output regressor [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitSvrRbfKernel
:
----------------
Arguments
----------------
regressor: Regressor
Default value: from sklearn.pipeline import make_pipeline
from sklearn.model_selection import GridSearchCV
from sklearn.preprocessing import StandardScaler
from sklearn.svm import SVR
svr = SVR()
param_grid = {'kernel': ['rbf'],
'epsilon': [0.],
'gamma': [0.001, 0.01, 0.1, 1, 10, 100, 1000],
'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]}
tunedSVR = GridSearchCV(cv=3, estimator=svr, scoring='neg_mean_absolute_error', param_grid=param_grid)
regressor = make_pipeline(StandardScaler(), tunedSVR)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputRegressor: Output regressor
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressor: <outputFile>
Output regressor
Implementation of the scikit-learn API for XGBoost regression.
Parameters
- Regressor [string]
Scikit-learn python code. See XGBRegressor for information on different parameters.
Default:
from xgboost import XGBRegressor regressor = XGBRegressor(n_estimators=100)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output regressor [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitXgbregressor
:
----------------
Arguments
----------------
regressor: Regressor
Default value: from xgboost import XGBRegressor
regressor = XGBRegressor(n_estimators=100)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputRegressor: Output regressor
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressor: <outputFile>
Output regressor
Implementation of the scikit-learn API for XGBoost random forest regression.
Parameters
- Regressor [string]
Scikit-learn python code. See XGBRFRegressor for information on different parameters.
Default:
from xgboost import XGBRFRegressor regressor = XGBRFRegressor(n_estimators=100)
- Training dataset [file]
- Training dataset pickle file used for fitting the classifier. If not specified, an unfitted classifier is created.
Outputs
- Output regressor [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitXgbrfregressor
:
----------------
Arguments
----------------
regressor: Regressor
Default value: from xgboost import XGBRFRegressor
regressor = XGBRFRegressor(n_estimators=100)
Argument type: string
Acceptable values:
- String value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputRegressor: Output regressor
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressor: <outputFile>
Output regressor
Uses a fitted regressor to predict a regression layer from a raster layer with features.
Parameters
- Raster layer with features [raster]
- A raster layer with bands used as features. Regressor features and raster bands are matched by name.
- Regressor [file]
- A fitted regressor.
Outputs
- Output regression layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:PredictRegressionLayer
:
----------------
Arguments
----------------
raster: Raster layer with features
Argument type: raster
Acceptable values:
- Path to a raster layer
regressor: Regressor
Argument type: file
Acceptable values:
- Path to a file
outputRegression: Output regression layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRegression: <outputRaster>
Output regression layer
Compute receiver operating characteristic (ROC) and detection error tradeoff (DET) curves. For more details see the Scikit-Learn user guide: Receiver operating characteristic (ROC) and Detection error tradeoff (DET). Note that observed classes and predicted class probabilities are matched by name.
Parameters
- Class probability layer [raster]
- A class probability layer that is to be assessed.
- Observed categorized layer [layer]
- A categorized layer representing a (ground truth) observation sample.
- Open output report in webbrowser after running algorithm [boolean]
Whether to open the output report in the web browser.
Default: True
Outputs
- Output report [fileDestination]
- Report file destination.
Command-line usage
>qgis_process help enmapbox:ReceiverOperatingCharacteristicRocAndDetectionErrorTradeoffDetCurves
:
----------------
Arguments
----------------
regression: Class probability layer
Argument type: raster
Acceptable values:
- Path to a raster layer
reference: Observed categorized layer
Argument type: layer
Acceptable values:
- Path to a vector, raster or mesh layer
openReport: Open output report in webbrowser after running algorithm
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outRocCurve: Output report
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outRocCurve: <outputHtml>
Output report
Estimates map accuracy.We use the formulars as described in Scikit-Learn Regression metrics user guide. Observed and predicted target variables are matched by name.
Parameters
- Regression layer [raster]
- A regression layer that is to be assessed.
- Observed continuous-valued layer [layer]
- A continuous-valued layer representing a (ground truth) observation sample.
- Open output report in webbrowser after running algorithm [boolean]
Whether to open the output report in the web browser.
Default: True
Outputs
- Output report [fileDestination]
- Report file destination.
Command-line usage
>qgis_process help enmapbox:RegressionLayerAccuracyReport
:
----------------
Arguments
----------------
regression: Regression layer
Argument type: raster
Acceptable values:
- Path to a raster layer
reference: Observed continuous-valued layer
Argument type: layer
Acceptable values:
- Path to a vector, raster or mesh layer
openReport: Open output report in webbrowser after running algorithm
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outRegressionPerformance: Output report
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outRegressionPerformance: <outputHtml>
Output report
The regression workflow combines regressor fitting and map prediction.Optionally, the cross-validation performance of the regressor can be assessed.
Parameters
- Training dataset [file]
- Training dataset pickle file used for fitting the regressor.
- Regressor [string]
- Scikit-Learn Python code specifying a regressor.
- Raster layer with features [raster]
- A raster layer with bands used as features for mapping. Regressor features and raster bands are matched by name. Will be ignored, if map prediction is skipped.
- Number of cross-validation folds [number]
The number of folds used for assessing cross-validation performance. Will be ignored, if the cross-validation performance assessment is skipped.
Default: 10
- Open output cross-validation regressor performance report in webbrowser after running algorithm [boolean]
Whether to open the cross-validation performance report in the web browser. Will be ignored, if the cross-validation performance assessment is skipped.
Default: True
Outputs
- Output cross-validation regressor performance report [fileDestination]
- Output cross-validation performance report file destination.
- Output regressor [fileDestination]
- Pickle file destination.
- Output regression layer [rasterDestination]
- Predicted map file destination.
Command-line usage
>qgis_process help enmapbox:RegressionWorkflow
:
----------------
Arguments
----------------
dataset: Training dataset
Argument type: file
Acceptable values:
- Path to a file
regressor: Regressor
Argument type: string
Acceptable values:
- String value
raster: Raster layer with features
Argument type: raster
Acceptable values:
- Path to a raster layer
nfold: Number of cross-validation folds (optional)
Default value: 10
Argument type: number
Acceptable values:
- A numeric value
openReport: Open output cross-validation regressor performance report in webbrowser after running algorithm
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRegressorPerformance: Output cross-validation regressor performance report (optional)
Argument type: fileDestination
Acceptable values:
- Path for new file
outputRegressor: Output regressor
Argument type: fileDestination
Acceptable values:
- Path for new file
outputRegression: Output regression layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRegressorPerformance: <outputHtml>
Output cross-validation regressor performance report
outputRegressor: <outputFile>
Output regressor
outputRegression: <outputRaster>
Output regression layer
Evaluates regressor performance.
Parameters
- Regressor [file]
- Regressor pickle file.
- Test dataset [file]
- Test dataset pickle file used for assessing the regressor performance.
- Number of cross-validation folds [number]
- The number of folds used for assessing cross-validation performance. If not specified (default), simple test performance is assessed.
- Open output report in webbrowser after running algorithm [boolean]
Whether to open the output report in the web browser.
Default: True
Outputs
- Output report [fileDestination]
- Report file destination.
Command-line usage
>qgis_process help enmapbox:RegressorPerformanceReport
:
----------------
Arguments
----------------
regressor: Regressor
Argument type: file
Acceptable values:
- Path to a file
dataset: Test dataset
Argument type: file
Acceptable values:
- Path to a file
nfold: Number of cross-validation folds (optional)
Argument type: number
Acceptable values:
- A numeric value
openReport: Open output report in webbrowser after running algorithm
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRegressorPerformance: Output report
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputRegressorPerformance: <outputHtml>
Output report
This algorithm finds the optimal two-feature index by modelling a target variable via linear regression.
Parameters
- Training dataset [file]
- The regression dataset.
- Formular [string]
The formular with variable features A and B to be optimized, and up to three fixed features F1, F2 and F3.
Default: (A-B) / (A+B)
- Max. features [number]
- Limit the number of features to be evaluated. Default is to use all features.
- Fixed feature F1 [number]
- Specify to use a fixed feature F1 in the formular.
- Fixed feature F2 [number]
- Specify to use a fixed feature F2 in the formular.
- Fixed feature F3 [number]
- Specify to use a fixed feature F3 in the formular.
Outputs
- Output score matrix [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpectralIndexOptimizer
:
----------------
Arguments
----------------
dataset: Training dataset
Argument type: file
Acceptable values:
- Path to a file
formular: Formular
Default value: (A-B) / (A+B)
Argument type: string
Acceptable values:
- String value
maxFeatures: Max. features (optional)
Argument type: number
Acceptable values:
- A numeric value
f1: Fixed feature F1 (optional)
Argument type: number
Acceptable values:
- A numeric value
f2: Fixed feature F2 (optional)
Argument type: number
Acceptable values:
- A numeric value
f3: Fixed feature F3 (optional)
Argument type: number
Acceptable values:
- A numeric value
outScoreMatrix: Output score matrix
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outScoreMatrix: <outputRaster>
Output score matrix
Spectral resampling¶
Spectrally resample a spectral raster layer by applying spectral response function convolution.
Parameters
- Spectral raster layer [raster]
- A spectral raster layer to be resampled.
- Spectral response function [string]
Python code specifying the spectral response function.
Default:
from collections import OrderedDict # Place response function definition here. Should look something like this: responses = OrderedDict() # Option 1: Use band name as dict-key, # together with fully defined list of (<wavelength>, <response>) tuples as dict-value. # Define <response> as values between 0 and 1 for each whole nanometer <wavelength>. responses['Blue'] = [(443, 0.001), (444, 0.002), ..., (509, 1.0), ..., (518, 0.002), (519, 0.001)] responses['Green'] = [(519, 0.001), (520, 0.002), ..., (550, 1.0), ..., (597, 0.003), (598, 0.001)] ... # Option 2: Use band center wavelength as dict-key, # together with band full width at half maximum (FWHM) as dict-value. # The response function is modelled as an RBF around the center wavelength with a width of FWHM / 2.355. # See https://en.wikipedia.org/wiki/Full_width_at_half_maximum for details. responses[460] = 5.8 ... responses[2409] = 9.1
- Save spectral response function [boolean]
Whether to save the spectral response function library as *.srf.gpkg sidecar file.
Default: False
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpectralResamplingToCustomSensor
:
----------------
Arguments
----------------
raster: Spectral raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
response: Spectral response function
Default value: from collections import OrderedDict
# Place response function definition here. Should look something like this:
responses = OrderedDict()
# Option 1: Use band name as dict-key,
# together with fully defined list of (<wavelength>, <response>) tuples as dict-value.
# Define <response> as values between 0 and 1 for each whole nanometer <wavelength>.
responses['Blue'] = [(443, 0.001), (444, 0.002), ..., (509, 1.0), ..., (518, 0.002), (519, 0.001)]
responses['Green'] = [(519, 0.001), (520, 0.002), ..., (550, 1.0), ..., (597, 0.003), (598, 0.001)]
...
# Option 2: Use band center wavelength as dict-key,
# together with band full width at half maximum (FWHM) as dict-value.
# The response function is modelled as an RBF around the center wavelength with a width of FWHM / 2.355.
# See https://en.wikipedia.org/wiki/Full_width_at_half_maximum for details.
responses[460] = 5.8
...
responses[2409] = 9.1
Argument type: string
Acceptable values:
- String value
saveResponseFunction: Save spectral response function (optional)
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputResampledRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputResampledRaster: <outputRaster>
Output raster layer
Spectrally resample a spectral raster layer by applying spectral response function convolution. For more information see the DESIS mission website.
Parameters
- Spectral raster layer [raster]
- A spectral raster layer to be resampled.
- Spectral response function [string]
Python code specifying the spectral response function.
Default:
from collections import OrderedDict responses = OrderedDict() wavelength = [402.0, 404.2, 406.8, 409.3, 411.8, 414.3, 416.9, 419.4, 422.0, 424.6, 427.3, 429.8, 432.4, 434.9, 437.5, 439.9, 442.5, 445.1, 447.8, 450.3, 452.9, 455.6, 458.2, 460.7, 463.3, 465.8, 468.3, 470.7, 473.4, 475.9, 478.5, 481.3, 483.8, 486.4, 489.0, 491.6, 494.0, 496.5, 499.2, 501.8, 504.3, 506.9, 509.5, 512.2, 514.7, 517.2, 519.6, 522.2, 524.7, 527.3, 529.7, 532.3, 534.9, 537.5, 540.2, 542.7, 545.2, 547.7, 550.3, 552.9, 555.5, 558.1, 560.6, 563.2, 565.8, 568.4, 571.0, 573.5, 576.1, 578.6, 581.1, 583.7, 586.3, 588.8, 591.3, 594.0, 596.6, 599.1, 601.6, 604.2, 606.8, 609.2, 611.8, 614.3, 616.9, 619.5, 622.1, 624.7, 627.2, 629.7, 632.2, 634.7, 637.2, 639.8, 642.3, 644.9, 647.5, 650.0, 652.6, 655.2, 657.7, 660.2, 662.8, 665.3, 667.9, 670.5, 673.1, 675.8, 678.4, 680.9, 683.5, 685.9, 688.4, 690.9, 693.5, 696.2, 698.8, 701.5, 703.9, 706.7, 709.4, 711.8, 714.0, 716.4, 718.9, 721.6, 724.2, 726.9, 729.4, 732.1, 734.4, 736.9, 739.5, 742.0, 744.5, 747.2, 749.7, 752.3, 755.2, 757.7, 760.3, 763.0, 765.0, 767.5, 770.3, 772.7, 775.4, 778.0, 780.5, 783.0, 785.6, 788.2, 790.6, 793.1, 795.9, 798.4, 801.2, 804.0, 806.7, 809.1, 811.7, 814.3, 816.9, 819.8, 822.8, 824.2, 827.2, 829.2, 832.2, 834.9, 836.7, 840.1, 842.0, 844.7, 847.7, 850.0, 852.4, 855.4, 857.9, 860.3, 862.9, 865.4, 868.0, 870.6, 873.2, 875.8, 878.8, 881.5, 883.1, 885.3, 888.1, 890.9, 894.1, 896.0, 898.3, 901.2, 903.7, 906.0, 908.7, 911.6, 914.8, 916.6, 918.4, 921.0, 923.9, 927.1, 929.6, 931.9, 934.5, 937.3, 939.4, 942.0, 944.7, 947.3, 949.6, 951.9, 954.2, 957.3, 959.6, 962.3, 965.5, 968.1, 970.4, 972.9, 976.0, 978.7, 980.0, 981.9, 984.8, 988.9, 991.6, 993.1, 995.6, 997.9, 999.5] fwhm = [2.4, 3.6, 3.8, 3.8, 3.6, 3.8, 3.4, 3.4, 3.6, 3.6, 3.4, 3.4, 3.2, 3.2, 3.0, 3.2, 3.4, 3.2, 3.4, 3.4, 3.4, 3.6, 3.4, 3.4, 3.2, 3.2, 3.4, 3.2, 3.2, 3.4, 3.4, 3.4, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2, 3.4, 3.4, 3.4, 3.6, 3.6, 3.4, 3.4, 3.4, 3.4, 3.4, 3.4, 3.6, 3.4, 3.4, 3.6, 3.6, 3.4, 3.4, 3.6, 3.6, 3.6, 3.4, 3.4, 3.4, 3.6, 3.6, 3.6, 3.6, 3.6, 3.6, 3.4, 3.4, 3.4, 3.4, 3.6, 3.6, 3.6, 3.6, 3.6, 3.4, 3.6, 3.6, 3.4, 3.4, 3.6, 3.4, 3.4, 3.4, 3.4, 3.4, 3.4, 3.4, 3.2, 3.4, 3.4, 3.4, 3.4, 3.6, 3.6, 3.4, 3.6, 3.4, 3.4, 3.4, 3.4, 3.4, 3.4, 3.4, 3.6, 3.6, 3.4, 3.4, 3.4, 3.4, 3.2, 3.4, 3.4, 3.4, 3.6, 3.6, 3.8, 3.6, 3.6, 4.0, 4.0, 3.8, 3.4, 3.4, 3.6, 3.4, 3.4, 3.2, 3.2, 3.4, 3.4, 3.2, 3.4, 3.4, 3.4, 3.4, 3.6, 3.4, 3.4, 3.6, 3.0, 3.4, 3.4, 3.4, 3.4, 3.6, 3.2, 3.4, 3.2, 3.4, 3.2, 3.4, 3.4, 3.4, 3.2, 3.0, 3.0, 3.0, 3.0, 3.0, 3.2, 3.6, 3.2, 3.0, 3.6, 2.8, 3.6, 2.6, 3.0, 3.4, 2.8, 3.4, 3.4, 3.0, 3.2, 3.2, 3.2, 3.0, 3.4, 3.2, 3.4, 3.4, 3.4, 3.6, 4.0, 3.0, 3.0, 3.4, 3.6, 3.6, 3.6, 3.2, 3.2, 3.6, 3.6, 3.0, 4.0, 4.0, 3.8, 3.0, 3.6, 4.0, 3.6, 3.4, 3.4, 3.2, 3.8, 3.4, 3.2, 3.8, 3.6, 3.6, 3.6, 3.0, 3.6, 3.4, 3.4, 3.4, 3.6, 3.8, 3.6, 3.4, 4.8, 3.6, 2.8, 4.0, 6.6, 4.2, 3.4, 3.0, 3.4, 3.4, 3.0] for w, f in zip(wavelength, fwhm): responses[w] = f
- Save spectral response function [boolean]
Whether to save the spectral response function library as *.srf.gpkg sidecar file.
Default: False
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpectralResamplingToDesisHsi
:
----------------
Arguments
----------------
raster: Spectral raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
response: Spectral response function
Default value: from collections import OrderedDict
responses = OrderedDict()
wavelength = [402.0, 404.2, 406.8, 409.3, 411.8, 414.3, 416.9, 419.4, 422.0, 424.6, 427.3, 429.8, 432.4, 434.9,
437.5, 439.9, 442.5, 445.1, 447.8, 450.3, 452.9, 455.6, 458.2, 460.7, 463.3, 465.8, 468.3, 470.7,
473.4, 475.9, 478.5, 481.3, 483.8, 486.4, 489.0, 491.6, 494.0, 496.5, 499.2, 501.8, 504.3, 506.9,
509.5, 512.2, 514.7, 517.2, 519.6, 522.2, 524.7, 527.3, 529.7, 532.3, 534.9, 537.5, 540.2, 542.7,
545.2, 547.7, 550.3, 552.9, 555.5, 558.1, 560.6, 563.2, 565.8, 568.4, 571.0, 573.5, 576.1, 578.6,
581.1, 583.7, 586.3, 588.8, 591.3, 594.0, 596.6, 599.1, 601.6, 604.2, 606.8, 609.2, 611.8, 614.3,
616.9, 619.5, 622.1, 624.7, 627.2, 629.7, 632.2, 634.7, 637.2, 639.8, 642.3, 644.9, 647.5, 650.0,
652.6, 655.2, 657.7, 660.2, 662.8, 665.3, 667.9, 670.5, 673.1, 675.8, 678.4, 680.9, 683.5, 685.9,
688.4, 690.9, 693.5, 696.2, 698.8, 701.5, 703.9, 706.7, 709.4, 711.8, 714.0, 716.4, 718.9, 721.6,
724.2, 726.9, 729.4, 732.1, 734.4, 736.9, 739.5, 742.0, 744.5, 747.2, 749.7, 752.3, 755.2, 757.7,
760.3, 763.0, 765.0, 767.5, 770.3, 772.7, 775.4, 778.0, 780.5, 783.0, 785.6, 788.2, 790.6, 793.1,
795.9, 798.4, 801.2, 804.0, 806.7, 809.1, 811.7, 814.3, 816.9, 819.8, 822.8, 824.2, 827.2, 829.2,
832.2, 834.9, 836.7, 840.1, 842.0, 844.7, 847.7, 850.0, 852.4, 855.4, 857.9, 860.3, 862.9, 865.4,
868.0, 870.6, 873.2, 875.8, 878.8, 881.5, 883.1, 885.3, 888.1, 890.9, 894.1, 896.0, 898.3, 901.2,
903.7, 906.0, 908.7, 911.6, 914.8, 916.6, 918.4, 921.0, 923.9, 927.1, 929.6, 931.9, 934.5, 937.3,
939.4, 942.0, 944.7, 947.3, 949.6, 951.9, 954.2, 957.3, 959.6, 962.3, 965.5, 968.1, 970.4, 972.9,
976.0, 978.7, 980.0, 981.9, 984.8, 988.9, 991.6, 993.1, 995.6, 997.9, 999.5]
fwhm = [2.4, 3.6, 3.8, 3.8, 3.6, 3.8, 3.4, 3.4, 3.6, 3.6, 3.4, 3.4, 3.2, 3.2, 3.0, 3.2, 3.4, 3.2, 3.4, 3.4, 3.4,
3.6, 3.4, 3.4, 3.2, 3.2, 3.4, 3.2, 3.2, 3.4, 3.4, 3.4, 3.2, 3.2, 3.2, 3.2, 3.2, 3.2, 3.4, 3.4, 3.4, 3.6,
3.6, 3.4, 3.4, 3.4, 3.4, 3.4, 3.4, 3.6, 3.4, 3.4, 3.6, 3.6, 3.4, 3.4, 3.6, 3.6, 3.6, 3.4, 3.4, 3.4, 3.6,
3.6, 3.6, 3.6, 3.6, 3.6, 3.4, 3.4, 3.4, 3.4, 3.6, 3.6, 3.6, 3.6, 3.6, 3.4, 3.6, 3.6, 3.4, 3.4, 3.6, 3.4,
3.4, 3.4, 3.4, 3.4, 3.4, 3.4, 3.2, 3.4, 3.4, 3.4, 3.4, 3.6, 3.6, 3.4, 3.6, 3.4, 3.4, 3.4, 3.4, 3.4, 3.4,
3.4, 3.6, 3.6, 3.4, 3.4, 3.4, 3.4, 3.2, 3.4, 3.4, 3.4, 3.6, 3.6, 3.8, 3.6, 3.6, 4.0, 4.0, 3.8, 3.4, 3.4,
3.6, 3.4, 3.4, 3.2, 3.2, 3.4, 3.4, 3.2, 3.4, 3.4, 3.4, 3.4, 3.6, 3.4, 3.4, 3.6, 3.0, 3.4, 3.4, 3.4, 3.4,
3.6, 3.2, 3.4, 3.2, 3.4, 3.2, 3.4, 3.4, 3.4, 3.2, 3.0, 3.0, 3.0, 3.0, 3.0, 3.2, 3.6, 3.2, 3.0, 3.6, 2.8,
3.6, 2.6, 3.0, 3.4, 2.8, 3.4, 3.4, 3.0, 3.2, 3.2, 3.2, 3.0, 3.4, 3.2, 3.4, 3.4, 3.4, 3.6, 4.0, 3.0, 3.0,
3.4, 3.6, 3.6, 3.6, 3.2, 3.2, 3.6, 3.6, 3.0, 4.0, 4.0, 3.8, 3.0, 3.6, 4.0, 3.6, 3.4, 3.4, 3.2, 3.8, 3.4,
3.2, 3.8, 3.6, 3.6, 3.6, 3.0, 3.6, 3.4, 3.4, 3.4, 3.6, 3.8, 3.6, 3.4, 4.8, 3.6, 2.8, 4.0, 6.6, 4.2, 3.4,
3.0, 3.4, 3.4, 3.0]
for w, f in zip(wavelength, fwhm):
responses[w] = f
Argument type: string
Acceptable values:
- String value
saveResponseFunction: Save spectral response function (optional)
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputResampledRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputResampledRaster: <outputRaster>
Output raster layer
Spectrally resample a spectral raster layer by applying spectral response function convolution. For more information see the EnMAP mission website.
Parameters
- Spectral raster layer [raster]
- A spectral raster layer to be resampled.
- Spectral response function [string]
Python code specifying the spectral response function.
Default:
from collections import OrderedDict responses = OrderedDict() wavelength = [460, 465, 470, 475, 479, 484, 489, 494, 499, 503, 508, 513, 518, 523, 528, 533, 538, 543, 549, 554, 559, 565, 570, 575, 581, 587, 592, 598, 604, 610, 616, 622, 628, 634, 640, 646, 653, 659, 665, 672, 679, 685, 692, 699, 706, 713, 720, 727, 734, 741, 749, 756, 763, 771, 778, 786, 793, 801, 809, 817, 824, 832, 840, 848, 856, 864, 872, 880, 888, 896, 915, 924, 934, 944, 955, 965, 975, 986, 997, 1007, 1018, 1029, 1040, 1051, 1063, 1074, 1086, 1097, 1109, 1120, 1132, 1144, 1155, 1167, 1179, 1191, 1203, 1215, 1227, 1239, 1251, 1263, 1275, 1287, 1299, 1311, 1323, 1522, 1534, 1545, 1557, 1568, 1579, 1590, 1601, 1612, 1624, 1634, 1645, 1656, 1667, 1678, 1689, 1699, 1710, 1721, 1731, 1742, 1752, 1763, 1773, 1783, 2044, 2053, 2062, 2071, 2080, 2089, 2098, 2107, 2115, 2124, 2133, 2141, 2150, 2159, 2167, 2176, 2184, 2193, 2201, 2210, 2218, 2226, 2234, 2243, 2251, 2259, 2267, 2275, 2283, 2292, 2300, 2308, 2315, 2323, 2331, 2339, 2347, 2355, 2363, 2370, 2378, 2386, 2393, 2401, 2409] fwhm = [5.8, 5.8, 5.8, 5.8, 5.8, 5.8, 5.8, 5.8, 5.8, 5.8, 5.9, 5.9, 6.0, 6.0, 6.1, 6.1, 6.2, 6.2, 6.3, 6.4, 6.4, 6.5, 6.6, 6.6, 6.7, 6.8, 6.9, 6.9, 7.0, 7.1, 7.2, 7.3, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 7.9, 8.0, 8.1, 8.2, 8.3, 8.4, 8.4, 8.5, 8.6, 8.7, 8.7, 8.8, 8.9, 8.9, 9.0, 9.1, 9.1, 9.2, 9.3, 9.3, 9.4, 9.4, 9.5, 9.5, 9.6, 9.6, 9.6, 9.6, 9.7, 9.7, 9.7, 11.8, 11.9, 12.1, 12.2, 12.4, 12.5, 12.7, 12.8, 12.9, 13.1, 13.2, 13.3, 13.4, 13.5, 13.6, 13.7, 13.8, 13.9, 14.0, 14.0, 14.1, 14.1, 14.2, 14.2, 14.3, 14.3, 14.3, 14.4, 14.4, 14.4, 14.4, 14.4, 14.4, 14.4, 14.4, 14.4, 14.4, 13.7, 13.6, 13.6, 13.5, 13.5, 13.4, 13.4, 13.3, 13.2, 13.2, 13.1, 13.1, 13.0, 12.9, 12.9, 12.8, 12.8, 12.7, 12.7, 12.6, 12.5, 12.5, 12.4, 12.4, 12.3, 10.9, 10.8, 10.8, 10.7, 10.7, 10.6, 10.6, 10.5, 10.5, 10.4, 10.4, 10.4, 10.3, 10.3, 10.2, 10.2, 10.1, 10.1, 10.1, 10.0, 10.0, 9.9, 9.9, 9.9, 9.8, 9.8, 9.7, 9.7, 9.7, 9.6, 9.6, 9.6, 9.5, 9.5, 9.4, 9.4, 9.4, 9.3, 9.3, 9.3, 9.2, 9.2, 9.1, 9.1, 9.1] for w, f in zip(wavelength, fwhm): responses[w] = f
- Save spectral response function [boolean]
Whether to save the spectral response function library as *.srf.gpkg sidecar file.
Default: False
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpectralResamplingToEnmap
:
----------------
Arguments
----------------
raster: Spectral raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
response: Spectral response function
Default value: from collections import OrderedDict
responses = OrderedDict()
wavelength = [460, 465, 470, 475, 479, 484, 489, 494, 499, 503, 508, 513, 518, 523, 528, 533, 538, 543, 549,
554, 559, 565, 570, 575, 581, 587, 592, 598, 604, 610, 616, 622, 628, 634, 640, 646, 653, 659,
665, 672, 679, 685, 692, 699, 706, 713, 720, 727, 734, 741, 749, 756, 763, 771, 778, 786, 793,
801, 809, 817, 824, 832, 840, 848, 856, 864, 872, 880, 888, 896, 915, 924, 934, 944, 955, 965,
975, 986, 997, 1007, 1018, 1029, 1040, 1051, 1063, 1074, 1086, 1097, 1109, 1120, 1132, 1144, 1155,
1167, 1179, 1191, 1203, 1215, 1227, 1239, 1251, 1263, 1275, 1287, 1299, 1311, 1323, 1522, 1534,
1545, 1557, 1568, 1579, 1590, 1601, 1612, 1624, 1634, 1645, 1656, 1667, 1678, 1689, 1699, 1710,
1721, 1731, 1742, 1752, 1763, 1773, 1783, 2044, 2053, 2062, 2071, 2080, 2089, 2098, 2107, 2115,
2124, 2133, 2141, 2150, 2159, 2167, 2176, 2184, 2193, 2201, 2210, 2218, 2226, 2234, 2243, 2251,
2259, 2267, 2275, 2283, 2292, 2300, 2308, 2315, 2323, 2331, 2339, 2347, 2355, 2363, 2370, 2378,
2386, 2393, 2401, 2409]
fwhm = [5.8, 5.8, 5.8, 5.8, 5.8, 5.8, 5.8, 5.8, 5.8, 5.8, 5.9, 5.9, 6.0, 6.0, 6.1, 6.1, 6.2, 6.2, 6.3, 6.4, 6.4,
6.5, 6.6, 6.6, 6.7, 6.8, 6.9, 6.9, 7.0, 7.1, 7.2, 7.3, 7.3, 7.4, 7.5, 7.6, 7.7, 7.8, 7.9, 7.9, 8.0, 8.1,
8.2, 8.3, 8.4, 8.4, 8.5, 8.6, 8.7, 8.7, 8.8, 8.9, 8.9, 9.0, 9.1, 9.1, 9.2, 9.3, 9.3, 9.4, 9.4, 9.5, 9.5,
9.6, 9.6, 9.6, 9.6, 9.7, 9.7, 9.7, 11.8, 11.9, 12.1, 12.2, 12.4, 12.5, 12.7, 12.8, 12.9, 13.1, 13.2,
13.3, 13.4, 13.5, 13.6, 13.7, 13.8, 13.9, 14.0, 14.0, 14.1, 14.1, 14.2, 14.2, 14.3, 14.3, 14.3, 14.4,
14.4, 14.4, 14.4, 14.4, 14.4, 14.4, 14.4, 14.4, 14.4, 13.7, 13.6, 13.6, 13.5, 13.5, 13.4, 13.4, 13.3,
13.2, 13.2, 13.1, 13.1, 13.0, 12.9, 12.9, 12.8, 12.8, 12.7, 12.7, 12.6, 12.5, 12.5, 12.4, 12.4, 12.3,
10.9, 10.8, 10.8, 10.7, 10.7, 10.6, 10.6, 10.5, 10.5, 10.4, 10.4, 10.4, 10.3, 10.3, 10.2, 10.2, 10.1,
10.1, 10.1, 10.0, 10.0, 9.9, 9.9, 9.9, 9.8, 9.8, 9.7, 9.7, 9.7, 9.6, 9.6, 9.6, 9.5, 9.5, 9.4, 9.4, 9.4,
9.3, 9.3, 9.3, 9.2, 9.2, 9.1, 9.1, 9.1]
for w, f in zip(wavelength, fwhm):
responses[w] = f
Argument type: string
Acceptable values:
- String value
saveResponseFunction: Save spectral response function (optional)
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputResampledRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputResampledRaster: <outputRaster>
Output raster layer
Spectrally resample a spectral raster layer by applying spectral response function convolution. For more information see the Landsat missions website.
Parameters
- Spectral raster layer [raster]
- A spectral raster layer to be resampled.
- Spectral response function [string]
Python code specifying the spectral response function.
Default:
from collections import OrderedDict responses = OrderedDict() responses['Blue'] = [(421, 0.001), (422, 0.001), (423, 0.001), (424, 0.001), (425, 0.001), (426, 0.002), (427, 0.002), (428, 0.002), (429, 0.003), (430, 0.003), (431, 0.005), (432, 0.007), (433, 0.01), (434, 0.013), (435, 0.017), (436, 0.02), (437, 0.025), (438, 0.031), (439, 0.037), (440, 0.042), (441, 0.048), (442, 0.053), (443, 0.059), (444, 0.064), (445, 0.07), (446, 0.083), (447, 0.121), (448, 0.172), (449, 0.273), (450, 0.372), (451, 0.442), (452, 0.514), (453, 0.579), (454, 0.628), (455, 0.711), (456, 0.732), (457, 0.742), (458, 0.75), (459, 0.755), (460, 0.756), (461, 0.766), (462, 0.776), (463, 0.786), (464, 0.797), (465, 0.807), (466, 0.812), (467, 0.817), (468, 0.822), (469, 0.827), (470, 0.829), (471, 0.831), (472, 0.833), (473, 0.835), (474, 0.838), (475, 0.846), (476, 0.853), (477, 0.861), (478, 0.868), (479, 0.876), (480, 0.883), (481, 0.886), (482, 0.888), (483, 0.891), (484, 0.893), (485, 0.896), (486, 0.898), (487, 0.901), (488, 0.903), (489, 0.905), (490, 0.908), (491, 0.918), (492, 0.928), (493, 0.938), (494, 0.948), (495, 0.952), (496, 0.956), (497, 0.961), (498, 0.965), (499, 0.97), (500, 0.979), (501, 0.987), (502, 0.994), (503, 1.0), (504, 0.999), (505, 0.99), (506, 0.963), (507, 0.936), (508, 0.909), (509, 0.881), (510, 0.852), (511, 0.824), (512, 0.81), (513, 0.796), (514, 0.779), (515, 0.756), (516, 0.707), (517, 0.596), (518, 0.497), (519, 0.413), (520, 0.329), (521, 0.245), (522, 0.137), (523, 0.105), (524, 0.094), (525, 0.083), (526, 0.072), (527, 0.061), (528, 0.055), (529, 0.052), (530, 0.049), (531, 0.045), (532, 0.041), (533, 0.038), (534, 0.034), (535, 0.031), (536, 0.027), (537, 0.024), (538, 0.022), (539, 0.019), (540, 0.017), (541, 0.015), (542, 0.013), (543, 0.011), (544, 0.01), (545, 0.009), (546, 0.007), (547, 0.006), (548, 0.006), (549, 0.006), (550, 0.005), (551, 0.005), (552, 0.005), (553, 0.005), (554, 0.005), (555, 0.004), (556, 0.004), (557, 0.004), (558, 0.004), (559, 0.004), (560, 0.003), (561, 0.003), (562, 0.003), (563, 0.003), (564, 0.002), (565, 0.002), (566, 0.002), (567, 0.002), (568, 0.002), (569, 0.001), (570, 0.001)] responses['Green'] = [(502, 0.002), (503, 0.003), (504, 0.007), (505, 0.009), (506, 0.011), (507, 0.014), (508, 0.016), (509, 0.019), (510, 0.022), (511, 0.024), (512, 0.027), (513, 0.03), (514, 0.032), (515, 0.035), (516, 0.05), (517, 0.066), (518, 0.091), (519, 0.12), (520, 0.152), (521, 0.191), (522, 0.231), (523, 0.271), (524, 0.312), (525, 0.353), (526, 0.392), (527, 0.43), (528, 0.468), (529, 0.507), (530, 0.537), (531, 0.561), (532, 0.577), (533, 0.591), (534, 0.605), (535, 0.619), (536, 0.633), (537, 0.647), (538, 0.661), (539, 0.675), (540, 0.69), (541, 0.7), (542, 0.711), (543, 0.721), (544, 0.732), (545, 0.743), (546, 0.753), (547, 0.764), (548, 0.775), (549, 0.786), (550, 0.797), (551, 0.803), (552, 0.809), (553, 0.815), (554, 0.821), (555, 0.826), (556, 0.832), (557, 0.837), (558, 0.843), (559, 0.848), (560, 0.854), (561, 0.859), (562, 0.865), (563, 0.871), (564, 0.873), (565, 0.874), (566, 0.875), (567, 0.877), (568, 0.878), (569, 0.879), (570, 0.88), (571, 0.881), (572, 0.882), (573, 0.883), (574, 0.884), (575, 0.885), (576, 0.886), (577, 0.887), (578, 0.891), (579, 0.896), (580, 0.9), (581, 0.905), (582, 0.909), (583, 0.914), (584, 0.932), (585, 0.944), (586, 0.954), (587, 0.963), (588, 0.971), (589, 0.977), (590, 0.982), (591, 0.988), (592, 0.994), (593, 0.999), (594, 1.0), (595, 0.999), (596, 0.998), (597, 0.995), (598, 0.98), (599, 0.964), (600, 0.949), (601, 0.927), (602, 0.894), (603, 0.862), (604, 0.829), (605, 0.796), (606, 0.747), (607, 0.672), (608, 0.597), (609, 0.521), (610, 0.467), (611, 0.413), (612, 0.359), (613, 0.304), (614, 0.249), (615, 0.206), (616, 0.181), (617, 0.156), (618, 0.131), (619, 0.108), (620, 0.097), (621, 0.087), (622, 0.076), (623, 0.066), (624, 0.055), (625, 0.052), (626, 0.049), (627, 0.045), (628, 0.042), (629, 0.039), (630, 0.036), (631, 0.032), (632, 0.029), (633, 0.026), (634, 0.023), (635, 0.021), (636, 0.019), (637, 0.017), (638, 0.015), (639, 0.013), (640, 0.011), (641, 0.01), (642, 0.009), (643, 0.008), (644, 0.006), (645, 0.005), (646, 0.003), (647, 0.002), (648, 0.001)] responses['Red'] = [(563, 0.001), (564, 0.001), (565, 0.001), (566, 0.001), (567, 0.001), (568, 0.001), (569, 0.002), (570, 0.002), (571, 0.002), (572, 0.002), (573, 0.002), (574, 0.002), (575, 0.002), (576, 0.002), (577, 0.002), (578, 0.002), (579, 0.002), (580, 0.002), (581, 0.002), (582, 0.002), (583, 0.002), (584, 0.002), (585, 0.002), (586, 0.002), (587, 0.002), (588, 0.002), (589, 0.002), (590, 0.003), (591, 0.003), (592, 0.003), (593, 0.004), (594, 0.004), (595, 0.004), (596, 0.005), (597, 0.006), (598, 0.007), (599, 0.008), (600, 0.009), (601, 0.011), (602, 0.014), (603, 0.016), (604, 0.019), (605, 0.023), (606, 0.027), (607, 0.03), (608, 0.034), (609, 0.038), (610, 0.041), (611, 0.045), (612, 0.062), (613, 0.081), (614, 0.101), (615, 0.12), (616, 0.14), (617, 0.16), (618, 0.18), (619, 0.24), (620, 0.327), (621, 0.414), (622, 0.449), (623, 0.471), (624, 0.492), (625, 0.514), (626, 0.535), (627, 0.557), (628, 0.579), (629, 0.601), (630, 0.623), (631, 0.65), (632, 0.687), (633, 0.737), (634, 0.787), (635, 0.803), (636, 0.818), (637, 0.835), (638, 0.849), (639, 0.86), (640, 0.871), (641, 0.883), (642, 0.894), (643, 0.906), (644, 0.912), (645, 0.917), (646, 0.922), (647, 0.928), (648, 0.933), (649, 0.939), (650, 0.944), (651, 0.943), (652, 0.942), (653, 0.942), (654, 0.941), (655, 0.94), (656, 0.939), (657, 0.938), (658, 0.937), (659, 0.936), (660, 0.935), (661, 0.937), (662, 0.939), (663, 0.943), (664, 0.948), (665, 0.954), (666, 0.959), (667, 0.965), (668, 0.97), (669, 0.975), (670, 0.979), (671, 0.983), (672, 0.987), (673, 0.99), (674, 0.997), (675, 0.996), (676, 0.998), (677, 1.0), (678, 0.998), (679, 0.996), (680, 0.994), (681, 0.973), (682, 0.973), (683, 0.974), (684, 0.964), (685, 0.945), (686, 0.927), (687, 0.908), (688, 0.871), (689, 0.822), (690, 0.773), (691, 0.687), (692, 0.594), (693, 0.505), (694, 0.433), (695, 0.361), (696, 0.289), (697, 0.223), (698, 0.188), (699, 0.152), (700, 0.116), (701, 0.106), (702, 0.095), (703, 0.084), (704, 0.074), (705, 0.063), (706, 0.057), (707, 0.054), (708, 0.051), (709, 0.048), (710, 0.045), (711, 0.042), (712, 0.039), (713, 0.036), (714, 0.033), (715, 0.03), (716, 0.027), (717, 0.024), (718, 0.022), (719, 0.021), (720, 0.02), (721, 0.018), (722, 0.017), (723, 0.015), (724, 0.014), (725, 0.012), (726, 0.011), (727, 0.01), (728, 0.009), (729, 0.007), (730, 0.006), (731, 0.006), (732, 0.005), (733, 0.005), (734, 0.005), (735, 0.005), (736, 0.004), (737, 0.004), (738, 0.004), (739, 0.003), (740, 0.003), (741, 0.003), (742, 0.002), (743, 0.002), (744, 0.002), (745, 0.002), (746, 0.001)] responses['NIR'] = [(727, 0.001), (728, 0.001), (729, 0.002), (730, 0.002), (731, 0.003), (732, 0.003), (733, 0.004), (734, 0.004), (735, 0.005), (736, 0.005), (737, 0.006), (738, 0.006), (739, 0.007), (740, 0.007), (741, 0.008), (742, 0.008), (743, 0.009), (744, 0.009), (745, 0.01), (746, 0.012), (747, 0.014), (748, 0.016), (749, 0.018), (750, 0.02), (751, 0.022), (752, 0.025), (753, 0.028), (754, 0.031), (755, 0.034), (756, 0.042), (757, 0.05), (758, 0.058), (759, 0.066), (760, 0.074), (761, 0.083), (762, 0.09), (763, 0.099), (764, 0.121), (765, 0.143), (766, 0.165), (767, 0.187), (768, 0.216), (769, 0.251), (770, 0.286), (771, 0.322), (772, 0.357), (773, 0.393), (774, 0.428), (775, 0.464), (776, 0.5), (777, 0.544), (778, 0.587), (779, 0.63), (780, 0.673), (781, 0.717), (782, 0.76), (783, 0.795), (784, 0.822), (785, 0.849), (786, 0.876), (787, 0.902), (788, 0.917), (789, 0.932), (790, 0.946), (791, 0.956), (792, 0.963), (793, 0.97), (794, 0.976), (795, 0.983), (796, 0.986), (797, 0.99), (798, 0.993), (799, 0.997), (800, 1.0), (801, 0.997), (802, 0.994), (803, 0.992), (804, 0.989), (805, 0.986), (806, 0.983), (807, 0.98), (808, 0.977), (809, 0.974), (810, 0.971), (811, 0.968), (812, 0.965), (813, 0.962), (814, 0.959), (815, 0.956), (816, 0.953), (817, 0.95), (818, 0.947), (819, 0.945), (820, 0.942), (821, 0.939), (822, 0.936), (823, 0.933), (824, 0.93), (825, 0.93), (826, 0.932), (827, 0.934), (828, 0.936), (829, 0.938), (830, 0.94), (831, 0.942), (832, 0.944), (833, 0.946), (834, 0.948), (835, 0.95), (836, 0.952), (837, 0.954), (838, 0.956), (839, 0.958), (840, 0.96), (841, 0.962), (842, 0.964), (843, 0.966), (844, 0.968), (845, 0.97), (846, 0.972), (847, 0.974), (848, 0.976), (849, 0.978), (850, 0.98), (851, 0.978), (852, 0.977), (853, 0.975), (854, 0.974), (855, 0.973), (856, 0.971), (857, 0.97), (858, 0.967), (859, 0.965), (860, 0.963), (861, 0.96), (862, 0.959), (863, 0.959), (864, 0.959), (865, 0.96), (866, 0.961), (867, 0.962), (868, 0.963), (869, 0.964), (870, 0.965), (871, 0.967), (872, 0.968), (873, 0.965), (874, 0.963), (875, 0.96), (876, 0.955), (877, 0.95), (878, 0.945), (879, 0.94), (880, 0.935), (881, 0.929), (882, 0.922), (883, 0.915), (884, 0.908), (885, 0.901), (886, 0.894), (887, 0.887), (888, 0.88), (889, 0.873), (890, 0.866), (891, 0.865), (892, 0.864), (893, 0.858), (894, 0.846), (895, 0.834), (896, 0.823), (897, 0.811), (898, 0.8), (899, 0.789), (900, 0.779), (901, 0.733), (902, 0.688), (903, 0.643), (904, 0.578), (905, 0.509), (906, 0.44), (907, 0.371), (908, 0.321), (909, 0.275), (910, 0.23), (911, 0.185), (912, 0.156), (913, 0.13), (914, 0.105), (915, 0.084), (916, 0.074), (917, 0.064), (918, 0.054), (919, 0.044), (920, 0.034), (921, 0.031), (922, 0.027), (923, 0.024), (924, 0.02), (925, 0.017), (926, 0.015), (927, 0.013), (928, 0.012), (929, 0.01), (930, 0.008), (931, 0.008), (932, 0.007), (933, 0.007), (934, 0.006), (935, 0.006), (936, 0.005), (937, 0.005), (938, 0.005), (939, 0.004), (940, 0.004), (941, 0.003), (942, 0.003), (943, 0.002), (944, 0.002), (945, 0.002), (946, 0.001)] responses['SWIR-1'] = [(1512, 0.001), (1513, 0.001), (1514, 0.001), (1515, 0.001), (1516, 0.001), (1517, 0.001), (1518, 0.002), (1519, 0.002), (1520, 0.002), (1521, 0.002), (1522, 0.003), (1523, 0.004), (1524, 0.004), (1525, 0.005), (1526, 0.006), (1527, 0.007), (1528, 0.007), (1529, 0.008), (1530, 0.009), (1531, 0.01), (1532, 0.012), (1533, 0.013), (1534, 0.015), (1535, 0.016), (1536, 0.018), (1537, 0.019), (1538, 0.021), (1539, 0.022), (1540, 0.024), (1541, 0.028), (1542, 0.033), (1543, 0.038), (1544, 0.043), (1545, 0.048), (1546, 0.057), (1547, 0.067), (1548, 0.077), (1549, 0.087), (1550, 0.098), (1551, 0.114), (1552, 0.132), (1553, 0.151), (1554, 0.17), (1555, 0.189), (1556, 0.208), (1557, 0.228), (1558, 0.247), (1559, 0.267), (1560, 0.287), (1561, 0.312), (1562, 0.34), (1563, 0.368), (1564, 0.396), (1565, 0.425), (1566, 0.454), (1567, 0.483), (1568, 0.512), (1569, 0.541), (1570, 0.571), (1571, 0.598), (1572, 0.625), (1573, 0.653), (1574, 0.68), (1575, 0.708), (1576, 0.732), (1577, 0.755), (1578, 0.777), (1579, 0.8), (1580, 0.824), (1581, 0.842), (1582, 0.858), (1583, 0.874), (1584, 0.89), (1585, 0.907), (1586, 0.916), (1587, 0.924), (1588, 0.93), (1589, 0.934), (1590, 0.939), (1591, 0.943), (1592, 0.947), (1593, 0.946), (1594, 0.943), (1595, 0.94), (1596, 0.937), (1597, 0.934), (1598, 0.933), (1599, 0.933), (1600, 0.933), (1601, 0.931), (1602, 0.929), (1603, 0.928), (1604, 0.928), (1605, 0.928), (1606, 0.928), (1607, 0.928), (1608, 0.928), (1609, 0.933), (1610, 0.94), (1611, 0.944), (1612, 0.947), (1613, 0.949), (1614, 0.952), (1615, 0.955), (1616, 0.958), (1617, 0.961), (1618, 0.963), (1619, 0.966), (1620, 0.969), (1621, 0.972), (1622, 0.975), (1623, 0.978), (1624, 0.98), (1625, 0.983), (1626, 0.985), (1627, 0.988), (1628, 0.989), (1629, 0.989), (1630, 0.988), (1631, 0.987), (1632, 0.986), (1633, 0.985), (1634, 0.984), (1635, 0.983), (1636, 0.981), (1637, 0.98), (1638, 0.979), (1639, 0.978), (1640, 0.977), (1641, 0.976), (1642, 0.975), (1643, 0.974), (1644, 0.973), (1645, 0.972), (1646, 0.971), (1647, 0.97), (1648, 0.969), (1649, 0.969), (1650, 0.968), (1651, 0.967), (1652, 0.967), (1653, 0.968), (1654, 0.97), (1655, 0.971), (1656, 0.973), (1657, 0.975), (1658, 0.977), (1659, 0.979), (1660, 0.98), (1661, 0.982), (1662, 0.983), (1663, 0.985), (1664, 0.986), (1665, 0.988), (1666, 0.988), (1667, 0.987), (1668, 0.986), (1669, 0.985), (1670, 0.984), (1671, 0.984), (1672, 0.983), (1673, 0.983), (1674, 0.982), (1675, 0.982), (1676, 0.981), (1677, 0.981), (1678, 0.98), (1679, 0.98), (1680, 0.979), (1681, 0.979), (1682, 0.978), (1683, 0.978), (1684, 0.977), (1685, 0.977), (1686, 0.976), (1687, 0.976), (1688, 0.975), (1689, 0.975), (1690, 0.974), (1691, 0.975), (1692, 0.977), (1693, 0.978), (1694, 0.98), (1695, 0.982), (1696, 0.983), (1697, 0.985), (1698, 0.987), (1699, 0.988), (1700, 0.99), (1701, 0.99), (1702, 0.991), (1703, 0.992), (1704, 0.993), (1705, 0.993), (1706, 0.994), (1707, 0.995), (1708, 0.995), (1709, 0.996), (1710, 0.997), (1711, 0.998), (1712, 0.998), (1713, 0.999), (1714, 0.999), (1715, 1.0), (1716, 0.999), (1717, 0.998), (1718, 0.996), (1719, 0.995), (1720, 0.993), (1721, 0.992), (1722, 0.99), (1723, 0.988), (1724, 0.986), (1725, 0.974), (1726, 0.982), (1727, 0.98), (1728, 0.978), (1729, 0.976), (1730, 0.975), (1731, 0.973), (1732, 0.971), (1733, 0.969), (1734, 0.967), (1735, 0.965), (1736, 0.963), (1737, 0.961), (1738, 0.96), (1739, 0.958), (1740, 0.956), (1741, 0.955), (1742, 0.954), (1743, 0.953), (1744, 0.953), (1745, 0.952), (1746, 0.951), (1747, 0.95), (1748, 0.95), (1749, 0.949), (1750, 0.948), (1751, 0.951), (1752, 0.954), (1753, 0.957), (1754, 0.961), (1755, 0.964), (1756, 0.965), (1757, 0.964), (1758, 0.962), (1759, 0.961), (1760, 0.96), (1761, 0.957), (1762, 0.953), (1763, 0.948), (1764, 0.944), (1765, 0.94), (1766, 0.931), (1767, 0.92), (1768, 0.909), (1769, 0.898), (1770, 0.887), (1771, 0.868), (1772, 0.846), (1773, 0.823), (1774, 0.801), (1775, 0.779), (1776, 0.752), (1777, 0.723), (1778, 0.695), (1779, 0.666), (1780, 0.637), (1781, 0.607), (1782, 0.577), (1783, 0.547), (1784, 0.516), (1785, 0.486), (1786, 0.456), (1787, 0.425), (1788, 0.395), (1789, 0.365), (1790, 0.334), (1791, 0.313), (1792, 0.296), (1793, 0.279), (1794, 0.262), (1795, 0.245), (1796, 0.228), (1797, 0.211), (1798, 0.194), (1799, 0.177), (1800, 0.16), (1801, 0.149), (1802, 0.141), (1803, 0.133), (1804, 0.125), (1805, 0.117), (1806, 0.109), (1807, 0.101), (1808, 0.093), (1809, 0.085), (1810, 0.077), (1811, 0.072), (1812, 0.069), (1813, 0.066), (1814, 0.063), (1815, 0.06), (1816, 0.057), (1817, 0.054), (1818, 0.051), (1819, 0.048), (1820, 0.045), (1821, 0.042), (1822, 0.04), (1823, 0.038), (1824, 0.036), (1825, 0.033), (1826, 0.031), (1827, 0.029), (1828, 0.027), (1829, 0.025), (1830, 0.022), (1831, 0.021), (1832, 0.021), (1833, 0.02), (1834, 0.02), (1835, 0.019), (1836, 0.019), (1837, 0.018), (1838, 0.018), (1839, 0.017), (1840, 0.016), (1841, 0.016), (1842, 0.015), (1843, 0.015), (1844, 0.014), (1845, 0.014), (1846, 0.013), (1847, 0.013), (1848, 0.012), (1849, 0.012), (1850, 0.011), (1851, 0.01), (1852, 0.01), (1853, 0.01), (1854, 0.009), (1855, 0.009), (1856, 0.009), (1857, 0.008), (1858, 0.008), (1859, 0.008), (1860, 0.007), (1861, 0.007), (1862, 0.007), (1863, 0.006), (1864, 0.006), (1865, 0.005), (1866, 0.005), (1867, 0.005), (1868, 0.004), (1869, 0.004), (1870, 0.004), (1871, 0.003), (1872, 0.003), (1873, 0.003), (1874, 0.002), (1875, 0.002), (1876, 0.002), (1877, 0.001)] responses['SWIR-2'] = [(1956, 0.001), (1957, 0.001), (1958, 0.001), (1959, 0.002), (1960, 0.002), (1961, 0.002), (1962, 0.002), (1963, 0.002), (1964, 0.002), (1965, 0.003), (1966, 0.003), (1967, 0.003), (1968, 0.003), (1969, 0.003), (1970, 0.004), (1971, 0.004), (1972, 0.004), (1973, 0.004), (1974, 0.004), (1975, 0.004), (1976, 0.005), (1977, 0.005), (1978, 0.005), (1979, 0.005), (1980, 0.005), (1981, 0.006), (1982, 0.006), (1983, 0.006), (1984, 0.006), (1985, 0.006), (1986, 0.007), (1987, 0.007), (1988, 0.007), (1989, 0.007), (1990, 0.007), (1991, 0.008), (1992, 0.008), (1993, 0.008), (1994, 0.008), (1995, 0.008), (1996, 0.009), (1997, 0.009), (1998, 0.009), (1999, 0.009), (2000, 0.009), (2001, 0.01), (2002, 0.01), (2003, 0.011), (2004, 0.011), (2005, 0.012), (2006, 0.012), (2007, 0.013), (2008, 0.013), (2009, 0.014), (2010, 0.014), (2011, 0.015), (2012, 0.015), (2013, 0.016), (2014, 0.016), (2015, 0.017), (2016, 0.017), (2017, 0.018), (2018, 0.018), (2019, 0.019), (2020, 0.019), (2021, 0.021), (2022, 0.023), (2023, 0.024), (2024, 0.026), (2025, 0.027), (2026, 0.029), (2027, 0.031), (2028, 0.032), (2029, 0.034), (2030, 0.036), (2031, 0.037), (2032, 0.039), (2033, 0.041), (2034, 0.042), (2035, 0.044), (2036, 0.046), (2037, 0.047), (2038, 0.049), (2039, 0.051), (2040, 0.052), (2041, 0.054), (2042, 0.056), (2043, 0.057), (2044, 0.059), (2045, 0.061), (2046, 0.062), (2047, 0.064), (2048, 0.066), (2049, 0.068), (2050, 0.069), (2051, 0.072), (2052, 0.075), (2053, 0.078), (2054, 0.081), (2055, 0.084), (2056, 0.087), (2057, 0.09), (2058, 0.093), (2059, 0.096), (2060, 0.1), (2061, 0.105), (2062, 0.109), (2063, 0.115), (2064, 0.12), (2065, 0.125), (2066, 0.13), (2067, 0.135), (2068, 0.14), (2069, 0.145), (2070, 0.15), (2071, 0.16), (2072, 0.17), (2073, 0.18), (2074, 0.19), (2075, 0.2), (2076, 0.211), (2077, 0.221), (2078, 0.231), (2079, 0.241), (2080, 0.251), (2081, 0.265), (2082, 0.28), (2083, 0.294), (2084, 0.308), (2085, 0.323), (2086, 0.337), (2087, 0.352), (2088, 0.366), (2089, 0.38), (2090, 0.395), (2091, 0.409), (2092, 0.424), (2093, 0.438), (2094, 0.453), (2095, 0.467), (2096, 0.482), (2097, 0.496), (2098, 0.511), (2099, 0.526), (2100, 0.54), (2101, 0.556), (2102, 0.571), (2103, 0.586), (2104, 0.602), (2105, 0.617), (2106, 0.633), (2107, 0.648), (2108, 0.664), (2109, 0.679), (2110, 0.695), (2111, 0.71), (2112, 0.726), (2113, 0.742), (2114, 0.758), (2115, 0.773), (2116, 0.789), (2117, 0.805), (2118, 0.821), (2119, 0.837), (2120, 0.853), (2121, 0.864), (2122, 0.876), (2123, 0.887), (2124, 0.898), (2125, 0.91), (2126, 0.915), (2127, 0.92), (2128, 0.925), (2129, 0.931), (2130, 0.936), (2131, 0.939), (2132, 0.941), (2133, 0.944), (2134, 0.947), (2135, 0.95), (2136, 0.95), (2137, 0.95), (2138, 0.95), (2139, 0.95), (2140, 0.951), (2141, 0.95), (2142, 0.95), (2143, 0.95), (2144, 0.949), (2145, 0.949), (2146, 0.946), (2147, 0.944), (2148, 0.941), (2149, 0.938), (2150, 0.936), (2151, 0.937), (2152, 0.939), (2153, 0.941), (2154, 0.942), (2155, 0.944), (2156, 0.944), (2157, 0.945), (2158, 0.945), (2159, 0.946), (2160, 0.946), (2161, 0.947), (2162, 0.947), (2163, 0.947), (2164, 0.948), (2165, 0.948), (2166, 0.951), (2167, 0.953), (2168, 0.956), (2169, 0.959), (2170, 0.962), (2171, 0.965), (2172, 0.967), (2173, 0.97), (2174, 0.973), (2175, 0.976), (2176, 0.979), (2177, 0.982), (2178, 0.985), (2179, 0.988), (2180, 0.991), (2181, 0.994), (2182, 0.996), (2183, 0.997), (2184, 0.997), (2185, 0.998), (2186, 0.998), (2187, 0.998), (2188, 0.999), (2189, 0.999), (2190, 0.999), (2191, 1.0), (2192, 1.0), (2193, 0.999), (2194, 0.999), (2195, 0.998), (2196, 0.998), (2197, 0.997), (2198, 0.997), (2199, 0.996), (2200, 0.995), (2201, 0.995), (2202, 0.995), (2203, 0.995), (2204, 0.994), (2205, 0.994), (2206, 0.994), (2207, 0.993), (2208, 0.993), (2209, 0.993), (2210, 0.993), (2211, 0.992), (2212, 0.992), (2213, 0.992), (2214, 0.991), (2215, 0.991), (2216, 0.991), (2217, 0.99), (2218, 0.99), (2219, 0.99), (2220, 0.989), (2221, 0.989), (2222, 0.989), (2223, 0.988), (2224, 0.988), (2225, 0.987), (2226, 0.981), (2227, 0.975), (2228, 0.969), (2229, 0.962), (2230, 0.956), (2231, 0.955), (2232, 0.953), (2233, 0.952), (2234, 0.95), (2235, 0.949), (2236, 0.947), (2237, 0.946), (2238, 0.945), (2239, 0.943), (2240, 0.942), (2241, 0.94), (2242, 0.938), (2243, 0.936), (2244, 0.934), (2245, 0.932), (2246, 0.93), (2247, 0.928), (2248, 0.926), (2249, 0.924), (2250, 0.922), (2251, 0.922), (2252, 0.921), (2253, 0.92), (2254, 0.92), (2255, 0.919), (2256, 0.919), (2257, 0.918), (2258, 0.917), (2259, 0.917), (2260, 0.916), (2261, 0.915), (2262, 0.914), (2263, 0.914), (2264, 0.913), (2265, 0.912), (2266, 0.911), (2267, 0.91), (2268, 0.909), (2269, 0.908), (2270, 0.906), (2271, 0.905), (2272, 0.903), (2273, 0.901), (2274, 0.9), (2275, 0.898), (2276, 0.896), (2277, 0.895), (2278, 0.893), (2279, 0.892), (2280, 0.89), (2281, 0.883), (2282, 0.876), (2283, 0.87), (2284, 0.863), (2285, 0.856), (2286, 0.849), (2287, 0.842), (2288, 0.836), (2289, 0.829), (2290, 0.822), (2291, 0.816), (2292, 0.809), (2293, 0.803), (2294, 0.796), (2295, 0.79), (2296, 0.783), (2297, 0.777), (2298, 0.77), (2299, 0.764), (2300, 0.757), (2301, 0.751), (2302, 0.746), (2303, 0.74), (2304, 0.734), (2305, 0.728), (2306, 0.728), (2307, 0.728), (2308, 0.734), (2309, 0.741), (2310, 0.747), (2311, 0.754), (2312, 0.76), (2313, 0.766), (2314, 0.772), (2315, 0.778), (2316, 0.784), (2317, 0.79), (2318, 0.793), (2319, 0.802), (2320, 0.808), (2321, 0.819), (2322, 0.83), (2323, 0.841), (2324, 0.852), (2325, 0.857), (2326, 0.863), (2327, 0.868), (2328, 0.874), (2329, 0.874), (2330, 0.874), (2331, 0.874), (2332, 0.875), (2333, 0.868), (2334, 0.861), (2335, 0.854), (2336, 0.836), (2337, 0.819), (2338, 0.801), (2339, 0.748), (2340, 0.695), (2341, 0.669), (2342, 0.642), (2343, 0.616), (2344, 0.59), (2345, 0.564), (2346, 0.537), (2347, 0.511), (2348, 0.484), (2349, 0.458), (2350, 0.431), (2351, 0.409), (2352, 0.386), (2353, 0.364), (2354, 0.342), (2355, 0.319), (2356, 0.296), (2357, 0.274), (2358, 0.251), (2359, 0.229), (2360, 0.206), (2361, 0.193), (2362, 0.18), (2363, 0.167), (2364, 0.154), (2365, 0.141), (2366, 0.128), (2367, 0.115), (2368, 0.102), (2369, 0.089), (2370, 0.076), (2371, 0.072), (2372, 0.068), (2373, 0.063), (2374, 0.059), (2375, 0.055), (2376, 0.05), (2377, 0.046), (2378, 0.042), (2379, 0.037), (2380, 0.033), (2381, 0.031), (2382, 0.029), (2383, 0.026), (2384, 0.024), (2385, 0.022), (2386, 0.02), (2387, 0.018), (2388, 0.015), (2389, 0.013), (2390, 0.011), (2391, 0.01), (2392, 0.01), (2393, 0.009), (2394, 0.009), (2395, 0.008), (2396, 0.008), (2397, 0.007), (2398, 0.007), (2399, 0.006), (2400, 0.005), (2401, 0.005), (2402, 0.004), (2403, 0.004), (2404, 0.003), (2405, 0.003), (2406, 0.002), (2407, 0.002), (2408, 0.001)]
- Save spectral response function [boolean]
Whether to save the spectral response function library as *.srf.gpkg sidecar file.
Default: False
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpectralResamplingToLandsat45Tm
:
----------------
Arguments
----------------
raster: Spectral raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
response: Spectral response function
Default value: from collections import OrderedDict
responses = OrderedDict()
responses['Blue'] = [(421, 0.001), (422, 0.001), (423, 0.001), (424, 0.001), (425, 0.001), (426, 0.002),
(427, 0.002), (428, 0.002), (429, 0.003), (430, 0.003), (431, 0.005), (432, 0.007),
(433, 0.01), (434, 0.013), (435, 0.017), (436, 0.02), (437, 0.025), (438, 0.031),
(439, 0.037), (440, 0.042), (441, 0.048), (442, 0.053), (443, 0.059), (444, 0.064),
(445, 0.07), (446, 0.083), (447, 0.121), (448, 0.172), (449, 0.273), (450, 0.372),
(451, 0.442), (452, 0.514), (453, 0.579), (454, 0.628), (455, 0.711), (456, 0.732),
(457, 0.742), (458, 0.75), (459, 0.755), (460, 0.756), (461, 0.766), (462, 0.776),
(463, 0.786), (464, 0.797), (465, 0.807), (466, 0.812), (467, 0.817), (468, 0.822),
(469, 0.827), (470, 0.829), (471, 0.831), (472, 0.833), (473, 0.835), (474, 0.838),
(475, 0.846), (476, 0.853), (477, 0.861), (478, 0.868), (479, 0.876), (480, 0.883),
(481, 0.886), (482, 0.888), (483, 0.891), (484, 0.893), (485, 0.896), (486, 0.898),
(487, 0.901), (488, 0.903), (489, 0.905), (490, 0.908), (491, 0.918), (492, 0.928),
(493, 0.938), (494, 0.948), (495, 0.952), (496, 0.956), (497, 0.961), (498, 0.965),
(499, 0.97), (500, 0.979), (501, 0.987), (502, 0.994), (503, 1.0), (504, 0.999),
(505, 0.99), (506, 0.963), (507, 0.936), (508, 0.909), (509, 0.881), (510, 0.852),
(511, 0.824), (512, 0.81), (513, 0.796), (514, 0.779), (515, 0.756), (516, 0.707),
(517, 0.596), (518, 0.497), (519, 0.413), (520, 0.329), (521, 0.245), (522, 0.137),
(523, 0.105), (524, 0.094), (525, 0.083), (526, 0.072), (527, 0.061), (528, 0.055),
(529, 0.052), (530, 0.049), (531, 0.045), (532, 0.041), (533, 0.038), (534, 0.034),
(535, 0.031), (536, 0.027), (537, 0.024), (538, 0.022), (539, 0.019), (540, 0.017),
(541, 0.015), (542, 0.013), (543, 0.011), (544, 0.01), (545, 0.009), (546, 0.007),
(547, 0.006), (548, 0.006), (549, 0.006), (550, 0.005), (551, 0.005), (552, 0.005),
(553, 0.005), (554, 0.005), (555, 0.004), (556, 0.004), (557, 0.004), (558, 0.004),
(559, 0.004), (560, 0.003), (561, 0.003), (562, 0.003), (563, 0.003), (564, 0.002),
(565, 0.002), (566, 0.002), (567, 0.002), (568, 0.002), (569, 0.001), (570, 0.001)]
responses['Green'] = [(502, 0.002), (503, 0.003), (504, 0.007), (505, 0.009), (506, 0.011), (507, 0.014),
(508, 0.016), (509, 0.019), (510, 0.022), (511, 0.024), (512, 0.027), (513, 0.03),
(514, 0.032), (515, 0.035), (516, 0.05), (517, 0.066), (518, 0.091), (519, 0.12),
(520, 0.152), (521, 0.191), (522, 0.231), (523, 0.271), (524, 0.312), (525, 0.353),
(526, 0.392), (527, 0.43), (528, 0.468), (529, 0.507), (530, 0.537), (531, 0.561),
(532, 0.577), (533, 0.591), (534, 0.605), (535, 0.619), (536, 0.633), (537, 0.647),
(538, 0.661), (539, 0.675), (540, 0.69), (541, 0.7), (542, 0.711), (543, 0.721),
(544, 0.732), (545, 0.743), (546, 0.753), (547, 0.764), (548, 0.775), (549, 0.786),
(550, 0.797), (551, 0.803), (552, 0.809), (553, 0.815), (554, 0.821), (555, 0.826),
(556, 0.832), (557, 0.837), (558, 0.843), (559, 0.848), (560, 0.854), (561, 0.859),
(562, 0.865), (563, 0.871), (564, 0.873), (565, 0.874), (566, 0.875), (567, 0.877),
(568, 0.878), (569, 0.879), (570, 0.88), (571, 0.881), (572, 0.882), (573, 0.883),
(574, 0.884), (575, 0.885), (576, 0.886), (577, 0.887), (578, 0.891), (579, 0.896),
(580, 0.9), (581, 0.905), (582, 0.909), (583, 0.914), (584, 0.932), (585, 0.944),
(586, 0.954), (587, 0.963), (588, 0.971), (589, 0.977), (590, 0.982), (591, 0.988),
(592, 0.994), (593, 0.999), (594, 1.0), (595, 0.999), (596, 0.998), (597, 0.995),
(598, 0.98), (599, 0.964), (600, 0.949), (601, 0.927), (602, 0.894), (603, 0.862),
(604, 0.829), (605, 0.796), (606, 0.747), (607, 0.672), (608, 0.597), (609, 0.521),
(610, 0.467), (611, 0.413), (612, 0.359), (613, 0.304), (614, 0.249), (615, 0.206),
(616, 0.181), (617, 0.156), (618, 0.131), (619, 0.108), (620, 0.097), (621, 0.087),
(622, 0.076), (623, 0.066), (624, 0.055), (625, 0.052), (626, 0.049), (627, 0.045),
(628, 0.042), (629, 0.039), (630, 0.036), (631, 0.032), (632, 0.029), (633, 0.026),
(634, 0.023), (635, 0.021), (636, 0.019), (637, 0.017), (638, 0.015), (639, 0.013),
(640, 0.011), (641, 0.01), (642, 0.009), (643, 0.008), (644, 0.006), (645, 0.005),
(646, 0.003), (647, 0.002), (648, 0.001)]
responses['Red'] = [(563, 0.001), (564, 0.001), (565, 0.001), (566, 0.001), (567, 0.001), (568, 0.001),
(569, 0.002), (570, 0.002), (571, 0.002), (572, 0.002), (573, 0.002), (574, 0.002),
(575, 0.002), (576, 0.002), (577, 0.002), (578, 0.002), (579, 0.002), (580, 0.002),
(581, 0.002), (582, 0.002), (583, 0.002), (584, 0.002), (585, 0.002), (586, 0.002),
(587, 0.002), (588, 0.002), (589, 0.002), (590, 0.003), (591, 0.003), (592, 0.003),
(593, 0.004), (594, 0.004), (595, 0.004), (596, 0.005), (597, 0.006), (598, 0.007),
(599, 0.008), (600, 0.009), (601, 0.011), (602, 0.014), (603, 0.016), (604, 0.019),
(605, 0.023), (606, 0.027), (607, 0.03), (608, 0.034), (609, 0.038), (610, 0.041),
(611, 0.045), (612, 0.062), (613, 0.081), (614, 0.101), (615, 0.12), (616, 0.14),
(617, 0.16), (618, 0.18), (619, 0.24), (620, 0.327), (621, 0.414), (622, 0.449),
(623, 0.471), (624, 0.492), (625, 0.514), (626, 0.535), (627, 0.557), (628, 0.579),
(629, 0.601), (630, 0.623), (631, 0.65), (632, 0.687), (633, 0.737), (634, 0.787),
(635, 0.803), (636, 0.818), (637, 0.835), (638, 0.849), (639, 0.86), (640, 0.871),
(641, 0.883), (642, 0.894), (643, 0.906), (644, 0.912), (645, 0.917), (646, 0.922),
(647, 0.928), (648, 0.933), (649, 0.939), (650, 0.944), (651, 0.943), (652, 0.942),
(653, 0.942), (654, 0.941), (655, 0.94), (656, 0.939), (657, 0.938), (658, 0.937),
(659, 0.936), (660, 0.935), (661, 0.937), (662, 0.939), (663, 0.943), (664, 0.948),
(665, 0.954), (666, 0.959), (667, 0.965), (668, 0.97), (669, 0.975), (670, 0.979),
(671, 0.983), (672, 0.987), (673, 0.99), (674, 0.997), (675, 0.996), (676, 0.998),
(677, 1.0), (678, 0.998), (679, 0.996), (680, 0.994), (681, 0.973), (682, 0.973),
(683, 0.974), (684, 0.964), (685, 0.945), (686, 0.927), (687, 0.908), (688, 0.871),
(689, 0.822), (690, 0.773), (691, 0.687), (692, 0.594), (693, 0.505), (694, 0.433),
(695, 0.361), (696, 0.289), (697, 0.223), (698, 0.188), (699, 0.152), (700, 0.116),
(701, 0.106), (702, 0.095), (703, 0.084), (704, 0.074), (705, 0.063), (706, 0.057),
(707, 0.054), (708, 0.051), (709, 0.048), (710, 0.045), (711, 0.042), (712, 0.039),
(713, 0.036), (714, 0.033), (715, 0.03), (716, 0.027), (717, 0.024), (718, 0.022),
(719, 0.021), (720, 0.02), (721, 0.018), (722, 0.017), (723, 0.015), (724, 0.014),
(725, 0.012), (726, 0.011), (727, 0.01), (728, 0.009), (729, 0.007), (730, 0.006),
(731, 0.006), (732, 0.005), (733, 0.005), (734, 0.005), (735, 0.005), (736, 0.004),
(737, 0.004), (738, 0.004), (739, 0.003), (740, 0.003), (741, 0.003), (742, 0.002),
(743, 0.002), (744, 0.002), (745, 0.002), (746, 0.001)]
responses['NIR'] = [(727, 0.001), (728, 0.001), (729, 0.002), (730, 0.002), (731, 0.003), (732, 0.003),
(733, 0.004), (734, 0.004), (735, 0.005), (736, 0.005), (737, 0.006), (738, 0.006),
(739, 0.007), (740, 0.007), (741, 0.008), (742, 0.008), (743, 0.009), (744, 0.009),
(745, 0.01), (746, 0.012), (747, 0.014), (748, 0.016), (749, 0.018), (750, 0.02),
(751, 0.022), (752, 0.025), (753, 0.028), (754, 0.031), (755, 0.034), (756, 0.042),
(757, 0.05), (758, 0.058), (759, 0.066), (760, 0.074), (761, 0.083), (762, 0.09),
(763, 0.099), (764, 0.121), (765, 0.143), (766, 0.165), (767, 0.187), (768, 0.216),
(769, 0.251), (770, 0.286), (771, 0.322), (772, 0.357), (773, 0.393), (774, 0.428),
(775, 0.464), (776, 0.5), (777, 0.544), (778, 0.587), (779, 0.63), (780, 0.673),
(781, 0.717), (782, 0.76), (783, 0.795), (784, 0.822), (785, 0.849), (786, 0.876),
(787, 0.902), (788, 0.917), (789, 0.932), (790, 0.946), (791, 0.956), (792, 0.963),
(793, 0.97), (794, 0.976), (795, 0.983), (796, 0.986), (797, 0.99), (798, 0.993),
(799, 0.997), (800, 1.0), (801, 0.997), (802, 0.994), (803, 0.992), (804, 0.989),
(805, 0.986), (806, 0.983), (807, 0.98), (808, 0.977), (809, 0.974), (810, 0.971),
(811, 0.968), (812, 0.965), (813, 0.962), (814, 0.959), (815, 0.956), (816, 0.953),
(817, 0.95), (818, 0.947), (819, 0.945), (820, 0.942), (821, 0.939), (822, 0.936),
(823, 0.933), (824, 0.93), (825, 0.93), (826, 0.932), (827, 0.934), (828, 0.936),
(829, 0.938), (830, 0.94), (831, 0.942), (832, 0.944), (833, 0.946), (834, 0.948),
(835, 0.95), (836, 0.952), (837, 0.954), (838, 0.956), (839, 0.958), (840, 0.96),
(841, 0.962), (842, 0.964), (843, 0.966), (844, 0.968), (845, 0.97), (846, 0.972),
(847, 0.974), (848, 0.976), (849, 0.978), (850, 0.98), (851, 0.978), (852, 0.977),
(853, 0.975), (854, 0.974), (855, 0.973), (856, 0.971), (857, 0.97), (858, 0.967),
(859, 0.965), (860, 0.963), (861, 0.96), (862, 0.959), (863, 0.959), (864, 0.959),
(865, 0.96), (866, 0.961), (867, 0.962), (868, 0.963), (869, 0.964), (870, 0.965),
(871, 0.967), (872, 0.968), (873, 0.965), (874, 0.963), (875, 0.96), (876, 0.955),
(877, 0.95), (878, 0.945), (879, 0.94), (880, 0.935), (881, 0.929), (882, 0.922),
(883, 0.915), (884, 0.908), (885, 0.901), (886, 0.894), (887, 0.887), (888, 0.88),
(889, 0.873), (890, 0.866), (891, 0.865), (892, 0.864), (893, 0.858), (894, 0.846),
(895, 0.834), (896, 0.823), (897, 0.811), (898, 0.8), (899, 0.789), (900, 0.779),
(901, 0.733), (902, 0.688), (903, 0.643), (904, 0.578), (905, 0.509), (906, 0.44),
(907, 0.371), (908, 0.321), (909, 0.275), (910, 0.23), (911, 0.185), (912, 0.156),
(913, 0.13), (914, 0.105), (915, 0.084), (916, 0.074), (917, 0.064), (918, 0.054),
(919, 0.044), (920, 0.034), (921, 0.031), (922, 0.027), (923, 0.024), (924, 0.02),
(925, 0.017), (926, 0.015), (927, 0.013), (928, 0.012), (929, 0.01), (930, 0.008),
(931, 0.008), (932, 0.007), (933, 0.007), (934, 0.006), (935, 0.006), (936, 0.005),
(937, 0.005), (938, 0.005), (939, 0.004), (940, 0.004), (941, 0.003), (942, 0.003),
(943, 0.002), (944, 0.002), (945, 0.002), (946, 0.001)]
responses['SWIR-1'] = [(1512, 0.001), (1513, 0.001), (1514, 0.001), (1515, 0.001), (1516, 0.001), (1517, 0.001),
(1518, 0.002), (1519, 0.002), (1520, 0.002), (1521, 0.002), (1522, 0.003), (1523, 0.004),
(1524, 0.004), (1525, 0.005), (1526, 0.006), (1527, 0.007), (1528, 0.007), (1529, 0.008),
(1530, 0.009), (1531, 0.01), (1532, 0.012), (1533, 0.013), (1534, 0.015), (1535, 0.016),
(1536, 0.018), (1537, 0.019), (1538, 0.021), (1539, 0.022), (1540, 0.024), (1541, 0.028),
(1542, 0.033), (1543, 0.038), (1544, 0.043), (1545, 0.048), (1546, 0.057), (1547, 0.067),
(1548, 0.077), (1549, 0.087), (1550, 0.098), (1551, 0.114), (1552, 0.132), (1553, 0.151),
(1554, 0.17), (1555, 0.189), (1556, 0.208), (1557, 0.228), (1558, 0.247), (1559, 0.267),
(1560, 0.287), (1561, 0.312), (1562, 0.34), (1563, 0.368), (1564, 0.396), (1565, 0.425),
(1566, 0.454), (1567, 0.483), (1568, 0.512), (1569, 0.541), (1570, 0.571), (1571, 0.598),
(1572, 0.625), (1573, 0.653), (1574, 0.68), (1575, 0.708), (1576, 0.732), (1577, 0.755),
(1578, 0.777), (1579, 0.8), (1580, 0.824), (1581, 0.842), (1582, 0.858), (1583, 0.874),
(1584, 0.89), (1585, 0.907), (1586, 0.916), (1587, 0.924), (1588, 0.93), (1589, 0.934),
(1590, 0.939), (1591, 0.943), (1592, 0.947), (1593, 0.946), (1594, 0.943), (1595, 0.94),
(1596, 0.937), (1597, 0.934), (1598, 0.933), (1599, 0.933), (1600, 0.933), (1601, 0.931),
(1602, 0.929), (1603, 0.928), (1604, 0.928), (1605, 0.928), (1606, 0.928), (1607, 0.928),
(1608, 0.928), (1609, 0.933), (1610, 0.94), (1611, 0.944), (1612, 0.947), (1613, 0.949),
(1614, 0.952), (1615, 0.955), (1616, 0.958), (1617, 0.961), (1618, 0.963), (1619, 0.966),
(1620, 0.969), (1621, 0.972), (1622, 0.975), (1623, 0.978), (1624, 0.98), (1625, 0.983),
(1626, 0.985), (1627, 0.988), (1628, 0.989), (1629, 0.989), (1630, 0.988), (1631, 0.987),
(1632, 0.986), (1633, 0.985), (1634, 0.984), (1635, 0.983), (1636, 0.981), (1637, 0.98),
(1638, 0.979), (1639, 0.978), (1640, 0.977), (1641, 0.976), (1642, 0.975), (1643, 0.974),
(1644, 0.973), (1645, 0.972), (1646, 0.971), (1647, 0.97), (1648, 0.969), (1649, 0.969),
(1650, 0.968), (1651, 0.967), (1652, 0.967), (1653, 0.968), (1654, 0.97), (1655, 0.971),
(1656, 0.973), (1657, 0.975), (1658, 0.977), (1659, 0.979), (1660, 0.98), (1661, 0.982),
(1662, 0.983), (1663, 0.985), (1664, 0.986), (1665, 0.988), (1666, 0.988), (1667, 0.987),
(1668, 0.986), (1669, 0.985), (1670, 0.984), (1671, 0.984), (1672, 0.983), (1673, 0.983),
(1674, 0.982), (1675, 0.982), (1676, 0.981), (1677, 0.981), (1678, 0.98), (1679, 0.98),
(1680, 0.979), (1681, 0.979), (1682, 0.978), (1683, 0.978), (1684, 0.977), (1685, 0.977),
(1686, 0.976), (1687, 0.976), (1688, 0.975), (1689, 0.975), (1690, 0.974), (1691, 0.975),
(1692, 0.977), (1693, 0.978), (1694, 0.98), (1695, 0.982), (1696, 0.983), (1697, 0.985),
(1698, 0.987), (1699, 0.988), (1700, 0.99), (1701, 0.99), (1702, 0.991), (1703, 0.992),
(1704, 0.993), (1705, 0.993), (1706, 0.994), (1707, 0.995), (1708, 0.995), (1709, 0.996),
(1710, 0.997), (1711, 0.998), (1712, 0.998), (1713, 0.999), (1714, 0.999), (1715, 1.0),
(1716, 0.999), (1717, 0.998), (1718, 0.996), (1719, 0.995), (1720, 0.993), (1721, 0.992),
(1722, 0.99), (1723, 0.988), (1724, 0.986), (1725, 0.974), (1726, 0.982), (1727, 0.98),
(1728, 0.978), (1729, 0.976), (1730, 0.975), (1731, 0.973), (1732, 0.971), (1733, 0.969),
(1734, 0.967), (1735, 0.965), (1736, 0.963), (1737, 0.961), (1738, 0.96), (1739, 0.958),
(1740, 0.956), (1741, 0.955), (1742, 0.954), (1743, 0.953), (1744, 0.953), (1745, 0.952),
(1746, 0.951), (1747, 0.95), (1748, 0.95), (1749, 0.949), (1750, 0.948), (1751, 0.951),
(1752, 0.954), (1753, 0.957), (1754, 0.961), (1755, 0.964), (1756, 0.965), (1757, 0.964),
(1758, 0.962), (1759, 0.961), (1760, 0.96), (1761, 0.957), (1762, 0.953), (1763, 0.948),
(1764, 0.944), (1765, 0.94), (1766, 0.931), (1767, 0.92), (1768, 0.909), (1769, 0.898),
(1770, 0.887), (1771, 0.868), (1772, 0.846), (1773, 0.823), (1774, 0.801), (1775, 0.779),
(1776, 0.752), (1777, 0.723), (1778, 0.695), (1779, 0.666), (1780, 0.637), (1781, 0.607),
(1782, 0.577), (1783, 0.547), (1784, 0.516), (1785, 0.486), (1786, 0.456), (1787, 0.425),
(1788, 0.395), (1789, 0.365), (1790, 0.334), (1791, 0.313), (1792, 0.296), (1793, 0.279),
(1794, 0.262), (1795, 0.245), (1796, 0.228), (1797, 0.211), (1798, 0.194), (1799, 0.177),
(1800, 0.16), (1801, 0.149), (1802, 0.141), (1803, 0.133), (1804, 0.125), (1805, 0.117),
(1806, 0.109), (1807, 0.101), (1808, 0.093), (1809, 0.085), (1810, 0.077), (1811, 0.072),
(1812, 0.069), (1813, 0.066), (1814, 0.063), (1815, 0.06), (1816, 0.057), (1817, 0.054),
(1818, 0.051), (1819, 0.048), (1820, 0.045), (1821, 0.042), (1822, 0.04), (1823, 0.038),
(1824, 0.036), (1825, 0.033), (1826, 0.031), (1827, 0.029), (1828, 0.027), (1829, 0.025),
(1830, 0.022), (1831, 0.021), (1832, 0.021), (1833, 0.02), (1834, 0.02), (1835, 0.019),
(1836, 0.019), (1837, 0.018), (1838, 0.018), (1839, 0.017), (1840, 0.016), (1841, 0.016),
(1842, 0.015), (1843, 0.015), (1844, 0.014), (1845, 0.014), (1846, 0.013), (1847, 0.013),
(1848, 0.012), (1849, 0.012), (1850, 0.011), (1851, 0.01), (1852, 0.01), (1853, 0.01),
(1854, 0.009), (1855, 0.009), (1856, 0.009), (1857, 0.008), (1858, 0.008), (1859, 0.008),
(1860, 0.007), (1861, 0.007), (1862, 0.007), (1863, 0.006), (1864, 0.006), (1865, 0.005),
(1866, 0.005), (1867, 0.005), (1868, 0.004), (1869, 0.004), (1870, 0.004), (1871, 0.003),
(1872, 0.003), (1873, 0.003), (1874, 0.002), (1875, 0.002), (1876, 0.002), (1877, 0.001)]
responses['SWIR-2'] = [(1956, 0.001), (1957, 0.001), (1958, 0.001), (1959, 0.002), (1960, 0.002), (1961, 0.002),
(1962, 0.002), (1963, 0.002), (1964, 0.002), (1965, 0.003), (1966, 0.003), (1967, 0.003),
(1968, 0.003), (1969, 0.003), (1970, 0.004), (1971, 0.004), (1972, 0.004), (1973, 0.004),
(1974, 0.004), (1975, 0.004), (1976, 0.005), (1977, 0.005), (1978, 0.005), (1979, 0.005),
(1980, 0.005), (1981, 0.006), (1982, 0.006), (1983, 0.006), (1984, 0.006), (1985, 0.006),
(1986, 0.007), (1987, 0.007), (1988, 0.007), (1989, 0.007), (1990, 0.007), (1991, 0.008),
(1992, 0.008), (1993, 0.008), (1994, 0.008), (1995, 0.008), (1996, 0.009), (1997, 0.009),
(1998, 0.009), (1999, 0.009), (2000, 0.009), (2001, 0.01), (2002, 0.01), (2003, 0.011),
(2004, 0.011), (2005, 0.012), (2006, 0.012), (2007, 0.013), (2008, 0.013), (2009, 0.014),
(2010, 0.014), (2011, 0.015), (2012, 0.015), (2013, 0.016), (2014, 0.016), (2015, 0.017),
(2016, 0.017), (2017, 0.018), (2018, 0.018), (2019, 0.019), (2020, 0.019), (2021, 0.021),
(2022, 0.023), (2023, 0.024), (2024, 0.026), (2025, 0.027), (2026, 0.029), (2027, 0.031),
(2028, 0.032), (2029, 0.034), (2030, 0.036), (2031, 0.037), (2032, 0.039), (2033, 0.041),
(2034, 0.042), (2035, 0.044), (2036, 0.046), (2037, 0.047), (2038, 0.049), (2039, 0.051),
(2040, 0.052), (2041, 0.054), (2042, 0.056), (2043, 0.057), (2044, 0.059), (2045, 0.061),
(2046, 0.062), (2047, 0.064), (2048, 0.066), (2049, 0.068), (2050, 0.069), (2051, 0.072),
(2052, 0.075), (2053, 0.078), (2054, 0.081), (2055, 0.084), (2056, 0.087), (2057, 0.09),
(2058, 0.093), (2059, 0.096), (2060, 0.1), (2061, 0.105), (2062, 0.109), (2063, 0.115),
(2064, 0.12), (2065, 0.125), (2066, 0.13), (2067, 0.135), (2068, 0.14), (2069, 0.145),
(2070, 0.15), (2071, 0.16), (2072, 0.17), (2073, 0.18), (2074, 0.19), (2075, 0.2),
(2076, 0.211), (2077, 0.221), (2078, 0.231), (2079, 0.241), (2080, 0.251), (2081, 0.265),
(2082, 0.28), (2083, 0.294), (2084, 0.308), (2085, 0.323), (2086, 0.337), (2087, 0.352),
(2088, 0.366), (2089, 0.38), (2090, 0.395), (2091, 0.409), (2092, 0.424), (2093, 0.438),
(2094, 0.453), (2095, 0.467), (2096, 0.482), (2097, 0.496), (2098, 0.511), (2099, 0.526),
(2100, 0.54), (2101, 0.556), (2102, 0.571), (2103, 0.586), (2104, 0.602), (2105, 0.617),
(2106, 0.633), (2107, 0.648), (2108, 0.664), (2109, 0.679), (2110, 0.695), (2111, 0.71),
(2112, 0.726), (2113, 0.742), (2114, 0.758), (2115, 0.773), (2116, 0.789), (2117, 0.805),
(2118, 0.821), (2119, 0.837), (2120, 0.853), (2121, 0.864), (2122, 0.876), (2123, 0.887),
(2124, 0.898), (2125, 0.91), (2126, 0.915), (2127, 0.92), (2128, 0.925), (2129, 0.931),
(2130, 0.936), (2131, 0.939), (2132, 0.941), (2133, 0.944), (2134, 0.947), (2135, 0.95),
(2136, 0.95), (2137, 0.95), (2138, 0.95), (2139, 0.95), (2140, 0.951), (2141, 0.95),
(2142, 0.95), (2143, 0.95), (2144, 0.949), (2145, 0.949), (2146, 0.946), (2147, 0.944),
(2148, 0.941), (2149, 0.938), (2150, 0.936), (2151, 0.937), (2152, 0.939), (2153, 0.941),
(2154, 0.942), (2155, 0.944), (2156, 0.944), (2157, 0.945), (2158, 0.945), (2159, 0.946),
(2160, 0.946), (2161, 0.947), (2162, 0.947), (2163, 0.947), (2164, 0.948), (2165, 0.948),
(2166, 0.951), (2167, 0.953), (2168, 0.956), (2169, 0.959), (2170, 0.962), (2171, 0.965),
(2172, 0.967), (2173, 0.97), (2174, 0.973), (2175, 0.976), (2176, 0.979), (2177, 0.982),
(2178, 0.985), (2179, 0.988), (2180, 0.991), (2181, 0.994), (2182, 0.996), (2183, 0.997),
(2184, 0.997), (2185, 0.998), (2186, 0.998), (2187, 0.998), (2188, 0.999), (2189, 0.999),
(2190, 0.999), (2191, 1.0), (2192, 1.0), (2193, 0.999), (2194, 0.999), (2195, 0.998),
(2196, 0.998), (2197, 0.997), (2198, 0.997), (2199, 0.996), (2200, 0.995), (2201, 0.995),
(2202, 0.995), (2203, 0.995), (2204, 0.994), (2205, 0.994), (2206, 0.994), (2207, 0.993),
(2208, 0.993), (2209, 0.993), (2210, 0.993), (2211, 0.992), (2212, 0.992), (2213, 0.992),
(2214, 0.991), (2215, 0.991), (2216, 0.991), (2217, 0.99), (2218, 0.99), (2219, 0.99),
(2220, 0.989), (2221, 0.989), (2222, 0.989), (2223, 0.988), (2224, 0.988), (2225, 0.987),
(2226, 0.981), (2227, 0.975), (2228, 0.969), (2229, 0.962), (2230, 0.956), (2231, 0.955),
(2232, 0.953), (2233, 0.952), (2234, 0.95), (2235, 0.949), (2236, 0.947), (2237, 0.946),
(2238, 0.945), (2239, 0.943), (2240, 0.942), (2241, 0.94), (2242, 0.938), (2243, 0.936),
(2244, 0.934), (2245, 0.932), (2246, 0.93), (2247, 0.928), (2248, 0.926), (2249, 0.924),
(2250, 0.922), (2251, 0.922), (2252, 0.921), (2253, 0.92), (2254, 0.92), (2255, 0.919),
(2256, 0.919), (2257, 0.918), (2258, 0.917), (2259, 0.917), (2260, 0.916), (2261, 0.915),
(2262, 0.914), (2263, 0.914), (2264, 0.913), (2265, 0.912), (2266, 0.911), (2267, 0.91),
(2268, 0.909), (2269, 0.908), (2270, 0.906), (2271, 0.905), (2272, 0.903), (2273, 0.901),
(2274, 0.9), (2275, 0.898), (2276, 0.896), (2277, 0.895), (2278, 0.893), (2279, 0.892),
(2280, 0.89), (2281, 0.883), (2282, 0.876), (2283, 0.87), (2284, 0.863), (2285, 0.856),
(2286, 0.849), (2287, 0.842), (2288, 0.836), (2289, 0.829), (2290, 0.822), (2291, 0.816),
(2292, 0.809), (2293, 0.803), (2294, 0.796), (2295, 0.79), (2296, 0.783), (2297, 0.777),
(2298, 0.77), (2299, 0.764), (2300, 0.757), (2301, 0.751), (2302, 0.746), (2303, 0.74),
(2304, 0.734), (2305, 0.728), (2306, 0.728), (2307, 0.728), (2308, 0.734), (2309, 0.741),
(2310, 0.747), (2311, 0.754), (2312, 0.76), (2313, 0.766), (2314, 0.772), (2315, 0.778),
(2316, 0.784), (2317, 0.79), (2318, 0.793), (2319, 0.802), (2320, 0.808), (2321, 0.819),
(2322, 0.83), (2323, 0.841), (2324, 0.852), (2325, 0.857), (2326, 0.863), (2327, 0.868),
(2328, 0.874), (2329, 0.874), (2330, 0.874), (2331, 0.874), (2332, 0.875), (2333, 0.868),
(2334, 0.861), (2335, 0.854), (2336, 0.836), (2337, 0.819), (2338, 0.801), (2339, 0.748),
(2340, 0.695), (2341, 0.669), (2342, 0.642), (2343, 0.616), (2344, 0.59), (2345, 0.564),
(2346, 0.537), (2347, 0.511), (2348, 0.484), (2349, 0.458), (2350, 0.431), (2351, 0.409),
(2352, 0.386), (2353, 0.364), (2354, 0.342), (2355, 0.319), (2356, 0.296), (2357, 0.274),
(2358, 0.251), (2359, 0.229), (2360, 0.206), (2361, 0.193), (2362, 0.18), (2363, 0.167),
(2364, 0.154), (2365, 0.141), (2366, 0.128), (2367, 0.115), (2368, 0.102), (2369, 0.089),
(2370, 0.076), (2371, 0.072), (2372, 0.068), (2373, 0.063), (2374, 0.059), (2375, 0.055),
(2376, 0.05), (2377, 0.046), (2378, 0.042), (2379, 0.037), (2380, 0.033), (2381, 0.031),
(2382, 0.029), (2383, 0.026), (2384, 0.024), (2385, 0.022), (2386, 0.02), (2387, 0.018),
(2388, 0.015), (2389, 0.013), (2390, 0.011), (2391, 0.01), (2392, 0.01), (2393, 0.009),
(2394, 0.009), (2395, 0.008), (2396, 0.008), (2397, 0.007), (2398, 0.007), (2399, 0.006),
(2400, 0.005), (2401, 0.005), (2402, 0.004), (2403, 0.004), (2404, 0.003), (2405, 0.003),
(2406, 0.002), (2407, 0.002), (2408, 0.001)]
Argument type: string
Acceptable values:
- String value
saveResponseFunction: Save spectral response function (optional)
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputResampledRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputResampledRaster: <outputRaster>
Output raster layer
Spectrally resample a spectral raster layer by applying spectral response function convolution. For more information see the Landsat missions website.
Parameters
- Spectral raster layer [raster]
- A spectral raster layer to be resampled.
- Spectral response function [string]
Python code specifying the spectral response function.
Default:
from collections import OrderedDict responses = OrderedDict() responses['Blue'] = [(435, 0.016), (436, 0.027), (437, 0.048), (438, 0.094), (439, 0.167), (440, 0.287), (441, 0.459), (442, 0.605), (443, 0.728), (444, 0.769), (445, 0.792), (446, 0.821), (447, 0.857), (448, 0.857), (449, 0.862), (450, 0.839), (451, 0.845), (452, 0.81), (453, 0.802), (454, 0.804), (455, 0.779), (456, 0.798), (457, 0.816), (458, 0.876), (459, 0.888), (460, 0.901), (461, 0.918), (462, 0.896), (463, 0.903), (464, 0.888), (465, 0.89), (466, 0.863), (467, 0.86), (468, 0.842), (469, 0.866), (470, 0.875), (471, 0.881), (472, 0.888), (473, 0.898), (474, 0.879), (475, 0.884), (476, 0.907), (477, 0.928), (478, 0.932), (479, 0.955), (480, 0.958), (481, 0.948), (482, 0.952), (483, 0.956), (484, 0.98), (485, 0.98), (486, 0.975), (487, 0.973), (488, 0.977), (489, 0.958), (490, 0.965), (491, 0.957), (492, 0.952), (493, 0.973), (494, 0.974), (495, 0.995), (496, 0.986), (497, 0.986), (498, 0.994), (499, 1.0), (500, 0.99), (501, 0.99), (502, 0.976), (503, 0.983), (504, 0.976), (505, 0.983), (506, 0.96), (507, 0.973), (508, 0.964), (509, 0.975), (510, 0.96), (511, 0.932), (512, 0.853), (513, 0.684), (514, 0.486), (515, 0.293), (516, 0.15), (517, 0.073), (518, 0.036), (519, 0.019), (520, 0.009)] responses['Green'] = [(502, 0.001), (503, 0.002), (504, 0.002), (505, 0.003), (506, 0.005), (507, 0.009), (508, 0.014), (509, 0.024), (510, 0.026), (511, 0.041), (512, 0.06), (513, 0.088), (514, 0.126), (515, 0.174), (516, 0.236), (517, 0.308), (518, 0.388), (519, 0.472), (520, 0.552), (521, 0.621), (522, 0.676), (523, 0.716), (524, 0.743), (525, 0.759), (526, 0.769), (527, 0.779), (528, 0.79), (529, 0.805), (530, 0.822), (531, 0.842), (532, 0.861), (533, 0.878), (534, 0.893), (535, 0.905), (536, 0.916), (537, 0.924), (538, 0.933), (539, 0.942), (540, 0.947), (541, 0.951), (542, 0.953), (543, 0.952), (544, 0.951), (545, 0.952), (546, 0.951), (547, 0.951), (548, 0.952), (549, 0.952), (550, 0.953), (551, 0.951), (552, 0.95), (553, 0.95), (554, 0.951), (555, 0.954), (556, 0.96), (557, 0.966), (558, 0.968), (559, 0.965), (560, 0.959), (561, 0.951), (562, 0.944), (563, 0.937), (564, 0.932), (565, 0.933), (566, 0.935), (567, 0.937), (568, 0.94), (569, 0.945), (570, 0.951), (571, 0.955), (572, 0.957), (573, 0.956), (574, 0.957), (575, 0.955), (576, 0.952), (577, 0.954), (578, 0.958), (579, 0.963), (580, 0.973), (581, 0.981), (582, 0.988), (583, 0.995), (584, 1.0), (585, 1.0), (586, 0.994), (587, 0.983), (588, 0.969), (589, 0.954), (590, 0.942), (591, 0.936), (592, 0.932), (593, 0.928), (594, 0.924), (595, 0.912), (596, 0.883), (597, 0.834), (598, 0.763), (599, 0.674), (600, 0.574), (601, 0.473), (602, 0.38), (603, 0.3), (604, 0.235), (605, 0.185), (606, 0.146), (607, 0.117), (608, 0.094), (609, 0.077), (610, 0.062), (611, 0.052), (612, 0.042), (613, 0.033), (614, 0.026), (615, 0.021), (616, 0.016), (617, 0.012), (618, 0.009), (619, 0.007), (620, 0.005), (621, 0.004), (622, 0.003), (623, 0.002), (624, 0.001)] responses['Red'] = [(619, 0.001), (620, 0.002), (621, 0.003), (622, 0.006), (623, 0.013), (624, 0.025), (625, 0.047), (626, 0.083), (627, 0.137), (628, 0.211), (629, 0.306), (630, 0.419), (631, 0.545), (632, 0.674), (633, 0.788), (634, 0.873), (635, 0.921), (636, 0.941), (637, 0.943), (638, 0.942), (639, 0.939), (640, 0.937), (641, 0.935), (642, 0.935), (643, 0.938), (644, 0.943), (645, 0.949), (646, 0.953), (647, 0.961), (648, 0.968), (649, 0.971), (650, 0.973), (651, 0.974), (652, 0.972), (653, 0.969), (654, 0.963), (655, 0.958), (656, 0.956), (657, 0.955), (658, 0.955), (659, 0.956), (660, 0.962), (661, 0.969), (662, 0.977), (663, 0.983), (664, 0.988), (665, 0.993), (666, 0.996), (667, 0.997), (668, 0.999), (669, 1.0), (670, 1.0), (671, 0.998), (672, 0.996), (673, 0.995), (674, 0.993), (675, 0.992), (676, 0.991), (677, 0.989), (678, 0.988), (679, 0.984), (680, 0.977), (681, 0.97), (682, 0.96), (683, 0.949), (684, 0.94), (685, 0.932), (686, 0.919), (687, 0.898), (688, 0.863), (689, 0.809), (690, 0.729), (691, 0.625), (692, 0.506), (693, 0.382), (694, 0.272), (695, 0.183), (696, 0.12), (697, 0.079), (698, 0.053), (699, 0.036), (700, 0.025), (701, 0.02), (702, 0.014), (703, 0.01), (704, 0.007)] responses['NIR'] = [(741, 0.001), (742, 0.002), (743, 0.002), (744, 0.003), (745, 0.004), (746, 0.003), (747, 0.003), (748, 0.002), (749, 0.002), (750, 0.001), (751, 0.014), (752, 0.018), (753, 0.022), (754, 0.027), (755, 0.032), (756, 0.038), (757, 0.047), (758, 0.056), (759, 0.069), (760, 0.069), (761, 0.083), (762, 0.099), (763, 0.121), (764, 0.146), (765, 0.175), (766, 0.209), (767, 0.248), (768, 0.294), (769, 0.346), (770, 0.402), (771, 0.463), (772, 0.523), (773, 0.588), (774, 0.649), (775, 0.705), (776, 0.757), (777, 0.797), (778, 0.827), (779, 0.853), (780, 0.871), (781, 0.884), (782, 0.892), (783, 0.899), (784, 0.903), (785, 0.908), (786, 0.911), (787, 0.916), (788, 0.92), (789, 0.925), (790, 0.926), (791, 0.927), (792, 0.927), (793, 0.929), (794, 0.932), (795, 0.93), (796, 0.926), (797, 0.926), (798, 0.925), (799, 0.928), (800, 0.925), (801, 0.926), (802, 0.928), (803, 0.928), (804, 0.928), (805, 0.923), (806, 0.92), (807, 0.919), (808, 0.914), (809, 0.91), (810, 0.908), (811, 0.905), (812, 0.903), (813, 0.904), (814, 0.902), (815, 0.909), (816, 0.917), (817, 0.92), (818, 0.928), (819, 0.938), (820, 0.946), (821, 0.953), (822, 0.962), (823, 0.969), (824, 0.971), (825, 0.971), (826, 0.97), (827, 0.969), (828, 0.969), (829, 0.97), (830, 0.967), (831, 0.969), (832, 0.968), (833, 0.963), (834, 0.965), (835, 0.967), (836, 0.965), (837, 0.963), (838, 0.958), (839, 0.95), (840, 0.949), (841, 0.943), (842, 0.933), (843, 0.929), (844, 0.928), (845, 0.925), (846, 0.924), (847, 0.927), (848, 0.932), (849, 0.934), (850, 0.943), (851, 0.952), (852, 0.956), (853, 0.966), (854, 0.977), (855, 0.985), (856, 0.99), (857, 0.992), (858, 0.993), (859, 0.994), (860, 0.998), (861, 0.996), (862, 0.992), (863, 0.991), (864, 0.992), (865, 0.994), (866, 0.993), (867, 0.997), (868, 0.997), (869, 0.996), (870, 0.998), (871, 0.999), (872, 1.0), (873, 0.999), (874, 0.996), (875, 0.991), (876, 0.99), (877, 0.991), (878, 0.985), (879, 0.978), (880, 0.969), (881, 0.955), (882, 0.937), (883, 0.916), (884, 0.892), (885, 0.868), (886, 0.845), (887, 0.824), (888, 0.811), (889, 0.807), (890, 0.819), (891, 0.841), (892, 0.868), (893, 0.892), (894, 0.892), (895, 0.854), (896, 0.77), (897, 0.644), (898, 0.501), (899, 0.365), (900, 0.256), (901, 0.177), (902, 0.122), (903, 0.085), (904, 0.061), (905, 0.044), (906, 0.032), (907, 0.025), (908, 0.019), (909, 0.014), (910, 0.011), (911, 0.011), (912, 0.008), (913, 0.006), (914, 0.005)] responses['SWIR-1'] = [(1508, 0.001), (1509, 0.001), (1510, 0.001), (1511, 0.007), (1512, 0.013), (1513, 0.01), (1514, 0.006), (1515, 0.012), (1516, 0.008), (1517, 0.003), (1518, 0.009), (1519, 0.015), (1520, 0.013), (1521, 0.012), (1522, 0.018), (1523, 0.024), (1524, 0.032), (1525, 0.04), (1526, 0.041), (1527, 0.049), (1528, 0.057), (1529, 0.067), (1530, 0.076), (1531, 0.087), (1532, 0.097), (1533, 0.109), (1534, 0.12), (1535, 0.148), (1536, 0.176), (1537, 0.196), (1538, 0.215), (1539, 0.244), (1540, 0.274), (1541, 0.306), (1542, 0.339), (1543, 0.393), (1544, 0.428), (1545, 0.462), (1546, 0.481), (1547, 0.499), (1548, 0.529), (1549, 0.558), (1550, 0.578), (1551, 0.598), (1552, 0.616), (1553, 0.634), (1554, 0.65), (1555, 0.667), (1556, 0.686), (1557, 0.704), (1558, 0.714), (1559, 0.724), (1560, 0.737), (1561, 0.75), (1562, 0.764), (1563, 0.778), (1564, 0.793), (1565, 0.808), (1566, 0.817), (1567, 0.825), (1568, 0.838), (1569, 0.851), (1570, 0.859), (1571, 0.867), (1572, 0.872), (1573, 0.878), (1574, 0.884), (1575, 0.893), (1576, 0.902), (1577, 0.901), (1578, 0.901), (1579, 0.899), (1580, 0.896), (1581, 0.896), (1582, 0.897), (1583, 0.893), (1584, 0.89), (1585, 0.895), (1586, 0.899), (1587, 0.891), (1588, 0.884), (1589, 0.88), (1590, 0.876), (1591, 0.872), (1592, 0.867), (1593, 0.87), (1594, 0.873), (1595, 0.873), (1596, 0.872), (1597, 0.875), (1598, 0.879), (1599, 0.877), (1600, 0.874), (1601, 0.868), (1602, 0.861), (1603, 0.86), (1604, 0.859), (1605, 0.868), (1606, 0.877), (1607, 0.878), (1608, 0.879), (1609, 0.889), (1610, 0.899), (1611, 0.897), (1612, 0.895), (1613, 0.893), (1614, 0.896), (1615, 0.9), (1616, 0.898), (1617, 0.897), (1618, 0.907), (1619, 0.917), (1620, 0.919), (1621, 0.921), (1622, 0.924), (1623, 0.926), (1624, 0.928), (1625, 0.929), (1626, 0.937), (1627, 0.945), (1628, 0.946), (1629, 0.947), (1630, 0.947), (1631, 0.948), (1632, 0.951), (1633, 0.955), (1634, 0.954), (1635, 0.952), (1636, 0.961), (1637, 0.969), (1638, 0.964), (1639, 0.96), (1640, 0.961), (1641, 0.962), (1642, 0.961), (1643, 0.959), (1644, 0.969), (1645, 0.978), (1646, 0.969), (1647, 0.96), (1648, 0.957), (1649, 0.955), (1650, 0.954), (1651, 0.952), (1652, 0.951), (1653, 0.951), (1654, 0.951), (1655, 0.952), (1656, 0.952), (1657, 0.954), (1658, 0.956), (1659, 0.95), (1660, 0.944), (1661, 0.939), (1662, 0.935), (1663, 0.934), (1664, 0.933), (1665, 0.931), (1666, 0.928), (1667, 0.935), (1668, 0.942), (1669, 0.945), (1670, 0.948), (1671, 0.945), (1672, 0.942), (1673, 0.938), (1674, 0.933), (1675, 0.939), (1676, 0.944), (1677, 0.946), (1678, 0.948), (1679, 0.947), (1680, 0.945), (1681, 0.944), (1682, 0.943), (1683, 0.947), (1684, 0.951), (1685, 0.955), (1686, 0.96), (1687, 0.964), (1688, 0.965), (1689, 0.967), (1690, 0.969), (1691, 0.971), (1692, 0.972), (1693, 0.974), (1694, 0.982), (1695, 0.991), (1696, 0.993), (1697, 0.995), (1698, 0.997), (1699, 0.999), (1700, 0.998), (1701, 0.996), (1702, 0.995), (1703, 0.994), (1704, 0.997), (1705, 1.0), (1706, 0.997), (1707, 0.994), (1708, 0.988), (1709, 0.983), (1710, 0.987), (1711, 0.99), (1712, 0.989), (1713, 0.988), (1714, 0.987), (1715, 0.989), (1716, 0.992), (1717, 0.989), (1718, 0.986), (1719, 0.984), (1720, 0.981), (1721, 0.982), (1722, 0.983), (1723, 0.979), (1724, 0.976), (1725, 0.978), (1726, 0.97), (1727, 0.969), (1728, 0.968), (1729, 0.964), (1730, 0.96), (1731, 0.952), (1732, 0.944), (1733, 0.933), (1734, 0.921), (1735, 0.902), (1736, 0.883), (1737, 0.864), (1738, 0.845), (1739, 0.818), (1740, 0.791), (1741, 0.751), (1742, 0.711), (1743, 0.674), (1744, 0.638), (1745, 0.608), (1746, 0.577), (1747, 0.547), (1748, 0.505), (1749, 0.462), (1750, 0.428), (1751, 0.393), (1752, 0.359), (1753, 0.325), (1754, 0.296), (1755, 0.267), (1756, 0.239), (1757, 0.212), (1758, 0.193), (1759, 0.175), (1760, 0.159), (1761, 0.142), (1762, 0.127), (1763, 0.111), (1764, 0.097), (1765, 0.084), (1766, 0.08), (1767, 0.077), (1768, 0.067), (1769, 0.058), (1770, 0.053), (1771, 0.049), (1772, 0.045), (1773, 0.042), (1774, 0.041), (1775, 0.039), (1776, 0.036), (1777, 0.034), (1778, 0.027), (1779, 0.02), (1780, 0.021), (1781, 0.021), (1782, 0.021), (1783, 0.022), (1784, 0.016), (1785, 0.011), (1786, 0.012), (1787, 0.012), (1788, 0.008), (1789, 0.004), (1790, 0.006), (1791, 0.008), (1792, 0.004)] responses['SWIR-2'] = [(2015, 0.002), (2016, 0.002), (2017, 0.002), (2018, 0.002), (2019, 0.007), (2020, 0.012), (2021, 0.01), (2022, 0.009), (2023, 0.008), (2024, 0.007), (2025, 0.009), (2026, 0.011), (2027, 0.015), (2028, 0.02), (2029, 0.019), (2030, 0.017), (2031, 0.023), (2032, 0.03), (2033, 0.032), (2034, 0.035), (2035, 0.037), (2036, 0.041), (2037, 0.044), (2038, 0.047), (2039, 0.051), (2040, 0.058), (2041, 0.065), (2042, 0.072), (2043, 0.08), (2044, 0.084), (2045, 0.088), (2046, 0.095), (2047, 0.102), (2048, 0.117), (2049, 0.133), (2050, 0.149), (2051, 0.165), (2052, 0.188), (2053, 0.204), (2054, 0.22), (2055, 0.242), (2056, 0.264), (2057, 0.29), (2058, 0.316), (2059, 0.342), (2060, 0.367), (2061, 0.394), (2062, 0.421), (2063, 0.452), (2064, 0.484), (2065, 0.519), (2066, 0.554), (2067, 0.59), (2068, 0.63), (2069, 0.67), (2070, 0.677), (2071, 0.683), (2072, 0.707), (2073, 0.73), (2074, 0.743), (2075, 0.756), (2076, 0.762), (2077, 0.767), (2078, 0.781), (2079, 0.794), (2080, 0.784), (2081, 0.774), (2082, 0.775), (2083, 0.776), (2084, 0.783), (2085, 0.789), (2086, 0.775), (2087, 0.78), (2088, 0.784), (2089, 0.781), (2090, 0.778), (2091, 0.773), (2092, 0.768), (2093, 0.765), (2094, 0.762), (2095, 0.762), (2096, 0.761), (2097, 0.766), (2098, 0.77), (2099, 0.775), (2100, 0.775), (2101, 0.77), (2102, 0.764), (2103, 0.774), (2104, 0.784), (2105, 0.788), (2106, 0.792), (2107, 0.803), (2108, 0.814), (2109, 0.804), (2110, 0.794), (2111, 0.809), (2112, 0.825), (2113, 0.821), (2114, 0.817), (2115, 0.811), (2116, 0.806), (2117, 0.819), (2118, 0.82), (2119, 0.821), (2120, 0.836), (2121, 0.852), (2122, 0.842), (2123, 0.832), (2124, 0.834), (2125, 0.836), (2126, 0.843), (2127, 0.85), (2128, 0.853), (2129, 0.855), (2130, 0.859), (2131, 0.862), (2132, 0.857), (2133, 0.853), (2134, 0.862), (2135, 0.871), (2136, 0.848), (2137, 0.865), (2138, 0.882), (2139, 0.878), (2140, 0.875), (2141, 0.868), (2142, 0.86), (2143, 0.858), (2144, 0.856), (2145, 0.872), (2146, 0.887), (2147, 0.868), (2148, 0.85), (2149, 0.861), (2150, 0.872), (2151, 0.879), (2152, 0.868), (2153, 0.857), (2154, 0.861), (2155, 0.865), (2156, 0.866), (2157, 0.867), (2158, 0.869), (2159, 0.871), (2160, 0.877), (2161, 0.882), (2162, 0.876), (2163, 0.87), (2164, 0.87), (2165, 0.869), (2166, 0.873), (2167, 0.875), (2168, 0.877), (2169, 0.872), (2170, 0.868), (2171, 0.874), (2172, 0.88), (2173, 0.878), (2174, 0.877), (2175, 0.873), (2176, 0.87), (2177, 0.874), (2178, 0.878), (2179, 0.879), (2180, 0.88), (2181, 0.874), (2182, 0.868), (2183, 0.881), (2184, 0.875), (2185, 0.87), (2186, 0.863), (2187, 0.856), (2188, 0.859), (2189, 0.863), (2190, 0.863), (2191, 0.863), (2192, 0.86), (2193, 0.857), (2194, 0.85), (2195, 0.844), (2196, 0.852), (2197, 0.859), (2198, 0.858), (2199, 0.857), (2200, 0.854), (2201, 0.852), (2202, 0.859), (2203, 0.866), (2204, 0.867), (2205, 0.868), (2206, 0.862), (2207, 0.856), (2208, 0.856), (2209, 0.856), (2210, 0.847), (2211, 0.854), (2212, 0.861), (2213, 0.862), (2214, 0.862), (2215, 0.851), (2216, 0.84), (2217, 0.848), (2218, 0.856), (2219, 0.847), (2220, 0.838), (2221, 0.847), (2222, 0.856), (2223, 0.837), (2224, 0.839), (2225, 0.84), (2226, 0.842), (2227, 0.826), (2228, 0.835), (2229, 0.844), (2230, 0.836), (2231, 0.827), (2232, 0.835), (2233, 0.842), (2234, 0.832), (2235, 0.822), (2236, 0.832), (2237, 0.843), (2238, 0.833), (2239, 0.823), (2240, 0.839), (2241, 0.854), (2242, 0.839), (2243, 0.846), (2244, 0.853), (2245, 0.854), (2246, 0.854), (2247, 0.859), (2248, 0.865), (2249, 0.869), (2250, 0.873), (2251, 0.871), (2252, 0.869), (2253, 0.867), (2254, 0.865), (2255, 0.879), (2256, 0.893), (2257, 0.891), (2258, 0.89), (2259, 0.89), (2260, 0.898), (2261, 0.906), (2262, 0.915), (2263, 0.924), (2264, 0.922), (2265, 0.92), (2266, 0.921), (2267, 0.922), (2268, 0.931), (2269, 0.939), (2270, 0.928), (2271, 0.916), (2272, 0.928), (2273, 0.94), (2274, 0.93), (2275, 0.936), (2276, 0.942), (2277, 0.949), (2278, 0.957), (2279, 0.956), (2280, 0.954), (2281, 0.952), (2282, 0.951), (2283, 0.952), (2284, 0.954), (2285, 0.96), (2286, 0.966), (2287, 0.97), (2288, 0.975), (2289, 0.98), (2290, 0.985), (2291, 0.978), (2292, 0.971), (2293, 0.973), (2294, 0.972), (2295, 0.97), (2296, 0.982), (2297, 0.993), (2298, 0.994), (2299, 0.996), (2300, 0.989), (2301, 0.983), (2302, 0.977), (2303, 0.972), (2304, 0.986), (2305, 1.0), (2306, 0.999), (2307, 0.998), (2308, 0.985), (2309, 0.971), (2310, 0.968), (2311, 0.967), (2312, 0.967), (2313, 0.965), (2314, 0.962), (2315, 0.956), (2316, 0.949), (2317, 0.936), (2318, 0.923), (2319, 0.926), (2320, 0.929), (2321, 0.923), (2322, 0.917), (2323, 0.934), (2324, 0.919), (2325, 0.903), (2326, 0.914), (2327, 0.926), (2328, 0.921), (2329, 0.916), (2330, 0.929), (2331, 0.942), (2332, 0.933), (2333, 0.924), (2334, 0.922), (2335, 0.92), (2336, 0.891), (2337, 0.863), (2338, 0.844), (2339, 0.824), (2340, 0.775), (2341, 0.729), (2342, 0.684), (2343, 0.633), (2344, 0.583), (2345, 0.531), (2346, 0.48), (2347, 0.429), (2348, 0.378), (2349, 0.326), (2350, 0.275), (2351, 0.254), (2352, 0.233), (2353, 0.202), (2354, 0.171), (2355, 0.131), (2356, 0.121), (2357, 0.111), (2358, 0.096), (2359, 0.081), (2360, 0.075), (2361, 0.069), (2362, 0.057), (2363, 0.046), (2364, 0.038), (2365, 0.029), (2366, 0.034), (2367, 0.038), (2368, 0.018), (2369, 0.0), (2370, 0.013), (2371, 0.029), (2372, 0.023), (2373, 0.016), (2374, 0.009), (2375, 0.013), (2376, 0.017), (2377, 0.01), (2378, 0.003), (2379, 0.009), (2380, 0.015), (2381, 0.007)] # responses['Pan'] = [(502, 0.001), (503, 0.005), (504, 0.008), (505, 0.018), (506, 0.027), (507, 0.046), (508, 0.066), (509, 0.108), (510, 0.15), (511, 0.22), (512, 0.289), (513, 0.368), (514, 0.447), (515, 0.502), (516, 0.556), (517, 0.575), (518, 0.594), (519, 0.596), (520, 0.599), (521, 0.6), (522, 0.6), (523, 0.604), (524, 0.607), (525, 0.609), (526, 0.612), (527, 0.613), (528, 0.615), (529, 0.613), (530, 0.61), (531, 0.607), (532, 0.604), (533, 0.603), (534, 0.602), (535, 0.604), (536, 0.605), (537, 0.61), (538, 0.614), (539, 0.62), (540, 0.627), (541, 0.632), (542, 0.637), (543, 0.64), (544, 0.643), (545, 0.645), (546, 0.646), (547, 0.645), (548, 0.643), (549, 0.638), (550, 0.632), (551, 0.63), (552, 0.627), (553, 0.625), (554, 0.623), (555, 0.625), (556, 0.626), (557, 0.63), (558, 0.634), (559, 0.638), (560, 0.642), (561, 0.648), (562, 0.655), (563, 0.663), (564, 0.672), (565, 0.678), (566, 0.683), (567, 0.688), (568, 0.692), (569, 0.694), (570, 0.697), (571, 0.699), (572, 0.7), (573, 0.701), (574, 0.702), (575, 0.705), (576, 0.708), (577, 0.71), (578, 0.712), (579, 0.712), (580, 0.713), (581, 0.715), (582, 0.716), (583, 0.717), (584, 0.718), (585, 0.718), (586, 0.718), (587, 0.714), (588, 0.71), (589, 0.709), (590, 0.707), (591, 0.706), (592, 0.705), (593, 0.703), (594, 0.701), (595, 0.703), (596, 0.705), (597, 0.711), (598, 0.718), (599, 0.724), (600, 0.73), (601, 0.736), (602, 0.742), (603, 0.746), (604, 0.75), (605, 0.753), (606, 0.757), (607, 0.76), (608, 0.763), (609, 0.763), (610, 0.764), (611, 0.76), (612, 0.755), (613, 0.752), (614, 0.748), (615, 0.745), (616, 0.742), (617, 0.737), (618, 0.733), (619, 0.731), (620, 0.729), (621, 0.729), (622, 0.728), (623, 0.729), (624, 0.73), (625, 0.731), (626, 0.732), (627, 0.732), (628, 0.733), (629, 0.734), (630, 0.734), (631, 0.738), (632, 0.742), (633, 0.745), (634, 0.748), (635, 0.75), (636, 0.751), (637, 0.753), (638, 0.755), (639, 0.757), (640, 0.758), (641, 0.759), (642, 0.76), (643, 0.763), (644, 0.767), (645, 0.768), (646, 0.769), (647, 0.771), (648, 0.773), (649, 0.776), (650, 0.779), (651, 0.78), (652, 0.781), (653, 0.782), (654, 0.783), (655, 0.785), (656, 0.787), (657, 0.789), (658, 0.791), (659, 0.792), (660, 0.793), (661, 0.793), (662, 0.792), (663, 0.791), (664, 0.791), (665, 0.791), (666, 0.792), (667, 0.794), (668, 0.796), (669, 0.797), (670, 0.798), (671, 0.799), (672, 0.801), (673, 0.803), (674, 0.804), (675, 0.806), (676, 0.808), (677, 0.812), (678, 0.815), (679, 0.817), (680, 0.82), (681, 0.824), (682, 0.827), (683, 0.828), (684, 0.829), (685, 0.831), (686, 0.834), (687, 0.836), (688, 0.838), (689, 0.84), (690, 0.842), (691, 0.845), (692, 0.847), (693, 0.85), (694, 0.853), (695, 0.854), (696, 0.856), (697, 0.859), (698, 0.862), (699, 0.865), (700, 0.868), (701, 0.869), (702, 0.871), (703, 0.873), (704, 0.876), (705, 0.88), (706, 0.883), (707, 0.885), (708, 0.886), (709, 0.889), (710, 0.892), (711, 0.893), (712, 0.894), (713, 0.895), (714, 0.896), (715, 0.896), (716, 0.896), (717, 0.895), (718, 0.894), (719, 0.894), (720, 0.894), (721, 0.894), (722, 0.894), (723, 0.895), (724, 0.895), (725, 0.896), (726, 0.896), (727, 0.897), (728, 0.898), (729, 0.899), (730, 0.9), (731, 0.901), (732, 0.903), (733, 0.903), (734, 0.904), (735, 0.903), (736, 0.903), (737, 0.903), (738, 0.902), (739, 0.901), (740, 0.9), (741, 0.898), (742, 0.897), (743, 0.896), (744, 0.896), (745, 0.893), (746, 0.891), (747, 0.885), (748, 0.88), (749, 0.88), (750, 0.879), (751, 0.88), (752, 0.88), (753, 0.877), (754, 0.873), (755, 0.873), (756, 0.873), (757, 0.875), (758, 0.877), (759, 0.878), (760, 0.88), (761, 0.88), (762, 0.88), (763, 0.882), (764, 0.885), (765, 0.887), (766, 0.888), (767, 0.89), (768, 0.892), (769, 0.893), (770, 0.893), (771, 0.898), (772, 0.902), (773, 0.905), (774, 0.908), (775, 0.91), (776, 0.913), (777, 0.916), (778, 0.92), (779, 0.92), (780, 0.92), (781, 0.919), (782, 0.918), (783, 0.917), (784, 0.916), (785, 0.916), (786, 0.916), (787, 0.918), (788, 0.919), (789, 0.919), (790, 0.918), (791, 0.918), (792, 0.917), (793, 0.916), (794, 0.916), (795, 0.916), (796, 0.915), (797, 0.916), (798, 0.918), (799, 0.923), (800, 0.927), (801, 0.928), (802, 0.928), (803, 0.93), (804, 0.932), (805, 0.938), (806, 0.943), (807, 0.947), (808, 0.952), (809, 0.955), (810, 0.957), (811, 0.96), (812, 0.962), (813, 0.965), (814, 0.969), (815, 0.97), (816, 0.97), (817, 0.971), (818, 0.972), (819, 0.975), (820, 0.977), (821, 0.978), (822, 0.979), (823, 0.98), (824, 0.981), (825, 0.984), (826, 0.987), (827, 0.989), (828, 0.992), (829, 0.994), (830, 0.997), (831, 0.998), (832, 0.998), (833, 0.999), (834, 1.0), (835, 0.998), (836, 0.996), (837, 0.995), (838, 0.995), (839, 0.995), (840, 0.994), (841, 0.993), (842, 0.992), (843, 0.992), (844, 0.992), (845, 0.993), (846, 0.994), (847, 0.993), (848, 0.992), (849, 0.989), (850, 0.987), (851, 0.982), (852, 0.978), (853, 0.973), (854, 0.968), (855, 0.965), (856, 0.962), (857, 0.96), (858, 0.957), (859, 0.953), (860, 0.949), (861, 0.943), (862, 0.937), (863, 0.933), (864, 0.928), (865, 0.924), (866, 0.92), (867, 0.916), (868, 0.911), (869, 0.909), (870, 0.907), (871, 0.906), (872, 0.905), (873, 0.905), (874, 0.906), (875, 0.909), (876, 0.911), (877, 0.916), (878, 0.922), (879, 0.931), (880, 0.94), (881, 0.951), (882, 0.962), (883, 0.97), (884, 0.977), (885, 0.978), (886, 0.979), (887, 0.968), (888, 0.957), (889, 0.926), (890, 0.895), (891, 0.841), (892, 0.787), (893, 0.717), (894, 0.647), (895, 0.572), (896, 0.496), (897, 0.429), (898, 0.363), (899, 0.31), (900, 0.258), (901, 0.219), (902, 0.181), (903, 0.154), (904, 0.127), (905, 0.108), (906, 0.089), (907, 0.075), (908, 0.062), (909, 0.053), (910, 0.044)]
- Save spectral response function [boolean]
Whether to save the spectral response function library as *.srf.gpkg sidecar file.
Default: False
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpectralResamplingToLandsat7Etm
:
----------------
Arguments
----------------
raster: Spectral raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
response: Spectral response function
Default value: from collections import OrderedDict
responses = OrderedDict()
responses['Blue'] = [(435, 0.016), (436, 0.027), (437, 0.048), (438, 0.094), (439, 0.167), (440, 0.287),
(441, 0.459), (442, 0.605), (443, 0.728), (444, 0.769), (445, 0.792), (446, 0.821),
(447, 0.857), (448, 0.857), (449, 0.862), (450, 0.839), (451, 0.845), (452, 0.81),
(453, 0.802), (454, 0.804), (455, 0.779), (456, 0.798), (457, 0.816), (458, 0.876),
(459, 0.888), (460, 0.901), (461, 0.918), (462, 0.896), (463, 0.903), (464, 0.888),
(465, 0.89), (466, 0.863), (467, 0.86), (468, 0.842), (469, 0.866), (470, 0.875),
(471, 0.881), (472, 0.888), (473, 0.898), (474, 0.879), (475, 0.884), (476, 0.907),
(477, 0.928), (478, 0.932), (479, 0.955), (480, 0.958), (481, 0.948), (482, 0.952),
(483, 0.956), (484, 0.98), (485, 0.98), (486, 0.975), (487, 0.973), (488, 0.977),
(489, 0.958), (490, 0.965), (491, 0.957), (492, 0.952), (493, 0.973), (494, 0.974),
(495, 0.995), (496, 0.986), (497, 0.986), (498, 0.994), (499, 1.0), (500, 0.99),
(501, 0.99), (502, 0.976), (503, 0.983), (504, 0.976), (505, 0.983), (506, 0.96),
(507, 0.973), (508, 0.964), (509, 0.975), (510, 0.96), (511, 0.932), (512, 0.853),
(513, 0.684), (514, 0.486), (515, 0.293), (516, 0.15), (517, 0.073), (518, 0.036),
(519, 0.019), (520, 0.009)]
responses['Green'] = [(502, 0.001), (503, 0.002), (504, 0.002), (505, 0.003), (506, 0.005), (507, 0.009),
(508, 0.014), (509, 0.024), (510, 0.026), (511, 0.041), (512, 0.06), (513, 0.088),
(514, 0.126), (515, 0.174), (516, 0.236), (517, 0.308), (518, 0.388), (519, 0.472),
(520, 0.552), (521, 0.621), (522, 0.676), (523, 0.716), (524, 0.743), (525, 0.759),
(526, 0.769), (527, 0.779), (528, 0.79), (529, 0.805), (530, 0.822), (531, 0.842),
(532, 0.861), (533, 0.878), (534, 0.893), (535, 0.905), (536, 0.916), (537, 0.924),
(538, 0.933), (539, 0.942), (540, 0.947), (541, 0.951), (542, 0.953), (543, 0.952),
(544, 0.951), (545, 0.952), (546, 0.951), (547, 0.951), (548, 0.952), (549, 0.952),
(550, 0.953), (551, 0.951), (552, 0.95), (553, 0.95), (554, 0.951), (555, 0.954),
(556, 0.96), (557, 0.966), (558, 0.968), (559, 0.965), (560, 0.959), (561, 0.951),
(562, 0.944), (563, 0.937), (564, 0.932), (565, 0.933), (566, 0.935), (567, 0.937),
(568, 0.94), (569, 0.945), (570, 0.951), (571, 0.955), (572, 0.957), (573, 0.956),
(574, 0.957), (575, 0.955), (576, 0.952), (577, 0.954), (578, 0.958), (579, 0.963),
(580, 0.973), (581, 0.981), (582, 0.988), (583, 0.995), (584, 1.0), (585, 1.0),
(586, 0.994), (587, 0.983), (588, 0.969), (589, 0.954), (590, 0.942), (591, 0.936),
(592, 0.932), (593, 0.928), (594, 0.924), (595, 0.912), (596, 0.883), (597, 0.834),
(598, 0.763), (599, 0.674), (600, 0.574), (601, 0.473), (602, 0.38), (603, 0.3),
(604, 0.235), (605, 0.185), (606, 0.146), (607, 0.117), (608, 0.094), (609, 0.077),
(610, 0.062), (611, 0.052), (612, 0.042), (613, 0.033), (614, 0.026), (615, 0.021),
(616, 0.016), (617, 0.012), (618, 0.009), (619, 0.007), (620, 0.005), (621, 0.004),
(622, 0.003), (623, 0.002), (624, 0.001)]
responses['Red'] = [(619, 0.001), (620, 0.002), (621, 0.003), (622, 0.006), (623, 0.013), (624, 0.025),
(625, 0.047), (626, 0.083), (627, 0.137), (628, 0.211), (629, 0.306), (630, 0.419),
(631, 0.545), (632, 0.674), (633, 0.788), (634, 0.873), (635, 0.921), (636, 0.941),
(637, 0.943), (638, 0.942), (639, 0.939), (640, 0.937), (641, 0.935), (642, 0.935),
(643, 0.938), (644, 0.943), (645, 0.949), (646, 0.953), (647, 0.961), (648, 0.968),
(649, 0.971), (650, 0.973), (651, 0.974), (652, 0.972), (653, 0.969), (654, 0.963),
(655, 0.958), (656, 0.956), (657, 0.955), (658, 0.955), (659, 0.956), (660, 0.962),
(661, 0.969), (662, 0.977), (663, 0.983), (664, 0.988), (665, 0.993), (666, 0.996),
(667, 0.997), (668, 0.999), (669, 1.0), (670, 1.0), (671, 0.998), (672, 0.996),
(673, 0.995), (674, 0.993), (675, 0.992), (676, 0.991), (677, 0.989), (678, 0.988),
(679, 0.984), (680, 0.977), (681, 0.97), (682, 0.96), (683, 0.949), (684, 0.94),
(685, 0.932), (686, 0.919), (687, 0.898), (688, 0.863), (689, 0.809), (690, 0.729),
(691, 0.625), (692, 0.506), (693, 0.382), (694, 0.272), (695, 0.183), (696, 0.12),
(697, 0.079), (698, 0.053), (699, 0.036), (700, 0.025), (701, 0.02), (702, 0.014),
(703, 0.01), (704, 0.007)]
responses['NIR'] = [(741, 0.001), (742, 0.002), (743, 0.002), (744, 0.003), (745, 0.004), (746, 0.003),
(747, 0.003), (748, 0.002), (749, 0.002), (750, 0.001), (751, 0.014), (752, 0.018),
(753, 0.022), (754, 0.027), (755, 0.032), (756, 0.038), (757, 0.047), (758, 0.056),
(759, 0.069), (760, 0.069), (761, 0.083), (762, 0.099), (763, 0.121), (764, 0.146),
(765, 0.175), (766, 0.209), (767, 0.248), (768, 0.294), (769, 0.346), (770, 0.402),
(771, 0.463), (772, 0.523), (773, 0.588), (774, 0.649), (775, 0.705), (776, 0.757),
(777, 0.797), (778, 0.827), (779, 0.853), (780, 0.871), (781, 0.884), (782, 0.892),
(783, 0.899), (784, 0.903), (785, 0.908), (786, 0.911), (787, 0.916), (788, 0.92),
(789, 0.925), (790, 0.926), (791, 0.927), (792, 0.927), (793, 0.929), (794, 0.932),
(795, 0.93), (796, 0.926), (797, 0.926), (798, 0.925), (799, 0.928), (800, 0.925),
(801, 0.926), (802, 0.928), (803, 0.928), (804, 0.928), (805, 0.923), (806, 0.92),
(807, 0.919), (808, 0.914), (809, 0.91), (810, 0.908), (811, 0.905), (812, 0.903),
(813, 0.904), (814, 0.902), (815, 0.909), (816, 0.917), (817, 0.92), (818, 0.928),
(819, 0.938), (820, 0.946), (821, 0.953), (822, 0.962), (823, 0.969), (824, 0.971),
(825, 0.971), (826, 0.97), (827, 0.969), (828, 0.969), (829, 0.97), (830, 0.967),
(831, 0.969), (832, 0.968), (833, 0.963), (834, 0.965), (835, 0.967), (836, 0.965),
(837, 0.963), (838, 0.958), (839, 0.95), (840, 0.949), (841, 0.943), (842, 0.933),
(843, 0.929), (844, 0.928), (845, 0.925), (846, 0.924), (847, 0.927), (848, 0.932),
(849, 0.934), (850, 0.943), (851, 0.952), (852, 0.956), (853, 0.966), (854, 0.977),
(855, 0.985), (856, 0.99), (857, 0.992), (858, 0.993), (859, 0.994), (860, 0.998),
(861, 0.996), (862, 0.992), (863, 0.991), (864, 0.992), (865, 0.994), (866, 0.993),
(867, 0.997), (868, 0.997), (869, 0.996), (870, 0.998), (871, 0.999), (872, 1.0),
(873, 0.999), (874, 0.996), (875, 0.991), (876, 0.99), (877, 0.991), (878, 0.985),
(879, 0.978), (880, 0.969), (881, 0.955), (882, 0.937), (883, 0.916), (884, 0.892),
(885, 0.868), (886, 0.845), (887, 0.824), (888, 0.811), (889, 0.807), (890, 0.819),
(891, 0.841), (892, 0.868), (893, 0.892), (894, 0.892), (895, 0.854), (896, 0.77),
(897, 0.644), (898, 0.501), (899, 0.365), (900, 0.256), (901, 0.177), (902, 0.122),
(903, 0.085), (904, 0.061), (905, 0.044), (906, 0.032), (907, 0.025), (908, 0.019),
(909, 0.014), (910, 0.011), (911, 0.011), (912, 0.008), (913, 0.006), (914, 0.005)]
responses['SWIR-1'] = [(1508, 0.001), (1509, 0.001), (1510, 0.001), (1511, 0.007), (1512, 0.013), (1513, 0.01),
(1514, 0.006), (1515, 0.012), (1516, 0.008), (1517, 0.003), (1518, 0.009), (1519, 0.015),
(1520, 0.013), (1521, 0.012), (1522, 0.018), (1523, 0.024), (1524, 0.032), (1525, 0.04),
(1526, 0.041), (1527, 0.049), (1528, 0.057), (1529, 0.067), (1530, 0.076), (1531, 0.087),
(1532, 0.097), (1533, 0.109), (1534, 0.12), (1535, 0.148), (1536, 0.176), (1537, 0.196),
(1538, 0.215), (1539, 0.244), (1540, 0.274), (1541, 0.306), (1542, 0.339), (1543, 0.393),
(1544, 0.428), (1545, 0.462), (1546, 0.481), (1547, 0.499), (1548, 0.529), (1549, 0.558),
(1550, 0.578), (1551, 0.598), (1552, 0.616), (1553, 0.634), (1554, 0.65), (1555, 0.667),
(1556, 0.686), (1557, 0.704), (1558, 0.714), (1559, 0.724), (1560, 0.737), (1561, 0.75),
(1562, 0.764), (1563, 0.778), (1564, 0.793), (1565, 0.808), (1566, 0.817), (1567, 0.825),
(1568, 0.838), (1569, 0.851), (1570, 0.859), (1571, 0.867), (1572, 0.872), (1573, 0.878),
(1574, 0.884), (1575, 0.893), (1576, 0.902), (1577, 0.901), (1578, 0.901), (1579, 0.899),
(1580, 0.896), (1581, 0.896), (1582, 0.897), (1583, 0.893), (1584, 0.89), (1585, 0.895),
(1586, 0.899), (1587, 0.891), (1588, 0.884), (1589, 0.88), (1590, 0.876), (1591, 0.872),
(1592, 0.867), (1593, 0.87), (1594, 0.873), (1595, 0.873), (1596, 0.872), (1597, 0.875),
(1598, 0.879), (1599, 0.877), (1600, 0.874), (1601, 0.868), (1602, 0.861), (1603, 0.86),
(1604, 0.859), (1605, 0.868), (1606, 0.877), (1607, 0.878), (1608, 0.879), (1609, 0.889),
(1610, 0.899), (1611, 0.897), (1612, 0.895), (1613, 0.893), (1614, 0.896), (1615, 0.9),
(1616, 0.898), (1617, 0.897), (1618, 0.907), (1619, 0.917), (1620, 0.919), (1621, 0.921),
(1622, 0.924), (1623, 0.926), (1624, 0.928), (1625, 0.929), (1626, 0.937), (1627, 0.945),
(1628, 0.946), (1629, 0.947), (1630, 0.947), (1631, 0.948), (1632, 0.951), (1633, 0.955),
(1634, 0.954), (1635, 0.952), (1636, 0.961), (1637, 0.969), (1638, 0.964), (1639, 0.96),
(1640, 0.961), (1641, 0.962), (1642, 0.961), (1643, 0.959), (1644, 0.969), (1645, 0.978),
(1646, 0.969), (1647, 0.96), (1648, 0.957), (1649, 0.955), (1650, 0.954), (1651, 0.952),
(1652, 0.951), (1653, 0.951), (1654, 0.951), (1655, 0.952), (1656, 0.952), (1657, 0.954),
(1658, 0.956), (1659, 0.95), (1660, 0.944), (1661, 0.939), (1662, 0.935), (1663, 0.934),
(1664, 0.933), (1665, 0.931), (1666, 0.928), (1667, 0.935), (1668, 0.942), (1669, 0.945),
(1670, 0.948), (1671, 0.945), (1672, 0.942), (1673, 0.938), (1674, 0.933), (1675, 0.939),
(1676, 0.944), (1677, 0.946), (1678, 0.948), (1679, 0.947), (1680, 0.945), (1681, 0.944),
(1682, 0.943), (1683, 0.947), (1684, 0.951), (1685, 0.955), (1686, 0.96), (1687, 0.964),
(1688, 0.965), (1689, 0.967), (1690, 0.969), (1691, 0.971), (1692, 0.972), (1693, 0.974),
(1694, 0.982), (1695, 0.991), (1696, 0.993), (1697, 0.995), (1698, 0.997), (1699, 0.999),
(1700, 0.998), (1701, 0.996), (1702, 0.995), (1703, 0.994), (1704, 0.997), (1705, 1.0),
(1706, 0.997), (1707, 0.994), (1708, 0.988), (1709, 0.983), (1710, 0.987), (1711, 0.99),
(1712, 0.989), (1713, 0.988), (1714, 0.987), (1715, 0.989), (1716, 0.992), (1717, 0.989),
(1718, 0.986), (1719, 0.984), (1720, 0.981), (1721, 0.982), (1722, 0.983), (1723, 0.979),
(1724, 0.976), (1725, 0.978), (1726, 0.97), (1727, 0.969), (1728, 0.968), (1729, 0.964),
(1730, 0.96), (1731, 0.952), (1732, 0.944), (1733, 0.933), (1734, 0.921), (1735, 0.902),
(1736, 0.883), (1737, 0.864), (1738, 0.845), (1739, 0.818), (1740, 0.791), (1741, 0.751),
(1742, 0.711), (1743, 0.674), (1744, 0.638), (1745, 0.608), (1746, 0.577), (1747, 0.547),
(1748, 0.505), (1749, 0.462), (1750, 0.428), (1751, 0.393), (1752, 0.359), (1753, 0.325),
(1754, 0.296), (1755, 0.267), (1756, 0.239), (1757, 0.212), (1758, 0.193), (1759, 0.175),
(1760, 0.159), (1761, 0.142), (1762, 0.127), (1763, 0.111), (1764, 0.097), (1765, 0.084),
(1766, 0.08), (1767, 0.077), (1768, 0.067), (1769, 0.058), (1770, 0.053), (1771, 0.049),
(1772, 0.045), (1773, 0.042), (1774, 0.041), (1775, 0.039), (1776, 0.036), (1777, 0.034),
(1778, 0.027), (1779, 0.02), (1780, 0.021), (1781, 0.021), (1782, 0.021), (1783, 0.022),
(1784, 0.016), (1785, 0.011), (1786, 0.012), (1787, 0.012), (1788, 0.008), (1789, 0.004),
(1790, 0.006), (1791, 0.008), (1792, 0.004)]
responses['SWIR-2'] = [(2015, 0.002), (2016, 0.002), (2017, 0.002), (2018, 0.002), (2019, 0.007), (2020, 0.012),
(2021, 0.01), (2022, 0.009), (2023, 0.008), (2024, 0.007), (2025, 0.009), (2026, 0.011),
(2027, 0.015), (2028, 0.02), (2029, 0.019), (2030, 0.017), (2031, 0.023), (2032, 0.03),
(2033, 0.032), (2034, 0.035), (2035, 0.037), (2036, 0.041), (2037, 0.044), (2038, 0.047),
(2039, 0.051), (2040, 0.058), (2041, 0.065), (2042, 0.072), (2043, 0.08), (2044, 0.084),
(2045, 0.088), (2046, 0.095), (2047, 0.102), (2048, 0.117), (2049, 0.133), (2050, 0.149),
(2051, 0.165), (2052, 0.188), (2053, 0.204), (2054, 0.22), (2055, 0.242), (2056, 0.264),
(2057, 0.29), (2058, 0.316), (2059, 0.342), (2060, 0.367), (2061, 0.394), (2062, 0.421),
(2063, 0.452), (2064, 0.484), (2065, 0.519), (2066, 0.554), (2067, 0.59), (2068, 0.63),
(2069, 0.67), (2070, 0.677), (2071, 0.683), (2072, 0.707), (2073, 0.73), (2074, 0.743),
(2075, 0.756), (2076, 0.762), (2077, 0.767), (2078, 0.781), (2079, 0.794), (2080, 0.784),
(2081, 0.774), (2082, 0.775), (2083, 0.776), (2084, 0.783), (2085, 0.789), (2086, 0.775),
(2087, 0.78), (2088, 0.784), (2089, 0.781), (2090, 0.778), (2091, 0.773), (2092, 0.768),
(2093, 0.765), (2094, 0.762), (2095, 0.762), (2096, 0.761), (2097, 0.766), (2098, 0.77),
(2099, 0.775), (2100, 0.775), (2101, 0.77), (2102, 0.764), (2103, 0.774), (2104, 0.784),
(2105, 0.788), (2106, 0.792), (2107, 0.803), (2108, 0.814), (2109, 0.804), (2110, 0.794),
(2111, 0.809), (2112, 0.825), (2113, 0.821), (2114, 0.817), (2115, 0.811), (2116, 0.806),
(2117, 0.819), (2118, 0.82), (2119, 0.821), (2120, 0.836), (2121, 0.852), (2122, 0.842),
(2123, 0.832), (2124, 0.834), (2125, 0.836), (2126, 0.843), (2127, 0.85), (2128, 0.853),
(2129, 0.855), (2130, 0.859), (2131, 0.862), (2132, 0.857), (2133, 0.853), (2134, 0.862),
(2135, 0.871), (2136, 0.848), (2137, 0.865), (2138, 0.882), (2139, 0.878), (2140, 0.875),
(2141, 0.868), (2142, 0.86), (2143, 0.858), (2144, 0.856), (2145, 0.872), (2146, 0.887),
(2147, 0.868), (2148, 0.85), (2149, 0.861), (2150, 0.872), (2151, 0.879), (2152, 0.868),
(2153, 0.857), (2154, 0.861), (2155, 0.865), (2156, 0.866), (2157, 0.867), (2158, 0.869),
(2159, 0.871), (2160, 0.877), (2161, 0.882), (2162, 0.876), (2163, 0.87), (2164, 0.87),
(2165, 0.869), (2166, 0.873), (2167, 0.875), (2168, 0.877), (2169, 0.872), (2170, 0.868),
(2171, 0.874), (2172, 0.88), (2173, 0.878), (2174, 0.877), (2175, 0.873), (2176, 0.87),
(2177, 0.874), (2178, 0.878), (2179, 0.879), (2180, 0.88), (2181, 0.874), (2182, 0.868),
(2183, 0.881), (2184, 0.875), (2185, 0.87), (2186, 0.863), (2187, 0.856), (2188, 0.859),
(2189, 0.863), (2190, 0.863), (2191, 0.863), (2192, 0.86), (2193, 0.857), (2194, 0.85),
(2195, 0.844), (2196, 0.852), (2197, 0.859), (2198, 0.858), (2199, 0.857), (2200, 0.854),
(2201, 0.852), (2202, 0.859), (2203, 0.866), (2204, 0.867), (2205, 0.868), (2206, 0.862),
(2207, 0.856), (2208, 0.856), (2209, 0.856), (2210, 0.847), (2211, 0.854), (2212, 0.861),
(2213, 0.862), (2214, 0.862), (2215, 0.851), (2216, 0.84), (2217, 0.848), (2218, 0.856),
(2219, 0.847), (2220, 0.838), (2221, 0.847), (2222, 0.856), (2223, 0.837), (2224, 0.839),
(2225, 0.84), (2226, 0.842), (2227, 0.826), (2228, 0.835), (2229, 0.844), (2230, 0.836),
(2231, 0.827), (2232, 0.835), (2233, 0.842), (2234, 0.832), (2235, 0.822), (2236, 0.832),
(2237, 0.843), (2238, 0.833), (2239, 0.823), (2240, 0.839), (2241, 0.854), (2242, 0.839),
(2243, 0.846), (2244, 0.853), (2245, 0.854), (2246, 0.854), (2247, 0.859), (2248, 0.865),
(2249, 0.869), (2250, 0.873), (2251, 0.871), (2252, 0.869), (2253, 0.867), (2254, 0.865),
(2255, 0.879), (2256, 0.893), (2257, 0.891), (2258, 0.89), (2259, 0.89), (2260, 0.898),
(2261, 0.906), (2262, 0.915), (2263, 0.924), (2264, 0.922), (2265, 0.92), (2266, 0.921),
(2267, 0.922), (2268, 0.931), (2269, 0.939), (2270, 0.928), (2271, 0.916), (2272, 0.928),
(2273, 0.94), (2274, 0.93), (2275, 0.936), (2276, 0.942), (2277, 0.949), (2278, 0.957),
(2279, 0.956), (2280, 0.954), (2281, 0.952), (2282, 0.951), (2283, 0.952), (2284, 0.954),
(2285, 0.96), (2286, 0.966), (2287, 0.97), (2288, 0.975), (2289, 0.98), (2290, 0.985),
(2291, 0.978), (2292, 0.971), (2293, 0.973), (2294, 0.972), (2295, 0.97), (2296, 0.982),
(2297, 0.993), (2298, 0.994), (2299, 0.996), (2300, 0.989), (2301, 0.983), (2302, 0.977),
(2303, 0.972), (2304, 0.986), (2305, 1.0), (2306, 0.999), (2307, 0.998), (2308, 0.985),
(2309, 0.971), (2310, 0.968), (2311, 0.967), (2312, 0.967), (2313, 0.965), (2314, 0.962),
(2315, 0.956), (2316, 0.949), (2317, 0.936), (2318, 0.923), (2319, 0.926), (2320, 0.929),
(2321, 0.923), (2322, 0.917), (2323, 0.934), (2324, 0.919), (2325, 0.903), (2326, 0.914),
(2327, 0.926), (2328, 0.921), (2329, 0.916), (2330, 0.929), (2331, 0.942), (2332, 0.933),
(2333, 0.924), (2334, 0.922), (2335, 0.92), (2336, 0.891), (2337, 0.863), (2338, 0.844),
(2339, 0.824), (2340, 0.775), (2341, 0.729), (2342, 0.684), (2343, 0.633), (2344, 0.583),
(2345, 0.531), (2346, 0.48), (2347, 0.429), (2348, 0.378), (2349, 0.326), (2350, 0.275),
(2351, 0.254), (2352, 0.233), (2353, 0.202), (2354, 0.171), (2355, 0.131), (2356, 0.121),
(2357, 0.111), (2358, 0.096), (2359, 0.081), (2360, 0.075), (2361, 0.069), (2362, 0.057),
(2363, 0.046), (2364, 0.038), (2365, 0.029), (2366, 0.034), (2367, 0.038), (2368, 0.018),
(2369, 0.0), (2370, 0.013), (2371, 0.029), (2372, 0.023), (2373, 0.016), (2374, 0.009),
(2375, 0.013), (2376, 0.017), (2377, 0.01), (2378, 0.003), (2379, 0.009), (2380, 0.015),
(2381, 0.007)]
# responses['Pan'] = [(502, 0.001), (503, 0.005), (504, 0.008), (505, 0.018), (506, 0.027), (507, 0.046), (508, 0.066), (509, 0.108), (510, 0.15), (511, 0.22), (512, 0.289), (513, 0.368), (514, 0.447), (515, 0.502), (516, 0.556), (517, 0.575), (518, 0.594), (519, 0.596), (520, 0.599), (521, 0.6), (522, 0.6), (523, 0.604), (524, 0.607), (525, 0.609), (526, 0.612), (527, 0.613), (528, 0.615), (529, 0.613), (530, 0.61), (531, 0.607), (532, 0.604), (533, 0.603), (534, 0.602), (535, 0.604), (536, 0.605), (537, 0.61), (538, 0.614), (539, 0.62), (540, 0.627), (541, 0.632), (542, 0.637), (543, 0.64), (544, 0.643), (545, 0.645), (546, 0.646), (547, 0.645), (548, 0.643), (549, 0.638), (550, 0.632), (551, 0.63), (552, 0.627), (553, 0.625), (554, 0.623), (555, 0.625), (556, 0.626), (557, 0.63), (558, 0.634), (559, 0.638), (560, 0.642), (561, 0.648), (562, 0.655), (563, 0.663), (564, 0.672), (565, 0.678), (566, 0.683), (567, 0.688), (568, 0.692), (569, 0.694), (570, 0.697), (571, 0.699), (572, 0.7), (573, 0.701), (574, 0.702), (575, 0.705), (576, 0.708), (577, 0.71), (578, 0.712), (579, 0.712), (580, 0.713), (581, 0.715), (582, 0.716), (583, 0.717), (584, 0.718), (585, 0.718), (586, 0.718), (587, 0.714), (588, 0.71), (589, 0.709), (590, 0.707), (591, 0.706), (592, 0.705), (593, 0.703), (594, 0.701), (595, 0.703), (596, 0.705), (597, 0.711), (598, 0.718), (599, 0.724), (600, 0.73), (601, 0.736), (602, 0.742), (603, 0.746), (604, 0.75), (605, 0.753), (606, 0.757), (607, 0.76), (608, 0.763), (609, 0.763), (610, 0.764), (611, 0.76), (612, 0.755), (613, 0.752), (614, 0.748), (615, 0.745), (616, 0.742), (617, 0.737), (618, 0.733), (619, 0.731), (620, 0.729), (621, 0.729), (622, 0.728), (623, 0.729), (624, 0.73), (625, 0.731), (626, 0.732), (627, 0.732), (628, 0.733), (629, 0.734), (630, 0.734), (631, 0.738), (632, 0.742), (633, 0.745), (634, 0.748), (635, 0.75), (636, 0.751), (637, 0.753), (638, 0.755), (639, 0.757), (640, 0.758), (641, 0.759), (642, 0.76), (643, 0.763), (644, 0.767), (645, 0.768), (646, 0.769), (647, 0.771), (648, 0.773), (649, 0.776), (650, 0.779), (651, 0.78), (652, 0.781), (653, 0.782), (654, 0.783), (655, 0.785), (656, 0.787), (657, 0.789), (658, 0.791), (659, 0.792), (660, 0.793), (661, 0.793), (662, 0.792), (663, 0.791), (664, 0.791), (665, 0.791), (666, 0.792), (667, 0.794), (668, 0.796), (669, 0.797), (670, 0.798), (671, 0.799), (672, 0.801), (673, 0.803), (674, 0.804), (675, 0.806), (676, 0.808), (677, 0.812), (678, 0.815), (679, 0.817), (680, 0.82), (681, 0.824), (682, 0.827), (683, 0.828), (684, 0.829), (685, 0.831), (686, 0.834), (687, 0.836), (688, 0.838), (689, 0.84), (690, 0.842), (691, 0.845), (692, 0.847), (693, 0.85), (694, 0.853), (695, 0.854), (696, 0.856), (697, 0.859), (698, 0.862), (699, 0.865), (700, 0.868), (701, 0.869), (702, 0.871), (703, 0.873), (704, 0.876), (705, 0.88), (706, 0.883), (707, 0.885), (708, 0.886), (709, 0.889), (710, 0.892), (711, 0.893), (712, 0.894), (713, 0.895), (714, 0.896), (715, 0.896), (716, 0.896), (717, 0.895), (718, 0.894), (719, 0.894), (720, 0.894), (721, 0.894), (722, 0.894), (723, 0.895), (724, 0.895), (725, 0.896), (726, 0.896), (727, 0.897), (728, 0.898), (729, 0.899), (730, 0.9), (731, 0.901), (732, 0.903), (733, 0.903), (734, 0.904), (735, 0.903), (736, 0.903), (737, 0.903), (738, 0.902), (739, 0.901), (740, 0.9), (741, 0.898), (742, 0.897), (743, 0.896), (744, 0.896), (745, 0.893), (746, 0.891), (747, 0.885), (748, 0.88), (749, 0.88), (750, 0.879), (751, 0.88), (752, 0.88), (753, 0.877), (754, 0.873), (755, 0.873), (756, 0.873), (757, 0.875), (758, 0.877), (759, 0.878), (760, 0.88), (761, 0.88), (762, 0.88), (763, 0.882), (764, 0.885), (765, 0.887), (766, 0.888), (767, 0.89), (768, 0.892), (769, 0.893), (770, 0.893), (771, 0.898), (772, 0.902), (773, 0.905), (774, 0.908), (775, 0.91), (776, 0.913), (777, 0.916), (778, 0.92), (779, 0.92), (780, 0.92), (781, 0.919), (782, 0.918), (783, 0.917), (784, 0.916), (785, 0.916), (786, 0.916), (787, 0.918), (788, 0.919), (789, 0.919), (790, 0.918), (791, 0.918), (792, 0.917), (793, 0.916), (794, 0.916), (795, 0.916), (796, 0.915), (797, 0.916), (798, 0.918), (799, 0.923), (800, 0.927), (801, 0.928), (802, 0.928), (803, 0.93), (804, 0.932), (805, 0.938), (806, 0.943), (807, 0.947), (808, 0.952), (809, 0.955), (810, 0.957), (811, 0.96), (812, 0.962), (813, 0.965), (814, 0.969), (815, 0.97), (816, 0.97), (817, 0.971), (818, 0.972), (819, 0.975), (820, 0.977), (821, 0.978), (822, 0.979), (823, 0.98), (824, 0.981), (825, 0.984), (826, 0.987), (827, 0.989), (828, 0.992), (829, 0.994), (830, 0.997), (831, 0.998), (832, 0.998), (833, 0.999), (834, 1.0), (835, 0.998), (836, 0.996), (837, 0.995), (838, 0.995), (839, 0.995), (840, 0.994), (841, 0.993), (842, 0.992), (843, 0.992), (844, 0.992), (845, 0.993), (846, 0.994), (847, 0.993), (848, 0.992), (849, 0.989), (850, 0.987), (851, 0.982), (852, 0.978), (853, 0.973), (854, 0.968), (855, 0.965), (856, 0.962), (857, 0.96), (858, 0.957), (859, 0.953), (860, 0.949), (861, 0.943), (862, 0.937), (863, 0.933), (864, 0.928), (865, 0.924), (866, 0.92), (867, 0.916), (868, 0.911), (869, 0.909), (870, 0.907), (871, 0.906), (872, 0.905), (873, 0.905), (874, 0.906), (875, 0.909), (876, 0.911), (877, 0.916), (878, 0.922), (879, 0.931), (880, 0.94), (881, 0.951), (882, 0.962), (883, 0.97), (884, 0.977), (885, 0.978), (886, 0.979), (887, 0.968), (888, 0.957), (889, 0.926), (890, 0.895), (891, 0.841), (892, 0.787), (893, 0.717), (894, 0.647), (895, 0.572), (896, 0.496), (897, 0.429), (898, 0.363), (899, 0.31), (900, 0.258), (901, 0.219), (902, 0.181), (903, 0.154), (904, 0.127), (905, 0.108), (906, 0.089), (907, 0.075), (908, 0.062), (909, 0.053), (910, 0.044)]
Argument type: string
Acceptable values:
- String value
saveResponseFunction: Save spectral response function (optional)
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputResampledRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputResampledRaster: <outputRaster>
Output raster layer
Spectrally resample a spectral raster layer by applying spectral response function convolution. For more information see the Landsat missions website.
Parameters
- Spectral raster layer [raster]
- A spectral raster layer to be resampled.
- Spectral response function [string]
Python code specifying the spectral response function.
Default:
from collections import OrderedDict responses = OrderedDict() # responses['Coastal aerosol'] = [(429, 0.002), (430, 0.003), (431, 0.008), (432, 0.025), (433, 0.086), (434, 0.254), (435, 0.518), (436, 0.765), (437, 0.909), (438, 0.958), (439, 0.977), (440, 0.984), (441, 0.989), (442, 0.987), (443, 0.994), (444, 0.993), (445, 1.0), (446, 0.997), (447, 0.983), (448, 0.973), (449, 0.906), (450, 0.746), (451, 0.471), (452, 0.226), (453, 0.093), (454, 0.037), (455, 0.015), (456, 0.006), (457, 0.002)] responses['Blue'] = [(443, 0.001), (444, 0.002), (445, 0.004), (446, 0.007), (447, 0.013), (448, 0.027), (449, 0.059), (450, 0.131), (451, 0.271), (452, 0.494), (453, 0.724), (454, 0.858), (455, 0.894), (456, 0.903), (457, 0.911), (458, 0.91), (459, 0.899), (460, 0.898), (461, 0.89), (462, 0.884), (463, 0.877), (464, 0.881), (465, 0.875), (466, 0.88), (467, 0.887), (468, 0.892), (469, 0.888), (470, 0.861), (471, 0.849), (472, 0.841), (473, 0.828), (474, 0.844), (475, 0.866), (476, 0.868), (477, 0.89), (478, 0.913), (479, 0.91), (480, 0.919), (481, 0.932), (482, 0.932), (483, 0.954), (484, 0.956), (485, 0.962), (486, 0.956), (487, 0.953), (488, 0.979), (489, 0.989), (490, 0.986), (491, 0.989), (492, 0.982), (493, 0.969), (494, 0.967), (495, 0.977), (496, 0.989), (497, 0.981), (498, 0.967), (499, 0.955), (500, 0.964), (501, 0.966), (502, 0.967), (503, 0.982), (504, 0.982), (505, 0.966), (506, 0.963), (507, 0.972), (508, 0.996), (509, 1.0), (510, 0.956), (511, 0.845), (512, 0.535), (513, 0.191), (514, 0.048), (515, 0.014), (516, 0.005), (517, 0.003), (518, 0.002), (519, 0.001)] responses['Green'] = [(519, 0.001), (520, 0.002), (521, 0.003), (522, 0.003), (523, 0.005), (524, 0.007), (525, 0.01), (526, 0.016), (527, 0.026), (528, 0.041), (529, 0.071), (530, 0.123), (531, 0.212), (532, 0.354), (533, 0.546), (534, 0.741), (535, 0.865), (536, 0.927), (537, 0.955), (538, 0.954), (539, 0.959), (540, 0.961), (541, 0.965), (542, 0.97), (543, 0.952), (544, 0.961), (545, 0.978), (546, 0.978), (547, 0.977), (548, 0.981), (549, 0.991), (550, 1.0), (551, 0.992), (552, 0.983), (553, 0.984), (554, 0.978), (555, 0.965), (556, 0.957), (557, 0.946), (558, 0.948), (559, 0.959), (560, 0.967), (561, 0.978), (562, 0.966), (563, 0.953), (564, 0.958), (565, 0.97), (566, 0.979), (567, 0.983), (568, 0.981), (569, 0.975), (570, 0.967), (571, 0.979), (572, 0.978), (573, 0.976), (574, 0.974), (575, 0.98), (576, 0.969), (577, 0.969), (578, 0.968), (579, 0.983), (580, 0.98), (581, 0.964), (582, 0.969), (583, 0.984), (584, 0.987), (585, 0.974), (586, 0.946), (587, 0.904), (588, 0.809), (589, 0.685), (590, 0.525), (591, 0.345), (592, 0.19), (593, 0.088), (594, 0.035), (595, 0.014), (596, 0.006), (597, 0.003), (598, 0.001)] responses['Red'] = [(628, 0.002), (629, 0.004), (630, 0.007), (631, 0.015), (632, 0.03), (633, 0.067), (634, 0.149), (635, 0.3), (636, 0.527), (637, 0.764), (638, 0.905), (639, 0.948), (640, 0.951), (641, 0.947), (642, 0.952), (643, 0.963), (644, 0.975), (645, 0.984), (646, 0.984), (647, 0.983), (648, 0.983), (649, 0.974), (650, 0.959), (651, 0.956), (652, 0.956), (653, 0.953), (654, 0.957), (655, 0.982), (656, 1.0), (657, 0.992), (658, 0.985), (659, 0.982), (660, 0.977), (661, 0.973), (662, 0.981), (663, 0.997), (664, 0.992), (665, 0.981), (666, 0.964), (667, 0.962), (668, 0.971), (669, 0.967), (670, 0.967), (671, 0.95), (672, 0.849), (673, 0.609), (674, 0.316), (675, 0.124), (676, 0.046), (677, 0.018), (678, 0.007), (679, 0.003), (680, 0.001)] responses['NIR'] = [(838, 0.001), (839, 0.002), (840, 0.003), (841, 0.005), (842, 0.007), (843, 0.011), (844, 0.017), (845, 0.028), (846, 0.048), (847, 0.084), (848, 0.145), (849, 0.25), (850, 0.404), (851, 0.583), (852, 0.745), (853, 0.89), (854, 0.96), (855, 0.987), (856, 0.973), (857, 0.981), (858, 0.996), (859, 1.0), (860, 0.99), (861, 0.981), (862, 0.976), (863, 0.972), (864, 0.957), (865, 0.951), (866, 0.947), (867, 0.953), (868, 0.951), (869, 0.948), (870, 0.94), (871, 0.951), (872, 0.956), (873, 0.966), (874, 0.97), (875, 0.937), (876, 0.891), (877, 0.789), (878, 0.635), (879, 0.448), (880, 0.289), (881, 0.175), (882, 0.1), (883, 0.058), (884, 0.035), (885, 0.021), (886, 0.012), (887, 0.008), (888, 0.005), (889, 0.003), (890, 0.002), (891, 0.001)] responses['SWIR-1'] = [(1524, 0.001), (1525, 0.001), (1526, 0.002), (1527, 0.002), (1528, 0.002), (1529, 0.002), (1530, 0.003), (1531, 0.003), (1532, 0.004), (1533, 0.004), (1534, 0.005), (1535, 0.006), (1536, 0.006), (1537, 0.007), (1538, 0.008), (1539, 0.01), (1540, 0.011), (1541, 0.012), (1542, 0.014), (1543, 0.016), (1544, 0.019), (1545, 0.022), (1546, 0.026), (1547, 0.03), (1548, 0.035), (1549, 0.04), (1550, 0.048), (1551, 0.055), (1552, 0.066), (1553, 0.076), (1554, 0.089), (1555, 0.102), (1556, 0.12), (1557, 0.139), (1558, 0.163), (1559, 0.188), (1560, 0.22), (1561, 0.253), (1562, 0.291), (1563, 0.33), (1564, 0.376), (1565, 0.421), (1566, 0.474), (1567, 0.526), (1568, 0.579), (1569, 0.632), (1570, 0.677), (1571, 0.721), (1572, 0.755), (1573, 0.788), (1574, 0.821), (1575, 0.854), (1576, 0.873), (1577, 0.892), (1578, 0.9), (1579, 0.907), (1580, 0.913), (1581, 0.919), (1582, 0.923), (1583, 0.927), (1584, 0.927), (1585, 0.926), (1586, 0.925), (1587, 0.924), (1588, 0.924), (1589, 0.924), (1590, 0.923), (1591, 0.921), (1592, 0.922), (1593, 0.923), (1594, 0.925), (1595, 0.927), (1596, 0.935), (1597, 0.943), (1598, 0.944), (1599, 0.946), (1600, 0.946), (1601, 0.946), (1602, 0.947), (1603, 0.948), (1604, 0.95), (1605, 0.953), (1606, 0.951), (1607, 0.95), (1608, 0.953), (1609, 0.956), (1610, 0.959), (1611, 0.962), (1612, 0.96), (1613, 0.958), (1614, 0.96), (1615, 0.961), (1616, 0.961), (1617, 0.96), (1618, 0.961), (1619, 0.961), (1620, 0.965), (1621, 0.968), (1622, 0.969), (1623, 0.971), (1624, 0.974), (1625, 0.977), (1626, 0.979), (1627, 0.981), (1628, 0.981), (1629, 0.981), (1630, 0.989), (1631, 0.996), (1632, 0.998), (1633, 1.0), (1634, 1.0), (1635, 1.0), (1636, 0.997), (1637, 0.993), (1638, 0.986), (1639, 0.979), (1640, 0.967), (1641, 0.955), (1642, 0.936), (1643, 0.917), (1644, 0.879), (1645, 0.841), (1646, 0.797), (1647, 0.752), (1648, 0.694), (1649, 0.637), (1650, 0.573), (1651, 0.51), (1652, 0.452), (1653, 0.394), (1654, 0.343), (1655, 0.292), (1656, 0.251), (1657, 0.211), (1658, 0.181), (1659, 0.151), (1660, 0.128), (1661, 0.107), (1662, 0.091), (1663, 0.075), (1664, 0.064), (1665, 0.053), (1666, 0.045), (1667, 0.037), (1668, 0.032), (1669, 0.026), (1670, 0.023), (1671, 0.019), (1672, 0.016), (1673, 0.013), (1674, 0.011), (1675, 0.01), (1676, 0.008), (1677, 0.007), (1678, 0.006), (1679, 0.005), (1680, 0.004), (1681, 0.004), (1682, 0.003), (1683, 0.003), (1684, 0.002), (1685, 0.002), (1686, 0.002), (1687, 0.001), (1688, 0.001)] responses['SWIR-2'] = [(2051, 0.001), (2052, 0.001), (2053, 0.001), (2054, 0.002), (2055, 0.002), (2056, 0.002), (2057, 0.002), (2058, 0.002), (2059, 0.003), (2060, 0.003), (2061, 0.003), (2062, 0.004), (2063, 0.004), (2064, 0.005), (2065, 0.005), (2066, 0.006), (2067, 0.006), (2068, 0.007), (2069, 0.008), (2070, 0.009), (2071, 0.01), (2072, 0.011), (2073, 0.012), (2074, 0.014), (2075, 0.015), (2076, 0.017), (2077, 0.019), (2078, 0.021), (2079, 0.023), (2080, 0.026), (2081, 0.029), (2082, 0.032), (2083, 0.035), (2084, 0.04), (2085, 0.045), (2086, 0.051), (2087, 0.056), (2088, 0.063), (2089, 0.07), (2090, 0.079), (2091, 0.089), (2092, 0.101), (2093, 0.113), (2094, 0.128), (2095, 0.145), (2096, 0.162), (2097, 0.18), (2098, 0.203), (2099, 0.227), (2100, 0.254), (2101, 0.281), (2102, 0.311), (2103, 0.343), (2104, 0.377), (2105, 0.413), (2106, 0.45), (2107, 0.489), (2108, 0.522), (2109, 0.555), (2110, 0.593), (2111, 0.634), (2112, 0.663), (2113, 0.69), (2114, 0.722), (2115, 0.757), (2116, 0.776), (2117, 0.793), (2118, 0.814), (2119, 0.836), (2120, 0.846), (2121, 0.854), (2122, 0.868), (2123, 0.884), (2124, 0.886), (2125, 0.886), (2126, 0.895), (2127, 0.907), (2128, 0.91), (2129, 0.911), (2130, 0.918), (2131, 0.926), (2132, 0.93), (2133, 0.932), (2134, 0.937), (2135, 0.941), (2136, 0.943), (2137, 0.943), (2138, 0.943), (2139, 0.943), (2140, 0.945), (2141, 0.948), (2142, 0.949), (2143, 0.95), (2144, 0.95), (2145, 0.949), (2146, 0.953), (2147, 0.957), (2148, 0.953), (2149, 0.947), (2150, 0.949), (2151, 0.953), (2152, 0.951), (2153, 0.947), (2154, 0.947), (2155, 0.947), (2156, 0.952), (2157, 0.958), (2158, 0.953), (2159, 0.946), (2160, 0.948), (2161, 0.951), (2162, 0.952), (2163, 0.952), (2164, 0.949), (2165, 0.945), (2166, 0.943), (2167, 0.94), (2168, 0.943), (2169, 0.948), (2170, 0.945), (2171, 0.94), (2172, 0.939), (2173, 0.938), (2174, 0.942), (2175, 0.947), (2176, 0.947), (2177, 0.944), (2178, 0.947), (2179, 0.952), (2180, 0.949), (2181, 0.945), (2182, 0.94), (2183, 0.934), (2184, 0.935), (2185, 0.939), (2186, 0.939), (2187, 0.939), (2188, 0.935), (2189, 0.929), (2190, 0.927), (2191, 0.926), (2192, 0.931), (2193, 0.937), (2194, 0.934), (2195, 0.928), (2196, 0.931), (2197, 0.936), (2198, 0.936), (2199, 0.934), (2200, 0.935), (2201, 0.938), (2202, 0.946), (2203, 0.957), (2204, 0.956), (2205, 0.952), (2206, 0.957), (2207, 0.963), (2208, 0.964), (2209, 0.964), (2210, 0.964), (2211, 0.962), (2212, 0.963), (2213, 0.964), (2214, 0.962), (2215, 0.961), (2216, 0.959), (2217, 0.958), (2218, 0.958), (2219, 0.958), (2220, 0.953), (2221, 0.947), (2222, 0.952), (2223, 0.959), (2224, 0.96), (2225, 0.96), (2226, 0.955), (2227, 0.948), (2228, 0.952), (2229, 0.959), (2230, 0.961), (2231, 0.961), (2232, 0.956), (2233, 0.949), (2234, 0.953), (2235, 0.96), (2236, 0.964), (2237, 0.967), (2238, 0.964), (2239, 0.96), (2240, 0.965), (2241, 0.973), (2242, 0.978), (2243, 0.981), (2244, 0.983), (2245, 0.984), (2246, 0.985), (2247, 0.985), (2248, 0.991), (2249, 1.0), (2250, 0.998), (2251, 0.993), (2252, 0.992), (2253, 0.993), (2254, 0.996), (2255, 1.0), (2256, 0.999), (2257, 0.997), (2258, 0.994), (2259, 0.991), (2260, 0.988), (2261, 0.984), (2262, 0.986), (2263, 0.989), (2264, 0.985), (2265, 0.978), (2266, 0.975), (2267, 0.973), (2268, 0.974), (2269, 0.977), (2270, 0.976), (2271, 0.975), (2272, 0.974), (2273, 0.974), (2274, 0.968), (2275, 0.96), (2276, 0.957), (2277, 0.955), (2278, 0.955), (2279, 0.956), (2280, 0.947), (2281, 0.937), (2282, 0.922), (2283, 0.907), (2284, 0.895), (2285, 0.884), (2286, 0.855), (2287, 0.824), (2288, 0.785), (2289, 0.744), (2290, 0.699), (2291, 0.652), (2292, 0.603), (2293, 0.553), (2294, 0.503), (2295, 0.453), (2296, 0.404), (2297, 0.356), (2298, 0.316), (2299, 0.278), (2300, 0.245), (2301, 0.212), (2302, 0.186), (2303, 0.162), (2304, 0.141), (2305, 0.122), (2306, 0.107), (2307, 0.092), (2308, 0.08), (2309, 0.069), (2310, 0.061), (2311, 0.053), (2312, 0.046), (2313, 0.04), (2314, 0.036), (2315, 0.031), (2316, 0.028), (2317, 0.024), (2318, 0.021), (2319, 0.019), (2320, 0.017), (2321, 0.015), (2322, 0.013), (2323, 0.011), (2324, 0.01), (2325, 0.009), (2326, 0.008), (2327, 0.007), (2328, 0.006), (2329, 0.006), (2330, 0.005), (2331, 0.004), (2332, 0.004), (2333, 0.003), (2334, 0.003), (2335, 0.003), (2336, 0.002), (2337, 0.002), (2338, 0.002), (2339, 0.002), (2340, 0.001), (2341, 0.001)] # responses['Pan'] = [(490, 0.001), (491, 0.002), (492, 0.003), (493, 0.004), (494, 0.006), (495, 0.009), (496, 0.016), (497, 0.023), (498, 0.043), (499, 0.067), (500, 0.124), (501, 0.196), (502, 0.323), (503, 0.472), (504, 0.598), (505, 0.715), (506, 0.776), (507, 0.817), (508, 0.832), (509, 0.838), (510, 0.849), (511, 0.862), (512, 0.863), (513, 0.86), (514, 0.859), (515, 0.858), (516, 0.857), (517, 0.856), (518, 0.858), (519, 0.863), (520, 0.861), (521, 0.856), (522, 0.853), (523, 0.85), (524, 0.853), (525, 0.857), (526, 0.859), (527, 0.86), (528, 0.862), (529, 0.863), (530, 0.86), (531, 0.855), (532, 0.864), (533, 0.879), (534, 0.886), (535, 0.889), (536, 0.895), (537, 0.902), (538, 0.906), (539, 0.909), (540, 0.912), (541, 0.914), (542, 0.91), (543, 0.903), (544, 0.909), (545, 0.92), (546, 0.922), (547, 0.919), (548, 0.913), (549, 0.905), (550, 0.893), (551, 0.879), (552, 0.877), (553, 0.879), (554, 0.878), (555, 0.876), (556, 0.873), (557, 0.869), (558, 0.875), (559, 0.885), (560, 0.89), (561, 0.893), (562, 0.886), (563, 0.874), (564, 0.876), (565, 0.882), (566, 0.891), (567, 0.901), (568, 0.904), (569, 0.903), (570, 0.908), (571, 0.914), (572, 0.915), (573, 0.913), (574, 0.916), (575, 0.92), (576, 0.921), (577, 0.921), (578, 0.924), (579, 0.929), (580, 0.93), (581, 0.93), (582, 0.938), (583, 0.949), (584, 0.947), (585, 0.94), (586, 0.941), (587, 0.944), (588, 0.946), (589, 0.947), (590, 0.942), (591, 0.936), (592, 0.94), (593, 0.947), (594, 0.942), (595, 0.934), (596, 0.934), (597, 0.938), (598, 0.941), (599, 0.944), (600, 0.952), (601, 0.964), (602, 0.967), (603, 0.968), (604, 0.968), (605, 0.968), (606, 0.965), (607, 0.961), (608, 0.957), (609, 0.953), (610, 0.949), (611, 0.946), (612, 0.948), (613, 0.952), (614, 0.955), (615, 0.956), (616, 0.959), (617, 0.963), (618, 0.964), (619, 0.964), (620, 0.966), (621, 0.969), (622, 0.973), (623, 0.977), (624, 0.978), (625, 0.978), (626, 0.974), (627, 0.969), (628, 0.97), (629, 0.972), (630, 0.973), (631, 0.973), (632, 0.97), (633, 0.966), (634, 0.966), (635, 0.967), (636, 0.967), (637, 0.966), (638, 0.972), (639, 0.981), (640, 0.981), (641, 0.978), (642, 0.974), (643, 0.971), (644, 0.963), (645, 0.953), (646, 0.953), (647, 0.958), (648, 0.964), (649, 0.971), (650, 0.969), (651, 0.965), (652, 0.967), (653, 0.971), (654, 0.974), (655, 0.977), (656, 0.983), (657, 0.99), (658, 0.988), (659, 0.984), (660, 0.988), (661, 0.996), (662, 0.999), (663, 1.0), (664, 1.0), (665, 0.999), (666, 0.998), (667, 0.997), (668, 0.993), (669, 0.987), (670, 0.986), (671, 0.986), (672, 0.956), (673, 0.914), (674, 0.78), (675, 0.61), (676, 0.439), (677, 0.267), (678, 0.167), (679, 0.094), (680, 0.058), (681, 0.035), (682, 0.023), (683, 0.015), (684, 0.011), (685, 0.008), (686, 0.006), (687, 0.004), (688, 0.003), (689, 0.002), (690, 0.002)]
- Save spectral response function [boolean]
Whether to save the spectral response function library as *.srf.gpkg sidecar file.
Default: False
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpectralResamplingToLandsat89Oli
:
----------------
Arguments
----------------
raster: Spectral raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
response: Spectral response function
Default value: from collections import OrderedDict
responses = OrderedDict()
# responses['Coastal aerosol'] = [(429, 0.002), (430, 0.003), (431, 0.008), (432, 0.025), (433, 0.086), (434, 0.254), (435, 0.518), (436, 0.765), (437, 0.909), (438, 0.958), (439, 0.977), (440, 0.984), (441, 0.989), (442, 0.987), (443, 0.994), (444, 0.993), (445, 1.0), (446, 0.997), (447, 0.983), (448, 0.973), (449, 0.906), (450, 0.746), (451, 0.471), (452, 0.226), (453, 0.093), (454, 0.037), (455, 0.015), (456, 0.006), (457, 0.002)]
responses['Blue'] = [(443, 0.001), (444, 0.002), (445, 0.004), (446, 0.007), (447, 0.013), (448, 0.027),
(449, 0.059), (450, 0.131), (451, 0.271), (452, 0.494), (453, 0.724), (454, 0.858),
(455, 0.894), (456, 0.903), (457, 0.911), (458, 0.91), (459, 0.899), (460, 0.898),
(461, 0.89), (462, 0.884), (463, 0.877), (464, 0.881), (465, 0.875), (466, 0.88),
(467, 0.887), (468, 0.892), (469, 0.888), (470, 0.861), (471, 0.849), (472, 0.841),
(473, 0.828), (474, 0.844), (475, 0.866), (476, 0.868), (477, 0.89), (478, 0.913),
(479, 0.91), (480, 0.919), (481, 0.932), (482, 0.932), (483, 0.954), (484, 0.956),
(485, 0.962), (486, 0.956), (487, 0.953), (488, 0.979), (489, 0.989), (490, 0.986),
(491, 0.989), (492, 0.982), (493, 0.969), (494, 0.967), (495, 0.977), (496, 0.989),
(497, 0.981), (498, 0.967), (499, 0.955), (500, 0.964), (501, 0.966), (502, 0.967),
(503, 0.982), (504, 0.982), (505, 0.966), (506, 0.963), (507, 0.972), (508, 0.996),
(509, 1.0), (510, 0.956), (511, 0.845), (512, 0.535), (513, 0.191), (514, 0.048),
(515, 0.014), (516, 0.005), (517, 0.003), (518, 0.002), (519, 0.001)]
responses['Green'] = [(519, 0.001), (520, 0.002), (521, 0.003), (522, 0.003), (523, 0.005), (524, 0.007),
(525, 0.01), (526, 0.016), (527, 0.026), (528, 0.041), (529, 0.071), (530, 0.123),
(531, 0.212), (532, 0.354), (533, 0.546), (534, 0.741), (535, 0.865), (536, 0.927),
(537, 0.955), (538, 0.954), (539, 0.959), (540, 0.961), (541, 0.965), (542, 0.97),
(543, 0.952), (544, 0.961), (545, 0.978), (546, 0.978), (547, 0.977), (548, 0.981),
(549, 0.991), (550, 1.0), (551, 0.992), (552, 0.983), (553, 0.984), (554, 0.978),
(555, 0.965), (556, 0.957), (557, 0.946), (558, 0.948), (559, 0.959), (560, 0.967),
(561, 0.978), (562, 0.966), (563, 0.953), (564, 0.958), (565, 0.97), (566, 0.979),
(567, 0.983), (568, 0.981), (569, 0.975), (570, 0.967), (571, 0.979), (572, 0.978),
(573, 0.976), (574, 0.974), (575, 0.98), (576, 0.969), (577, 0.969), (578, 0.968),
(579, 0.983), (580, 0.98), (581, 0.964), (582, 0.969), (583, 0.984), (584, 0.987),
(585, 0.974), (586, 0.946), (587, 0.904), (588, 0.809), (589, 0.685), (590, 0.525),
(591, 0.345), (592, 0.19), (593, 0.088), (594, 0.035), (595, 0.014), (596, 0.006),
(597, 0.003), (598, 0.001)]
responses['Red'] = [(628, 0.002), (629, 0.004), (630, 0.007), (631, 0.015), (632, 0.03), (633, 0.067),
(634, 0.149), (635, 0.3), (636, 0.527), (637, 0.764), (638, 0.905), (639, 0.948),
(640, 0.951), (641, 0.947), (642, 0.952), (643, 0.963), (644, 0.975), (645, 0.984),
(646, 0.984), (647, 0.983), (648, 0.983), (649, 0.974), (650, 0.959), (651, 0.956),
(652, 0.956), (653, 0.953), (654, 0.957), (655, 0.982), (656, 1.0), (657, 0.992),
(658, 0.985), (659, 0.982), (660, 0.977), (661, 0.973), (662, 0.981), (663, 0.997),
(664, 0.992), (665, 0.981), (666, 0.964), (667, 0.962), (668, 0.971), (669, 0.967),
(670, 0.967), (671, 0.95), (672, 0.849), (673, 0.609), (674, 0.316), (675, 0.124),
(676, 0.046), (677, 0.018), (678, 0.007), (679, 0.003), (680, 0.001)]
responses['NIR'] = [(838, 0.001), (839, 0.002), (840, 0.003), (841, 0.005), (842, 0.007), (843, 0.011),
(844, 0.017), (845, 0.028), (846, 0.048), (847, 0.084), (848, 0.145), (849, 0.25),
(850, 0.404), (851, 0.583), (852, 0.745), (853, 0.89), (854, 0.96), (855, 0.987),
(856, 0.973), (857, 0.981), (858, 0.996), (859, 1.0), (860, 0.99), (861, 0.981),
(862, 0.976), (863, 0.972), (864, 0.957), (865, 0.951), (866, 0.947), (867, 0.953),
(868, 0.951), (869, 0.948), (870, 0.94), (871, 0.951), (872, 0.956), (873, 0.966),
(874, 0.97), (875, 0.937), (876, 0.891), (877, 0.789), (878, 0.635), (879, 0.448),
(880, 0.289), (881, 0.175), (882, 0.1), (883, 0.058), (884, 0.035), (885, 0.021),
(886, 0.012), (887, 0.008), (888, 0.005), (889, 0.003), (890, 0.002), (891, 0.001)]
responses['SWIR-1'] = [(1524, 0.001), (1525, 0.001), (1526, 0.002), (1527, 0.002), (1528, 0.002), (1529, 0.002),
(1530, 0.003), (1531, 0.003), (1532, 0.004), (1533, 0.004), (1534, 0.005), (1535, 0.006),
(1536, 0.006), (1537, 0.007), (1538, 0.008), (1539, 0.01), (1540, 0.011), (1541, 0.012),
(1542, 0.014), (1543, 0.016), (1544, 0.019), (1545, 0.022), (1546, 0.026), (1547, 0.03),
(1548, 0.035), (1549, 0.04), (1550, 0.048), (1551, 0.055), (1552, 0.066), (1553, 0.076),
(1554, 0.089), (1555, 0.102), (1556, 0.12), (1557, 0.139), (1558, 0.163), (1559, 0.188),
(1560, 0.22), (1561, 0.253), (1562, 0.291), (1563, 0.33), (1564, 0.376), (1565, 0.421),
(1566, 0.474), (1567, 0.526), (1568, 0.579), (1569, 0.632), (1570, 0.677), (1571, 0.721),
(1572, 0.755), (1573, 0.788), (1574, 0.821), (1575, 0.854), (1576, 0.873), (1577, 0.892),
(1578, 0.9), (1579, 0.907), (1580, 0.913), (1581, 0.919), (1582, 0.923), (1583, 0.927),
(1584, 0.927), (1585, 0.926), (1586, 0.925), (1587, 0.924), (1588, 0.924), (1589, 0.924),
(1590, 0.923), (1591, 0.921), (1592, 0.922), (1593, 0.923), (1594, 0.925), (1595, 0.927),
(1596, 0.935), (1597, 0.943), (1598, 0.944), (1599, 0.946), (1600, 0.946), (1601, 0.946),
(1602, 0.947), (1603, 0.948), (1604, 0.95), (1605, 0.953), (1606, 0.951), (1607, 0.95),
(1608, 0.953), (1609, 0.956), (1610, 0.959), (1611, 0.962), (1612, 0.96), (1613, 0.958),
(1614, 0.96), (1615, 0.961), (1616, 0.961), (1617, 0.96), (1618, 0.961), (1619, 0.961),
(1620, 0.965), (1621, 0.968), (1622, 0.969), (1623, 0.971), (1624, 0.974), (1625, 0.977),
(1626, 0.979), (1627, 0.981), (1628, 0.981), (1629, 0.981), (1630, 0.989), (1631, 0.996),
(1632, 0.998), (1633, 1.0), (1634, 1.0), (1635, 1.0), (1636, 0.997), (1637, 0.993),
(1638, 0.986), (1639, 0.979), (1640, 0.967), (1641, 0.955), (1642, 0.936), (1643, 0.917),
(1644, 0.879), (1645, 0.841), (1646, 0.797), (1647, 0.752), (1648, 0.694), (1649, 0.637),
(1650, 0.573), (1651, 0.51), (1652, 0.452), (1653, 0.394), (1654, 0.343), (1655, 0.292),
(1656, 0.251), (1657, 0.211), (1658, 0.181), (1659, 0.151), (1660, 0.128), (1661, 0.107),
(1662, 0.091), (1663, 0.075), (1664, 0.064), (1665, 0.053), (1666, 0.045), (1667, 0.037),
(1668, 0.032), (1669, 0.026), (1670, 0.023), (1671, 0.019), (1672, 0.016), (1673, 0.013),
(1674, 0.011), (1675, 0.01), (1676, 0.008), (1677, 0.007), (1678, 0.006), (1679, 0.005),
(1680, 0.004), (1681, 0.004), (1682, 0.003), (1683, 0.003), (1684, 0.002), (1685, 0.002),
(1686, 0.002), (1687, 0.001), (1688, 0.001)]
responses['SWIR-2'] = [(2051, 0.001), (2052, 0.001), (2053, 0.001), (2054, 0.002), (2055, 0.002), (2056, 0.002),
(2057, 0.002), (2058, 0.002), (2059, 0.003), (2060, 0.003), (2061, 0.003), (2062, 0.004),
(2063, 0.004), (2064, 0.005), (2065, 0.005), (2066, 0.006), (2067, 0.006), (2068, 0.007),
(2069, 0.008), (2070, 0.009), (2071, 0.01), (2072, 0.011), (2073, 0.012), (2074, 0.014),
(2075, 0.015), (2076, 0.017), (2077, 0.019), (2078, 0.021), (2079, 0.023), (2080, 0.026),
(2081, 0.029), (2082, 0.032), (2083, 0.035), (2084, 0.04), (2085, 0.045), (2086, 0.051),
(2087, 0.056), (2088, 0.063), (2089, 0.07), (2090, 0.079), (2091, 0.089), (2092, 0.101),
(2093, 0.113), (2094, 0.128), (2095, 0.145), (2096, 0.162), (2097, 0.18), (2098, 0.203),
(2099, 0.227), (2100, 0.254), (2101, 0.281), (2102, 0.311), (2103, 0.343), (2104, 0.377),
(2105, 0.413), (2106, 0.45), (2107, 0.489), (2108, 0.522), (2109, 0.555), (2110, 0.593),
(2111, 0.634), (2112, 0.663), (2113, 0.69), (2114, 0.722), (2115, 0.757), (2116, 0.776),
(2117, 0.793), (2118, 0.814), (2119, 0.836), (2120, 0.846), (2121, 0.854), (2122, 0.868),
(2123, 0.884), (2124, 0.886), (2125, 0.886), (2126, 0.895), (2127, 0.907), (2128, 0.91),
(2129, 0.911), (2130, 0.918), (2131, 0.926), (2132, 0.93), (2133, 0.932), (2134, 0.937),
(2135, 0.941), (2136, 0.943), (2137, 0.943), (2138, 0.943), (2139, 0.943), (2140, 0.945),
(2141, 0.948), (2142, 0.949), (2143, 0.95), (2144, 0.95), (2145, 0.949), (2146, 0.953),
(2147, 0.957), (2148, 0.953), (2149, 0.947), (2150, 0.949), (2151, 0.953), (2152, 0.951),
(2153, 0.947), (2154, 0.947), (2155, 0.947), (2156, 0.952), (2157, 0.958), (2158, 0.953),
(2159, 0.946), (2160, 0.948), (2161, 0.951), (2162, 0.952), (2163, 0.952), (2164, 0.949),
(2165, 0.945), (2166, 0.943), (2167, 0.94), (2168, 0.943), (2169, 0.948), (2170, 0.945),
(2171, 0.94), (2172, 0.939), (2173, 0.938), (2174, 0.942), (2175, 0.947), (2176, 0.947),
(2177, 0.944), (2178, 0.947), (2179, 0.952), (2180, 0.949), (2181, 0.945), (2182, 0.94),
(2183, 0.934), (2184, 0.935), (2185, 0.939), (2186, 0.939), (2187, 0.939), (2188, 0.935),
(2189, 0.929), (2190, 0.927), (2191, 0.926), (2192, 0.931), (2193, 0.937), (2194, 0.934),
(2195, 0.928), (2196, 0.931), (2197, 0.936), (2198, 0.936), (2199, 0.934), (2200, 0.935),
(2201, 0.938), (2202, 0.946), (2203, 0.957), (2204, 0.956), (2205, 0.952), (2206, 0.957),
(2207, 0.963), (2208, 0.964), (2209, 0.964), (2210, 0.964), (2211, 0.962), (2212, 0.963),
(2213, 0.964), (2214, 0.962), (2215, 0.961), (2216, 0.959), (2217, 0.958), (2218, 0.958),
(2219, 0.958), (2220, 0.953), (2221, 0.947), (2222, 0.952), (2223, 0.959), (2224, 0.96),
(2225, 0.96), (2226, 0.955), (2227, 0.948), (2228, 0.952), (2229, 0.959), (2230, 0.961),
(2231, 0.961), (2232, 0.956), (2233, 0.949), (2234, 0.953), (2235, 0.96), (2236, 0.964),
(2237, 0.967), (2238, 0.964), (2239, 0.96), (2240, 0.965), (2241, 0.973), (2242, 0.978),
(2243, 0.981), (2244, 0.983), (2245, 0.984), (2246, 0.985), (2247, 0.985), (2248, 0.991),
(2249, 1.0), (2250, 0.998), (2251, 0.993), (2252, 0.992), (2253, 0.993), (2254, 0.996),
(2255, 1.0), (2256, 0.999), (2257, 0.997), (2258, 0.994), (2259, 0.991), (2260, 0.988),
(2261, 0.984), (2262, 0.986), (2263, 0.989), (2264, 0.985), (2265, 0.978), (2266, 0.975),
(2267, 0.973), (2268, 0.974), (2269, 0.977), (2270, 0.976), (2271, 0.975), (2272, 0.974),
(2273, 0.974), (2274, 0.968), (2275, 0.96), (2276, 0.957), (2277, 0.955), (2278, 0.955),
(2279, 0.956), (2280, 0.947), (2281, 0.937), (2282, 0.922), (2283, 0.907), (2284, 0.895),
(2285, 0.884), (2286, 0.855), (2287, 0.824), (2288, 0.785), (2289, 0.744), (2290, 0.699),
(2291, 0.652), (2292, 0.603), (2293, 0.553), (2294, 0.503), (2295, 0.453), (2296, 0.404),
(2297, 0.356), (2298, 0.316), (2299, 0.278), (2300, 0.245), (2301, 0.212), (2302, 0.186),
(2303, 0.162), (2304, 0.141), (2305, 0.122), (2306, 0.107), (2307, 0.092), (2308, 0.08),
(2309, 0.069), (2310, 0.061), (2311, 0.053), (2312, 0.046), (2313, 0.04), (2314, 0.036),
(2315, 0.031), (2316, 0.028), (2317, 0.024), (2318, 0.021), (2319, 0.019), (2320, 0.017),
(2321, 0.015), (2322, 0.013), (2323, 0.011), (2324, 0.01), (2325, 0.009), (2326, 0.008),
(2327, 0.007), (2328, 0.006), (2329, 0.006), (2330, 0.005), (2331, 0.004), (2332, 0.004),
(2333, 0.003), (2334, 0.003), (2335, 0.003), (2336, 0.002), (2337, 0.002), (2338, 0.002),
(2339, 0.002), (2340, 0.001), (2341, 0.001)]
# responses['Pan'] = [(490, 0.001), (491, 0.002), (492, 0.003), (493, 0.004), (494, 0.006), (495, 0.009), (496, 0.016), (497, 0.023), (498, 0.043), (499, 0.067), (500, 0.124), (501, 0.196), (502, 0.323), (503, 0.472), (504, 0.598), (505, 0.715), (506, 0.776), (507, 0.817), (508, 0.832), (509, 0.838), (510, 0.849), (511, 0.862), (512, 0.863), (513, 0.86), (514, 0.859), (515, 0.858), (516, 0.857), (517, 0.856), (518, 0.858), (519, 0.863), (520, 0.861), (521, 0.856), (522, 0.853), (523, 0.85), (524, 0.853), (525, 0.857), (526, 0.859), (527, 0.86), (528, 0.862), (529, 0.863), (530, 0.86), (531, 0.855), (532, 0.864), (533, 0.879), (534, 0.886), (535, 0.889), (536, 0.895), (537, 0.902), (538, 0.906), (539, 0.909), (540, 0.912), (541, 0.914), (542, 0.91), (543, 0.903), (544, 0.909), (545, 0.92), (546, 0.922), (547, 0.919), (548, 0.913), (549, 0.905), (550, 0.893), (551, 0.879), (552, 0.877), (553, 0.879), (554, 0.878), (555, 0.876), (556, 0.873), (557, 0.869), (558, 0.875), (559, 0.885), (560, 0.89), (561, 0.893), (562, 0.886), (563, 0.874), (564, 0.876), (565, 0.882), (566, 0.891), (567, 0.901), (568, 0.904), (569, 0.903), (570, 0.908), (571, 0.914), (572, 0.915), (573, 0.913), (574, 0.916), (575, 0.92), (576, 0.921), (577, 0.921), (578, 0.924), (579, 0.929), (580, 0.93), (581, 0.93), (582, 0.938), (583, 0.949), (584, 0.947), (585, 0.94), (586, 0.941), (587, 0.944), (588, 0.946), (589, 0.947), (590, 0.942), (591, 0.936), (592, 0.94), (593, 0.947), (594, 0.942), (595, 0.934), (596, 0.934), (597, 0.938), (598, 0.941), (599, 0.944), (600, 0.952), (601, 0.964), (602, 0.967), (603, 0.968), (604, 0.968), (605, 0.968), (606, 0.965), (607, 0.961), (608, 0.957), (609, 0.953), (610, 0.949), (611, 0.946), (612, 0.948), (613, 0.952), (614, 0.955), (615, 0.956), (616, 0.959), (617, 0.963), (618, 0.964), (619, 0.964), (620, 0.966), (621, 0.969), (622, 0.973), (623, 0.977), (624, 0.978), (625, 0.978), (626, 0.974), (627, 0.969), (628, 0.97), (629, 0.972), (630, 0.973), (631, 0.973), (632, 0.97), (633, 0.966), (634, 0.966), (635, 0.967), (636, 0.967), (637, 0.966), (638, 0.972), (639, 0.981), (640, 0.981), (641, 0.978), (642, 0.974), (643, 0.971), (644, 0.963), (645, 0.953), (646, 0.953), (647, 0.958), (648, 0.964), (649, 0.971), (650, 0.969), (651, 0.965), (652, 0.967), (653, 0.971), (654, 0.974), (655, 0.977), (656, 0.983), (657, 0.99), (658, 0.988), (659, 0.984), (660, 0.988), (661, 0.996), (662, 0.999), (663, 1.0), (664, 1.0), (665, 0.999), (666, 0.998), (667, 0.997), (668, 0.993), (669, 0.987), (670, 0.986), (671, 0.986), (672, 0.956), (673, 0.914), (674, 0.78), (675, 0.61), (676, 0.439), (677, 0.267), (678, 0.167), (679, 0.094), (680, 0.058), (681, 0.035), (682, 0.023), (683, 0.015), (684, 0.011), (685, 0.008), (686, 0.006), (687, 0.004), (688, 0.003), (689, 0.002), (690, 0.002)]
Argument type: string
Acceptable values:
- String value
saveResponseFunction: Save spectral response function (optional)
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputResampledRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputResampledRaster: <outputRaster>
Output raster layer
Spectrally resample a spectral raster layer by applying spectral response function convolution. For more information see the PRISMA mission website.
Parameters
- Spectral raster layer [raster]
- A spectral raster layer to be resampled.
- Spectral response function [string]
Python code specifying the spectral response function.
Default:
from collections import OrderedDict responses = OrderedDict() wavelength = [402.4, 411.3, 419.4, 427.0, 434.3, 441.7, 449.0, 456.4, 463.7, 470.9, 478.2, 485.4, 492.7, 500.1, 507.7, 515.2, 522.9, 530.7, 538.5, 546.5, 554.6, 562.7, 571.0, 579.4, 587.8, 596.5, 605.4, 614.2, 623.2, 632.1, 641.3, 650.8, 660.3, 669.8, 679.5, 689.4, 699.1, 709.0, 719.2, 729.2, 739.4, 749.7, 760.1, 770.5, 780.9, 791.4, 801.9, 812.5, 823.1, 833.8, 844.4, 855.2, 865.9, 876.6, 887.3, 898.0, 908.6, 919.2, 929.4, 939.9, 951.4, 962.3, 972.6, 943.0, 951.0, 959.5, 969.4, 978.7, 988.4, 998.4, 1008.2, 1018.0, 1028.8, 1037.8, 1047.4, 1057.4, 1067.6, 1078.0, 1088.6, 1099.1, 1109.7, 1120.5, 1131.1, 1141.9, 1152.5, 1163.5, 1174.5, 1185.4, 1196.2, 1207.1, 1217.7, 1229.0, 1240.1, 1250.8, 1262.3, 1273.3, 1284.3, 1295.2, 1306.0, 1317.0, 1328.1, 1338.9, 1349.6, 1360.8, 1372.7, 1383.0, 1394.5, 1405.4, 1416.3, 1427.1, 1438.2, 1448.9, 1459.1, 1469.7, 1480.6, 1491.2, 1501.8, 1512.4, 1523.0, 1533.6, 1544.0, 1554.6, 1565.1, 1575.4, 1585.6, 1596.0, 1606.2, 1616.6, 1626.8, 1636.9, 1647.0, 1656.8, 1667.0, 1677.1, 1687.2, 1697.0, 1706.8, 1716.6, 1726.4, 1736.3, 1745.9, 1755.5, 1765.3, 1774.9, 1784.4, 1793.7, 1803.4, 1812.8, 1822.1, 1831.7, 1841.0, 1850.3, 1859.3, 1868.0, 1878.5, 1886.8, 1895.8, 1904.6, 1914.0, 1923.1, 1932.0, 1940.8, 1949.6, 1958.4, 1967.1, 1975.8, 1984.5, 1993.3, 2001.8, 2010.4, 2019.0, 2027.5, 2036.0, 2044.4, 2052.8, 2061.1, 2069.5, 2077.8, 2086.1, 2094.4, 2102.5, 2110.8, 2119.0, 2127.1, 2135.2, 2143.2, 2151.1, 2159.3, 2167.3, 2175.1, 2183.2, 2190.8, 2198.9, 2206.6, 2214.3, 2222.2, 2229.8, 2237.6, 2245.2, 2252.8, 2260.6, 2268.0, 2275.8, 2283.3, 2290.6, 2298.3, 2305.5, 2312.9, 2320.6, 2327.6, 2335.2, 2342.6, 2349.6, 2357.0, 2364.4, 2371.3, 2378.5, 2385.8, 2392.8, 2399.8, 2407.3, 2414.2, 2421.0, 2428.4, 2435.3, 2442.2, 2448.9, 2456.3, 2462.8, 2469.4, 2476.8, 2483.6, 2490.0, 2496.9] fwhm = [11.4, 10.6, 9.8, 9.4, 9.3, 9.2, 9.1, 9.1, 9.0, 9.0, 9.0, 9.0, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 10.0, 10.1, 10.2, 10.3, 10.4, 10.5, 10.8, 11.0, 11.0, 11.2, 11.2, 11.5, 11.6, 11.7, 11.8, 12.0, 12.1, 12.0, 12.4, 12.4, 12.4, 12.5, 12.6, 12.8, 12.7, 12.8, 12.8, 12.9, 12.9, 13.0, 13.0, 13.1, 13.1, 13.2, 13.1, 13.1, 13.1, 13.1, 12.9, 12.8, 13.2, 13.5, 13.0, 12.9, 10.9, 11.0, 12.0, 12.1, 12.2, 12.3, 12.7, 12.4, 13.0, 13.0, 13.3, 13.5, 13.7, 13.9, 14.0, 14.1, 14.1, 14.4, 14.0, 14.3, 14.1, 14.3, 14.7, 14.3, 14.4, 14.3, 14.6, 14.4, 14.7, 14.4, 14.7, 14.9, 14.6, 14.5, 14.4, 14.5, 14.6, 14.7, 14.4, 14.5, 15.1, 14.5, 14.8, 14.2, 14.4, 14.3, 14.1, 14.7, 13.9, 13.7, 14.2, 14.2, 14.0, 14.1, 14.0, 13.9, 13.9, 13.7, 13.9, 13.7, 13.6, 13.6, 13.6, 13.5, 13.7, 13.3, 13.2, 13.2, 12.6, 13.4, 12.9, 13.0, 13.1, 13.0, 12.7, 12.6, 12.7, 12.9, 12.9, 12.4, 12.3, 12.5, 12.5, 12.3, 12.2, 12.9, 12.2, 12.4, 12.4, 12.1, 11.1, 12.5, 11.6, 11.5, 12.5, 11.6, 12.0, 11.6, 11.8, 11.5, 11.4, 11.5, 11.4, 11.6, 11.2, 11.4, 11.2, 11.3, 11.0, 11.3, 10.9, 11.0, 10.9, 11.1, 10.9, 11.0, 10.8, 10.8, 10.8, 10.8, 10.6, 10.7, 10.5, 10.6, 10.8, 10.2, 10.7, 10.3, 10.3, 10.6, 10.1, 10.4, 10.1, 10.3, 10.3, 10.1, 10.2, 10.2, 9.9, 10.2, 9.8, 10.0, 10.0, 9.7, 10.1, 9.8, 9.7, 10.1, 9.6, 9.6, 10.0, 9.5, 9.5, 9.6, 9.7, 9.3, 9.6, 9.7, 9.0, 9.7, 9.5, 9.4, 8.8, 9.4, 9.5, 8.9, 9.1, 9.7, 9.0, 9.0, 9.5] for w, f in zip(wavelength, fwhm): responses[w] = f
- Save spectral response function [boolean]
Whether to save the spectral response function library as *.srf.gpkg sidecar file.
Default: False
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpectralResamplingToPrisma
:
----------------
Arguments
----------------
raster: Spectral raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
response: Spectral response function
Default value: from collections import OrderedDict
responses = OrderedDict()
wavelength = [402.4, 411.3, 419.4, 427.0, 434.3, 441.7, 449.0, 456.4, 463.7, 470.9, 478.2, 485.4, 492.7, 500.1,
507.7, 515.2, 522.9, 530.7, 538.5, 546.5, 554.6, 562.7, 571.0, 579.4, 587.8, 596.5, 605.4, 614.2,
623.2, 632.1, 641.3, 650.8, 660.3, 669.8, 679.5, 689.4, 699.1, 709.0, 719.2, 729.2, 739.4, 749.7,
760.1, 770.5, 780.9, 791.4, 801.9, 812.5, 823.1, 833.8, 844.4, 855.2, 865.9, 876.6, 887.3, 898.0,
908.6, 919.2, 929.4, 939.9, 951.4, 962.3, 972.6, 943.0, 951.0, 959.5, 969.4, 978.7, 988.4, 998.4,
1008.2, 1018.0, 1028.8, 1037.8, 1047.4, 1057.4, 1067.6, 1078.0, 1088.6, 1099.1, 1109.7, 1120.5,
1131.1, 1141.9, 1152.5, 1163.5, 1174.5, 1185.4, 1196.2, 1207.1, 1217.7, 1229.0, 1240.1, 1250.8,
1262.3, 1273.3, 1284.3, 1295.2, 1306.0, 1317.0, 1328.1, 1338.9, 1349.6, 1360.8, 1372.7, 1383.0,
1394.5, 1405.4, 1416.3, 1427.1, 1438.2, 1448.9, 1459.1, 1469.7, 1480.6, 1491.2, 1501.8, 1512.4,
1523.0, 1533.6, 1544.0, 1554.6, 1565.1, 1575.4, 1585.6, 1596.0, 1606.2, 1616.6, 1626.8, 1636.9,
1647.0, 1656.8, 1667.0, 1677.1, 1687.2, 1697.0, 1706.8, 1716.6, 1726.4, 1736.3, 1745.9, 1755.5,
1765.3, 1774.9, 1784.4, 1793.7, 1803.4, 1812.8, 1822.1, 1831.7, 1841.0, 1850.3, 1859.3, 1868.0,
1878.5, 1886.8, 1895.8, 1904.6, 1914.0, 1923.1, 1932.0, 1940.8, 1949.6, 1958.4, 1967.1, 1975.8,
1984.5, 1993.3, 2001.8, 2010.4, 2019.0, 2027.5, 2036.0, 2044.4, 2052.8, 2061.1, 2069.5, 2077.8,
2086.1, 2094.4, 2102.5, 2110.8, 2119.0, 2127.1, 2135.2, 2143.2, 2151.1, 2159.3, 2167.3, 2175.1,
2183.2, 2190.8, 2198.9, 2206.6, 2214.3, 2222.2, 2229.8, 2237.6, 2245.2, 2252.8, 2260.6, 2268.0,
2275.8, 2283.3, 2290.6, 2298.3, 2305.5, 2312.9, 2320.6, 2327.6, 2335.2, 2342.6, 2349.6, 2357.0,
2364.4, 2371.3, 2378.5, 2385.8, 2392.8, 2399.8, 2407.3, 2414.2, 2421.0, 2428.4, 2435.3, 2442.2,
2448.9, 2456.3, 2462.8, 2469.4, 2476.8, 2483.6, 2490.0, 2496.9]
fwhm = [11.4, 10.6, 9.8, 9.4, 9.3, 9.2, 9.1, 9.1, 9.0, 9.0, 9.0, 9.0, 9.2, 9.3, 9.4, 9.5, 9.6, 9.7, 9.8, 10.0,
10.1, 10.2, 10.3, 10.4, 10.5, 10.8, 11.0, 11.0, 11.2, 11.2, 11.5, 11.6, 11.7, 11.8, 12.0, 12.1, 12.0,
12.4, 12.4, 12.4, 12.5, 12.6, 12.8, 12.7, 12.8, 12.8, 12.9, 12.9, 13.0, 13.0, 13.1, 13.1, 13.2, 13.1,
13.1, 13.1, 13.1, 12.9, 12.8, 13.2, 13.5, 13.0, 12.9, 10.9, 11.0, 12.0, 12.1, 12.2, 12.3, 12.7, 12.4,
13.0, 13.0, 13.3, 13.5, 13.7, 13.9, 14.0, 14.1, 14.1, 14.4, 14.0, 14.3, 14.1, 14.3, 14.7, 14.3, 14.4,
14.3, 14.6, 14.4, 14.7, 14.4, 14.7, 14.9, 14.6, 14.5, 14.4, 14.5, 14.6, 14.7, 14.4, 14.5, 15.1, 14.5,
14.8, 14.2, 14.4, 14.3, 14.1, 14.7, 13.9, 13.7, 14.2, 14.2, 14.0, 14.1, 14.0, 13.9, 13.9, 13.7, 13.9,
13.7, 13.6, 13.6, 13.6, 13.5, 13.7, 13.3, 13.2, 13.2, 12.6, 13.4, 12.9, 13.0, 13.1, 13.0, 12.7, 12.6,
12.7, 12.9, 12.9, 12.4, 12.3, 12.5, 12.5, 12.3, 12.2, 12.9, 12.2, 12.4, 12.4, 12.1, 11.1, 12.5, 11.6,
11.5, 12.5, 11.6, 12.0, 11.6, 11.8, 11.5, 11.4, 11.5, 11.4, 11.6, 11.2, 11.4, 11.2, 11.3, 11.0, 11.3,
10.9, 11.0, 10.9, 11.1, 10.9, 11.0, 10.8, 10.8, 10.8, 10.8, 10.6, 10.7, 10.5, 10.6, 10.8, 10.2, 10.7,
10.3, 10.3, 10.6, 10.1, 10.4, 10.1, 10.3, 10.3, 10.1, 10.2, 10.2, 9.9, 10.2, 9.8, 10.0, 10.0, 9.7, 10.1,
9.8, 9.7, 10.1, 9.6, 9.6, 10.0, 9.5, 9.5, 9.6, 9.7, 9.3, 9.6, 9.7, 9.0, 9.7, 9.5, 9.4, 8.8, 9.4, 9.5,
8.9, 9.1, 9.7, 9.0, 9.0, 9.5]
for w, f in zip(wavelength, fwhm):
responses[w] = f
Argument type: string
Acceptable values:
- String value
saveResponseFunction: Save spectral response function (optional)
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputResampledRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputResampledRaster: <outputRaster>
Output raster layer
Spectrally resample a spectral raster layer by applying spectral response function convolution, with spectral response function stored inside a spectral library. Each spectral profile defines a destination spectral band.
Parameters
- Spectral raster layer [raster]
- A spectral raster layer to be resampled.
- Spectral response function library [vector]
- A spectral response function library defining the destination sensor.
- Field with spectral profiles used as features [field]
- Field with spectral profiles used as spectral response functions. If not selected, the default field is used. If that is also not specified, an error is raised.
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpectralResamplingToResponseFunctionLibrary
:
----------------
Arguments
----------------
raster: Spectral raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
library: Spectral response function library
Argument type: vector
Acceptable values:
- Path to a vector layer
field: Field with spectral profiles used as features (optional)
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
outputResampledRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputResampledRaster: <outputRaster>
Output raster layer
Spectrally resample a spectral raster layer by applying spectral response function convolution. For more information see the Sentinel-2 missions website.
Parameters
- Spectral raster layer [raster]
- A spectral raster layer to be resampled.
- Spectral response function [string]
Python code specifying the spectral response function.
Default:
from collections import OrderedDict responses = OrderedDict() # responses['B1 - Coastal aerosol'] = [(412, 0.002), (413, 0.004), (414, 0.004), (415, 0.004), (416, 0.006), (417, 0.004), (418, 0.003), (419, 0.001), (420, 0.002), (421, 0.001), (422, 0.001), (423, 0.0), (424, 0.0), (425, 0.001), (426, 0.001), (427, 0.002), (428, 0.002), (429, 0.004), (430, 0.029), (431, 0.119), (432, 0.324), (433, 0.573), (434, 0.715), (435, 0.762), (436, 0.789), (437, 0.809), (438, 0.811), (439, 0.824), (440, 0.854), (441, 0.871), (442, 0.887), (443, 0.926), (444, 0.982), (445, 1.0), (446, 0.975), (447, 0.936), (448, 0.89), (449, 0.85), (450, 0.826), (451, 0.784), (452, 0.614), (453, 0.33), (454, 0.124), (455, 0.044), (456, 0.015)] responses['B2 - Blue'] = [(439, 0.01), (440, 0.03), (441, 0.027), (442, 0.024), (443, 0.02), (444, 0.023), (445, 0.025), (446, 0.017), (447, 0.021), (448, 0.016), (449, 0.021), (450, 0.018), (451, 0.018), (452, 0.018), (453, 0.019), (454, 0.019), (455, 0.027), (456, 0.043), (457, 0.072), (458, 0.154), (459, 0.328), (460, 0.553), (461, 0.71), (462, 0.753), (463, 0.752), (464, 0.757), (465, 0.763), (466, 0.762), (467, 0.785), (468, 0.815), (469, 0.862), (470, 0.893), (471, 0.92), (472, 0.919), (473, 0.913), (474, 0.9), (475, 0.89), (476, 0.882), (477, 0.876), (478, 0.884), (479, 0.907), (480, 0.932), (481, 0.939), (482, 0.944), (483, 0.922), (484, 0.886), (485, 0.847), (486, 0.813), (487, 0.782), (488, 0.773), (489, 0.772), (490, 0.787), (491, 0.812), (492, 0.846), (493, 0.888), (494, 0.928), (495, 0.951), (496, 0.966), (497, 0.969), (498, 0.966), (499, 0.958), (500, 0.954), (501, 0.952), (502, 0.957), (503, 0.966), (504, 0.977), (505, 0.977), (506, 0.974), (507, 0.959), (508, 0.935), (509, 0.902), (510, 0.872), (511, 0.844), (512, 0.823), (513, 0.815), (514, 0.821), (515, 0.84), (516, 0.87), (517, 0.915), (518, 0.961), (519, 0.992), (520, 1.0), (521, 0.984), (522, 0.911), (523, 0.74), (524, 0.504), (525, 0.305), (526, 0.18), (527, 0.107), (528, 0.066), (529, 0.042), (530, 0.027), (531, 0.014), (532, 0.003)] responses['B3 - Green'] = [(538, 0.014), (539, 0.034), (540, 0.073), (541, 0.154), (542, 0.317), (543, 0.553), (544, 0.749), (545, 0.849), (546, 0.898), (547, 0.922), (548, 0.926), (549, 0.911), (550, 0.888), (551, 0.865), (552, 0.847), (553, 0.839), (554, 0.845), (555, 0.862), (556, 0.888), (557, 0.924), (558, 0.96), (559, 0.987), (560, 1.0), (561, 0.999), (562, 0.981), (563, 0.945), (564, 0.898), (565, 0.856), (566, 0.818), (567, 0.789), (568, 0.765), (569, 0.75), (570, 0.751), (571, 0.761), (572, 0.782), (573, 0.799), (574, 0.81), (575, 0.814), (576, 0.774), (577, 0.629), (578, 0.404), (579, 0.215), (580, 0.107), (581, 0.048), (582, 0.018), (583, 0.001)] responses['B4 - Red'] = [(646, 0.001), (647, 0.026), (648, 0.117), (649, 0.391), (650, 0.75), (651, 0.945), (652, 0.98), (653, 0.994), (654, 1.0), (655, 0.995), (656, 0.991), (657, 0.977), (658, 0.941), (659, 0.879), (660, 0.816), (661, 0.773), (662, 0.754), (663, 0.76), (664, 0.783), (665, 0.81), (666, 0.836), (667, 0.861), (668, 0.886), (669, 0.911), (670, 0.934), (671, 0.95), (672, 0.959), (673, 0.96), (674, 0.959), (675, 0.958), (676, 0.955), (677, 0.944), (678, 0.895), (679, 0.744), (680, 0.477), (681, 0.23), (682, 0.08), (683, 0.026), (684, 0.004)] responses['B5 - Red edge 1'] = [(695, 0.028), (696, 0.124), (697, 0.394), (698, 0.761), (699, 0.971), (700, 0.999), (701, 1.0), (702, 0.994), (703, 0.983), (704, 0.967), (705, 0.948), (706, 0.927), (707, 0.904), (708, 0.886), (709, 0.867), (710, 0.791), (711, 0.588), (712, 0.263), (713, 0.057), (714, 0.006)] responses['B6 - Red edge 2'] = [(731, 0.002), (732, 0.055), (733, 0.258), (734, 0.647), (735, 0.892), (736, 0.902), (737, 0.915), (738, 0.941), (739, 0.963), (740, 0.975), (741, 0.977), (742, 0.987), (743, 1.0), (744, 0.989), (745, 0.972), (746, 0.901), (747, 0.607), (748, 0.205), (749, 0.027)] responses['B7 - Red edge 3'] = [(770, 0.012), (771, 0.052), (772, 0.166), (773, 0.369), (774, 0.637), (775, 0.861), (776, 0.97), (777, 0.991), (778, 0.999), (779, 1.0), (780, 0.977), (781, 0.926), (782, 0.866), (783, 0.82), (784, 0.794), (785, 0.791), (786, 0.804), (787, 0.819), (788, 0.826), (789, 0.82), (790, 0.792), (791, 0.721), (792, 0.588), (793, 0.414), (794, 0.231), (795, 0.099), (796, 0.027), (797, 0.005)] responses['B8 - NIR'] = [(774, 0.007), (775, 0.018), (776, 0.032), (777, 0.053), (778, 0.083), (779, 0.127), (780, 0.196), (781, 0.302), (782, 0.436), (783, 0.571), (784, 0.698), (785, 0.803), (786, 0.891), (787, 0.953), (788, 0.989), (789, 1.0), (790, 0.988), (791, 0.964), (792, 0.942), (793, 0.937), (794, 0.942), (795, 0.954), (796, 0.968), (797, 0.98), (798, 0.985), (799, 0.986), (800, 0.984), (801, 0.978), (802, 0.977), (803, 0.978), (804, 0.981), (805, 0.988), (806, 0.989), (807, 0.986), (808, 0.981), (809, 0.971), (810, 0.957), (811, 0.939), (812, 0.917), (813, 0.896), (814, 0.873), (815, 0.852), (816, 0.825), (817, 0.801), (818, 0.782), (819, 0.764), (820, 0.75), (821, 0.739), (822, 0.731), (823, 0.723), (824, 0.725), (825, 0.726), (826, 0.723), (827, 0.722), (828, 0.716), (829, 0.712), (830, 0.708), (831, 0.702), (832, 0.699), (833, 0.701), (834, 0.707), (835, 0.718), (836, 0.731), (837, 0.748), (838, 0.768), (839, 0.784), (840, 0.797), (841, 0.803), (842, 0.805), (843, 0.802), (844, 0.797), (845, 0.789), (846, 0.777), (847, 0.765), (848, 0.751), (849, 0.737), (850, 0.723), (851, 0.704), (852, 0.684), (853, 0.665), (854, 0.647), (855, 0.63), (856, 0.616), (857, 0.602), (858, 0.59), (859, 0.58), (860, 0.571), (861, 0.561), (862, 0.552), (863, 0.546), (864, 0.54), (865, 0.535), (866, 0.531), (867, 0.53), (868, 0.53), (869, 0.53), (870, 0.532), (871, 0.533), (872, 0.532), (873, 0.533), (874, 0.532), (875, 0.531), (876, 0.53), (877, 0.53), (878, 0.533), (879, 0.537), (880, 0.542), (881, 0.549), (882, 0.555), (883, 0.56), (884, 0.558), (885, 0.548), (886, 0.531), (887, 0.508), (888, 0.478), (889, 0.451), (890, 0.428), (891, 0.411), (892, 0.4), (893, 0.401), (894, 0.408), (895, 0.421), (896, 0.43), (897, 0.425), (898, 0.391), (899, 0.33), (900, 0.257), (901, 0.182), (902, 0.117), (903, 0.07), (904, 0.043), (905, 0.026), (906, 0.016), (907, 0.004)] responses['B8A - Narrow NIR'] = [(847, 0.002), (848, 0.002), (849, 0.013), (850, 0.026), (851, 0.053), (852, 0.108), (853, 0.222), (854, 0.397), (855, 0.61), (856, 0.817), (857, 0.932), (858, 0.972), (859, 0.975), (860, 0.975), (861, 0.973), (862, 0.976), (863, 0.98), (864, 0.987), (865, 0.991), (866, 0.997), (867, 1.0), (868, 0.999), (869, 0.996), (870, 0.995), (871, 1.0), (872, 0.996), (873, 0.924), (874, 0.741), (875, 0.49), (876, 0.25), (877, 0.112), (878, 0.048), (879, 0.023), (880, 0.011), (881, 0.001)] # responses['B9 - Water vapour'] = [(932, 0.017), (933, 0.061), (934, 0.174), (935, 0.389), (936, 0.665), (937, 0.875), (938, 0.937), (939, 0.968), (940, 0.989), (941, 0.995), (942, 1.0), (943, 0.978), (944, 0.981), (945, 0.992), (946, 0.988), (947, 0.994), (948, 0.983), (949, 0.978), (950, 0.95), (951, 0.953), (952, 0.922), (953, 0.856), (954, 0.71), (955, 0.464), (956, 0.215), (957, 0.065), (958, 0.016)] # responses['B10 - Cirrus'] = [(1350, 0.001), (1351, 0.002), (1352, 0.004), (1353, 0.008), (1354, 0.019), (1355, 0.045), (1356, 0.102), (1357, 0.201), (1358, 0.342), (1359, 0.506), (1360, 0.662), (1361, 0.783), (1362, 0.861), (1363, 0.91), (1364, 0.942), (1365, 0.962), (1366, 0.974), (1367, 0.982), (1368, 0.988), (1369, 0.993), (1370, 0.996), (1371, 0.999), (1372, 1.0), (1373, 0.999), (1374, 0.996), (1375, 0.991), (1376, 0.985), (1377, 0.978), (1378, 0.97), (1379, 0.961), (1380, 0.949), (1381, 0.933), (1382, 0.915), (1383, 0.894), (1384, 0.869), (1385, 0.831), (1386, 0.765), (1387, 0.655), (1388, 0.508), (1389, 0.351), (1390, 0.219), (1391, 0.127), (1392, 0.068), (1393, 0.033), (1394, 0.014), (1395, 0.005), (1396, 0.002), (1397, 0.001)] responses['B11 - SWIR-1'] = [(1551, 0.001), (1552, 0.002), (1553, 0.002), (1554, 0.004), (1555, 0.005), (1556, 0.008), (1557, 0.013), (1558, 0.019), (1559, 0.028), (1560, 0.04), (1561, 0.055), (1562, 0.075), (1563, 0.101), (1564, 0.135), (1565, 0.183), (1566, 0.247), (1567, 0.331), (1568, 0.43), (1569, 0.538), (1570, 0.647), (1571, 0.744), (1572, 0.815), (1573, 0.859), (1574, 0.88), (1575, 0.887), (1576, 0.889), (1577, 0.891), (1578, 0.898), (1579, 0.907), (1580, 0.917), (1581, 0.927), (1582, 0.935), (1583, 0.942), (1584, 0.948), (1585, 0.951), (1586, 0.954), (1587, 0.956), (1588, 0.958), (1589, 0.961), (1590, 0.963), (1591, 0.966), (1592, 0.968), (1593, 0.971), (1594, 0.973), (1595, 0.976), (1596, 0.979), (1597, 0.98), (1598, 0.981), (1599, 0.981), (1600, 0.981), (1601, 0.981), (1602, 0.981), (1603, 0.98), (1604, 0.981), (1605, 0.983), (1606, 0.985), (1607, 0.988), (1608, 0.99), (1609, 0.992), (1610, 0.993), (1611, 0.993), (1612, 0.99), (1613, 0.987), (1614, 0.984), (1615, 0.98), (1616, 0.976), (1617, 0.973), (1618, 0.97), (1619, 0.968), (1620, 0.966), (1621, 0.966), (1622, 0.966), (1623, 0.967), (1624, 0.97), (1625, 0.973), (1626, 0.979), (1627, 0.983), (1628, 0.988), (1629, 0.992), (1630, 0.995), (1631, 0.998), (1632, 0.999), (1633, 0.999), (1634, 0.999), (1635, 0.999), (1636, 0.999), (1637, 1.0), (1638, 1.0), (1639, 1.0), (1640, 1.0), (1641, 0.997), (1642, 0.992), (1643, 0.986), (1644, 0.979), (1645, 0.97), (1646, 0.961), (1647, 0.953), (1648, 0.947), (1649, 0.942), (1650, 0.939), (1651, 0.935), (1652, 0.928), (1653, 0.912), (1654, 0.881), (1655, 0.825), (1656, 0.743), (1657, 0.642), (1658, 0.534), (1659, 0.427), (1660, 0.324), (1661, 0.234), (1662, 0.164), (1663, 0.11), (1664, 0.072), (1665, 0.046), (1666, 0.029), (1667, 0.019), (1668, 0.013), (1669, 0.009), (1670, 0.007), (1671, 0.005), (1672, 0.003), (1673, 0.002), (1674, 0.002), (1675, 0.001), (1676, 0.001)] responses['B12 - SWIR-2'] = [(2079, 0.001), (2080, 0.003), (2081, 0.004), (2082, 0.007), (2083, 0.008), (2084, 0.008), (2085, 0.009), (2086, 0.009), (2087, 0.01), (2088, 0.011), (2089, 0.012), (2090, 0.013), (2091, 0.015), (2092, 0.017), (2093, 0.02), (2094, 0.023), (2095, 0.028), (2096, 0.033), (2097, 0.04), (2098, 0.049), (2099, 0.06), (2100, 0.073), (2101, 0.091), (2102, 0.111), (2103, 0.137), (2104, 0.168), (2105, 0.203), (2106, 0.243), (2107, 0.285), (2108, 0.327), (2109, 0.368), (2110, 0.408), (2111, 0.445), (2112, 0.477), (2113, 0.503), (2114, 0.525), (2115, 0.543), (2116, 0.557), (2117, 0.569), (2118, 0.579), (2119, 0.589), (2120, 0.599), (2121, 0.61), (2122, 0.621), (2123, 0.634), (2124, 0.649), (2125, 0.664), (2126, 0.68), (2127, 0.696), (2128, 0.712), (2129, 0.727), (2130, 0.741), (2131, 0.757), (2132, 0.772), (2133, 0.786), (2134, 0.798), (2135, 0.81), (2136, 0.82), (2137, 0.829), (2138, 0.837), (2139, 0.844), (2140, 0.851), (2141, 0.853), (2142, 0.855), (2143, 0.856), (2144, 0.858), (2145, 0.86), (2146, 0.861), (2147, 0.863), (2148, 0.865), (2149, 0.867), (2150, 0.87), (2151, 0.874), (2152, 0.879), (2153, 0.882), (2154, 0.886), (2155, 0.889), (2156, 0.893), (2157, 0.897), (2158, 0.9), (2159, 0.903), (2160, 0.905), (2161, 0.906), (2162, 0.906), (2163, 0.906), (2164, 0.905), (2165, 0.905), (2166, 0.904), (2167, 0.903), (2168, 0.903), (2169, 0.902), (2170, 0.902), (2171, 0.903), (2172, 0.904), (2173, 0.905), (2174, 0.906), (2175, 0.908), (2176, 0.91), (2177, 0.913), (2178, 0.916), (2179, 0.918), (2180, 0.921), (2181, 0.924), (2182, 0.927), (2183, 0.93), (2184, 0.932), (2185, 0.934), (2186, 0.936), (2187, 0.937), (2188, 0.938), (2189, 0.938), (2190, 0.938), (2191, 0.94), (2192, 0.943), (2193, 0.943), (2194, 0.943), (2195, 0.942), (2196, 0.941), (2197, 0.938), (2198, 0.937), (2199, 0.935), (2200, 0.933), (2201, 0.927), (2202, 0.921), (2203, 0.915), (2204, 0.911), (2205, 0.908), (2206, 0.907), (2207, 0.908), (2208, 0.911), (2209, 0.916), (2210, 0.923), (2211, 0.921), (2212, 0.919), (2213, 0.919), (2214, 0.921), (2215, 0.925), (2216, 0.928), (2217, 0.932), (2218, 0.937), (2219, 0.941), (2220, 0.947), (2221, 0.951), (2222, 0.954), (2223, 0.957), (2224, 0.96), (2225, 0.963), (2226, 0.965), (2227, 0.966), (2228, 0.967), (2229, 0.966), (2230, 0.965), (2231, 0.965), (2232, 0.964), (2233, 0.962), (2234, 0.959), (2235, 0.957), (2236, 0.955), (2237, 0.954), (2238, 0.953), (2239, 0.952), (2240, 0.952), (2241, 0.952), (2242, 0.953), (2243, 0.954), (2244, 0.957), (2245, 0.961), (2246, 0.964), (2247, 0.968), (2248, 0.973), (2249, 0.977), (2250, 0.983), (2251, 0.987), (2252, 0.991), (2253, 0.994), (2254, 0.997), (2255, 0.999), (2256, 1.0), (2257, 1.0), (2258, 0.999), (2259, 0.997), (2260, 0.994), (2261, 0.99), (2262, 0.984), (2263, 0.976), (2264, 0.968), (2265, 0.958), (2266, 0.948), (2267, 0.938), (2268, 0.928), (2269, 0.917), (2270, 0.906), (2271, 0.894), (2272, 0.882), (2273, 0.869), (2274, 0.855), (2275, 0.841), (2276, 0.826), (2277, 0.81), (2278, 0.792), (2279, 0.772), (2280, 0.749), (2281, 0.72), (2282, 0.688), (2283, 0.651), (2284, 0.61), (2285, 0.566), (2286, 0.521), (2287, 0.475), (2288, 0.429), (2289, 0.386), (2290, 0.342), (2291, 0.301), (2292, 0.263), (2293, 0.228), (2294, 0.196), (2295, 0.168), (2296, 0.145), (2297, 0.125), (2298, 0.108), (2299, 0.094), (2300, 0.082), (2301, 0.072), (2302, 0.063), (2303, 0.055), (2304, 0.048), (2305, 0.043), (2306, 0.039), (2307, 0.035), (2308, 0.032), (2309, 0.03), (2310, 0.027), (2311, 0.026), (2312, 0.024), (2313, 0.022), (2314, 0.019), (2315, 0.016), (2316, 0.011), (2317, 0.007), (2318, 0.007), (2319, 0.005), (2320, 0.002)]
- Save spectral response function [boolean]
Whether to save the spectral response function library as *.srf.gpkg sidecar file.
Default: False
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpectralResamplingToSentinel2Msi
:
----------------
Arguments
----------------
raster: Spectral raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
response: Spectral response function
Default value: from collections import OrderedDict
responses = OrderedDict()
# responses['B1 - Coastal aerosol'] = [(412, 0.002), (413, 0.004), (414, 0.004), (415, 0.004), (416, 0.006), (417, 0.004), (418, 0.003), (419, 0.001), (420, 0.002), (421, 0.001), (422, 0.001), (423, 0.0), (424, 0.0), (425, 0.001), (426, 0.001), (427, 0.002), (428, 0.002), (429, 0.004), (430, 0.029), (431, 0.119), (432, 0.324), (433, 0.573), (434, 0.715), (435, 0.762), (436, 0.789), (437, 0.809), (438, 0.811), (439, 0.824), (440, 0.854), (441, 0.871), (442, 0.887), (443, 0.926), (444, 0.982), (445, 1.0), (446, 0.975), (447, 0.936), (448, 0.89), (449, 0.85), (450, 0.826), (451, 0.784), (452, 0.614), (453, 0.33), (454, 0.124), (455, 0.044), (456, 0.015)]
responses['B2 - Blue'] = [(439, 0.01), (440, 0.03), (441, 0.027), (442, 0.024), (443, 0.02), (444, 0.023),
(445, 0.025), (446, 0.017), (447, 0.021), (448, 0.016), (449, 0.021), (450, 0.018),
(451, 0.018), (452, 0.018), (453, 0.019), (454, 0.019), (455, 0.027), (456, 0.043),
(457, 0.072), (458, 0.154), (459, 0.328), (460, 0.553), (461, 0.71), (462, 0.753),
(463, 0.752), (464, 0.757), (465, 0.763), (466, 0.762), (467, 0.785), (468, 0.815),
(469, 0.862), (470, 0.893), (471, 0.92), (472, 0.919), (473, 0.913), (474, 0.9),
(475, 0.89), (476, 0.882), (477, 0.876), (478, 0.884), (479, 0.907), (480, 0.932),
(481, 0.939), (482, 0.944), (483, 0.922), (484, 0.886), (485, 0.847), (486, 0.813),
(487, 0.782), (488, 0.773), (489, 0.772), (490, 0.787), (491, 0.812), (492, 0.846),
(493, 0.888), (494, 0.928), (495, 0.951), (496, 0.966), (497, 0.969), (498, 0.966),
(499, 0.958), (500, 0.954), (501, 0.952), (502, 0.957), (503, 0.966), (504, 0.977),
(505, 0.977), (506, 0.974), (507, 0.959), (508, 0.935), (509, 0.902), (510, 0.872),
(511, 0.844), (512, 0.823), (513, 0.815), (514, 0.821), (515, 0.84), (516, 0.87),
(517, 0.915), (518, 0.961), (519, 0.992), (520, 1.0), (521, 0.984), (522, 0.911),
(523, 0.74), (524, 0.504), (525, 0.305), (526, 0.18), (527, 0.107), (528, 0.066),
(529, 0.042), (530, 0.027), (531, 0.014), (532, 0.003)]
responses['B3 - Green'] = [(538, 0.014), (539, 0.034), (540, 0.073), (541, 0.154), (542, 0.317), (543, 0.553),
(544, 0.749), (545, 0.849), (546, 0.898), (547, 0.922), (548, 0.926), (549, 0.911),
(550, 0.888), (551, 0.865), (552, 0.847), (553, 0.839), (554, 0.845), (555, 0.862),
(556, 0.888), (557, 0.924), (558, 0.96), (559, 0.987), (560, 1.0), (561, 0.999),
(562, 0.981), (563, 0.945), (564, 0.898), (565, 0.856), (566, 0.818), (567, 0.789),
(568, 0.765), (569, 0.75), (570, 0.751), (571, 0.761), (572, 0.782), (573, 0.799),
(574, 0.81), (575, 0.814), (576, 0.774), (577, 0.629), (578, 0.404), (579, 0.215),
(580, 0.107), (581, 0.048), (582, 0.018), (583, 0.001)]
responses['B4 - Red'] = [(646, 0.001), (647, 0.026), (648, 0.117), (649, 0.391), (650, 0.75), (651, 0.945),
(652, 0.98), (653, 0.994), (654, 1.0), (655, 0.995), (656, 0.991), (657, 0.977),
(658, 0.941), (659, 0.879), (660, 0.816), (661, 0.773), (662, 0.754), (663, 0.76),
(664, 0.783), (665, 0.81), (666, 0.836), (667, 0.861), (668, 0.886), (669, 0.911),
(670, 0.934), (671, 0.95), (672, 0.959), (673, 0.96), (674, 0.959), (675, 0.958),
(676, 0.955), (677, 0.944), (678, 0.895), (679, 0.744), (680, 0.477), (681, 0.23),
(682, 0.08), (683, 0.026), (684, 0.004)]
responses['B5 - Red edge 1'] = [(695, 0.028), (696, 0.124), (697, 0.394), (698, 0.761), (699, 0.971),
(700, 0.999), (701, 1.0), (702, 0.994), (703, 0.983), (704, 0.967),
(705, 0.948), (706, 0.927), (707, 0.904), (708, 0.886), (709, 0.867),
(710, 0.791), (711, 0.588), (712, 0.263), (713, 0.057), (714, 0.006)]
responses['B6 - Red edge 2'] = [(731, 0.002), (732, 0.055), (733, 0.258), (734, 0.647), (735, 0.892),
(736, 0.902), (737, 0.915), (738, 0.941), (739, 0.963), (740, 0.975),
(741, 0.977), (742, 0.987), (743, 1.0), (744, 0.989), (745, 0.972),
(746, 0.901), (747, 0.607), (748, 0.205), (749, 0.027)]
responses['B7 - Red edge 3'] = [(770, 0.012), (771, 0.052), (772, 0.166), (773, 0.369), (774, 0.637),
(775, 0.861), (776, 0.97), (777, 0.991), (778, 0.999), (779, 1.0), (780, 0.977),
(781, 0.926), (782, 0.866), (783, 0.82), (784, 0.794), (785, 0.791),
(786, 0.804), (787, 0.819), (788, 0.826), (789, 0.82), (790, 0.792),
(791, 0.721), (792, 0.588), (793, 0.414), (794, 0.231), (795, 0.099),
(796, 0.027), (797, 0.005)]
responses['B8 - NIR'] = [(774, 0.007), (775, 0.018), (776, 0.032), (777, 0.053), (778, 0.083), (779, 0.127),
(780, 0.196), (781, 0.302), (782, 0.436), (783, 0.571), (784, 0.698), (785, 0.803),
(786, 0.891), (787, 0.953), (788, 0.989), (789, 1.0), (790, 0.988), (791, 0.964),
(792, 0.942), (793, 0.937), (794, 0.942), (795, 0.954), (796, 0.968), (797, 0.98),
(798, 0.985), (799, 0.986), (800, 0.984), (801, 0.978), (802, 0.977), (803, 0.978),
(804, 0.981), (805, 0.988), (806, 0.989), (807, 0.986), (808, 0.981), (809, 0.971),
(810, 0.957), (811, 0.939), (812, 0.917), (813, 0.896), (814, 0.873), (815, 0.852),
(816, 0.825), (817, 0.801), (818, 0.782), (819, 0.764), (820, 0.75), (821, 0.739),
(822, 0.731), (823, 0.723), (824, 0.725), (825, 0.726), (826, 0.723), (827, 0.722),
(828, 0.716), (829, 0.712), (830, 0.708), (831, 0.702), (832, 0.699), (833, 0.701),
(834, 0.707), (835, 0.718), (836, 0.731), (837, 0.748), (838, 0.768), (839, 0.784),
(840, 0.797), (841, 0.803), (842, 0.805), (843, 0.802), (844, 0.797), (845, 0.789),
(846, 0.777), (847, 0.765), (848, 0.751), (849, 0.737), (850, 0.723), (851, 0.704),
(852, 0.684), (853, 0.665), (854, 0.647), (855, 0.63), (856, 0.616), (857, 0.602),
(858, 0.59), (859, 0.58), (860, 0.571), (861, 0.561), (862, 0.552), (863, 0.546),
(864, 0.54), (865, 0.535), (866, 0.531), (867, 0.53), (868, 0.53), (869, 0.53),
(870, 0.532), (871, 0.533), (872, 0.532), (873, 0.533), (874, 0.532), (875, 0.531),
(876, 0.53), (877, 0.53), (878, 0.533), (879, 0.537), (880, 0.542), (881, 0.549),
(882, 0.555), (883, 0.56), (884, 0.558), (885, 0.548), (886, 0.531), (887, 0.508),
(888, 0.478), (889, 0.451), (890, 0.428), (891, 0.411), (892, 0.4), (893, 0.401),
(894, 0.408), (895, 0.421), (896, 0.43), (897, 0.425), (898, 0.391), (899, 0.33),
(900, 0.257), (901, 0.182), (902, 0.117), (903, 0.07), (904, 0.043), (905, 0.026),
(906, 0.016), (907, 0.004)]
responses['B8A - Narrow NIR'] = [(847, 0.002), (848, 0.002), (849, 0.013), (850, 0.026), (851, 0.053),
(852, 0.108), (853, 0.222), (854, 0.397), (855, 0.61), (856, 0.817),
(857, 0.932), (858, 0.972), (859, 0.975), (860, 0.975), (861, 0.973),
(862, 0.976), (863, 0.98), (864, 0.987), (865, 0.991), (866, 0.997),
(867, 1.0), (868, 0.999), (869, 0.996), (870, 0.995), (871, 1.0), (872, 0.996),
(873, 0.924), (874, 0.741), (875, 0.49), (876, 0.25), (877, 0.112),
(878, 0.048), (879, 0.023), (880, 0.011), (881, 0.001)]
# responses['B9 - Water vapour'] = [(932, 0.017), (933, 0.061), (934, 0.174), (935, 0.389), (936, 0.665), (937, 0.875), (938, 0.937), (939, 0.968), (940, 0.989), (941, 0.995), (942, 1.0), (943, 0.978), (944, 0.981), (945, 0.992), (946, 0.988), (947, 0.994), (948, 0.983), (949, 0.978), (950, 0.95), (951, 0.953), (952, 0.922), (953, 0.856), (954, 0.71), (955, 0.464), (956, 0.215), (957, 0.065), (958, 0.016)]
# responses['B10 - Cirrus'] = [(1350, 0.001), (1351, 0.002), (1352, 0.004), (1353, 0.008), (1354, 0.019), (1355, 0.045), (1356, 0.102), (1357, 0.201), (1358, 0.342), (1359, 0.506), (1360, 0.662), (1361, 0.783), (1362, 0.861), (1363, 0.91), (1364, 0.942), (1365, 0.962), (1366, 0.974), (1367, 0.982), (1368, 0.988), (1369, 0.993), (1370, 0.996), (1371, 0.999), (1372, 1.0), (1373, 0.999), (1374, 0.996), (1375, 0.991), (1376, 0.985), (1377, 0.978), (1378, 0.97), (1379, 0.961), (1380, 0.949), (1381, 0.933), (1382, 0.915), (1383, 0.894), (1384, 0.869), (1385, 0.831), (1386, 0.765), (1387, 0.655), (1388, 0.508), (1389, 0.351), (1390, 0.219), (1391, 0.127), (1392, 0.068), (1393, 0.033), (1394, 0.014), (1395, 0.005), (1396, 0.002), (1397, 0.001)]
responses['B11 - SWIR-1'] = [(1551, 0.001), (1552, 0.002), (1553, 0.002), (1554, 0.004), (1555, 0.005),
(1556, 0.008), (1557, 0.013), (1558, 0.019), (1559, 0.028), (1560, 0.04),
(1561, 0.055), (1562, 0.075), (1563, 0.101), (1564, 0.135), (1565, 0.183),
(1566, 0.247), (1567, 0.331), (1568, 0.43), (1569, 0.538), (1570, 0.647),
(1571, 0.744), (1572, 0.815), (1573, 0.859), (1574, 0.88), (1575, 0.887),
(1576, 0.889), (1577, 0.891), (1578, 0.898), (1579, 0.907), (1580, 0.917),
(1581, 0.927), (1582, 0.935), (1583, 0.942), (1584, 0.948), (1585, 0.951),
(1586, 0.954), (1587, 0.956), (1588, 0.958), (1589, 0.961), (1590, 0.963),
(1591, 0.966), (1592, 0.968), (1593, 0.971), (1594, 0.973), (1595, 0.976),
(1596, 0.979), (1597, 0.98), (1598, 0.981), (1599, 0.981), (1600, 0.981),
(1601, 0.981), (1602, 0.981), (1603, 0.98), (1604, 0.981), (1605, 0.983),
(1606, 0.985), (1607, 0.988), (1608, 0.99), (1609, 0.992), (1610, 0.993),
(1611, 0.993), (1612, 0.99), (1613, 0.987), (1614, 0.984), (1615, 0.98),
(1616, 0.976), (1617, 0.973), (1618, 0.97), (1619, 0.968), (1620, 0.966),
(1621, 0.966), (1622, 0.966), (1623, 0.967), (1624, 0.97), (1625, 0.973),
(1626, 0.979), (1627, 0.983), (1628, 0.988), (1629, 0.992), (1630, 0.995),
(1631, 0.998), (1632, 0.999), (1633, 0.999), (1634, 0.999), (1635, 0.999),
(1636, 0.999), (1637, 1.0), (1638, 1.0), (1639, 1.0), (1640, 1.0), (1641, 0.997),
(1642, 0.992), (1643, 0.986), (1644, 0.979), (1645, 0.97), (1646, 0.961),
(1647, 0.953), (1648, 0.947), (1649, 0.942), (1650, 0.939), (1651, 0.935),
(1652, 0.928), (1653, 0.912), (1654, 0.881), (1655, 0.825), (1656, 0.743),
(1657, 0.642), (1658, 0.534), (1659, 0.427), (1660, 0.324), (1661, 0.234),
(1662, 0.164), (1663, 0.11), (1664, 0.072), (1665, 0.046), (1666, 0.029),
(1667, 0.019), (1668, 0.013), (1669, 0.009), (1670, 0.007), (1671, 0.005),
(1672, 0.003), (1673, 0.002), (1674, 0.002), (1675, 0.001), (1676, 0.001)]
responses['B12 - SWIR-2'] = [(2079, 0.001), (2080, 0.003), (2081, 0.004), (2082, 0.007), (2083, 0.008),
(2084, 0.008), (2085, 0.009), (2086, 0.009), (2087, 0.01), (2088, 0.011),
(2089, 0.012), (2090, 0.013), (2091, 0.015), (2092, 0.017), (2093, 0.02),
(2094, 0.023), (2095, 0.028), (2096, 0.033), (2097, 0.04), (2098, 0.049),
(2099, 0.06), (2100, 0.073), (2101, 0.091), (2102, 0.111), (2103, 0.137),
(2104, 0.168), (2105, 0.203), (2106, 0.243), (2107, 0.285), (2108, 0.327),
(2109, 0.368), (2110, 0.408), (2111, 0.445), (2112, 0.477), (2113, 0.503),
(2114, 0.525), (2115, 0.543), (2116, 0.557), (2117, 0.569), (2118, 0.579),
(2119, 0.589), (2120, 0.599), (2121, 0.61), (2122, 0.621), (2123, 0.634),
(2124, 0.649), (2125, 0.664), (2126, 0.68), (2127, 0.696), (2128, 0.712),
(2129, 0.727), (2130, 0.741), (2131, 0.757), (2132, 0.772), (2133, 0.786),
(2134, 0.798), (2135, 0.81), (2136, 0.82), (2137, 0.829), (2138, 0.837),
(2139, 0.844), (2140, 0.851), (2141, 0.853), (2142, 0.855), (2143, 0.856),
(2144, 0.858), (2145, 0.86), (2146, 0.861), (2147, 0.863), (2148, 0.865),
(2149, 0.867), (2150, 0.87), (2151, 0.874), (2152, 0.879), (2153, 0.882),
(2154, 0.886), (2155, 0.889), (2156, 0.893), (2157, 0.897), (2158, 0.9),
(2159, 0.903), (2160, 0.905), (2161, 0.906), (2162, 0.906), (2163, 0.906),
(2164, 0.905), (2165, 0.905), (2166, 0.904), (2167, 0.903), (2168, 0.903),
(2169, 0.902), (2170, 0.902), (2171, 0.903), (2172, 0.904), (2173, 0.905),
(2174, 0.906), (2175, 0.908), (2176, 0.91), (2177, 0.913), (2178, 0.916),
(2179, 0.918), (2180, 0.921), (2181, 0.924), (2182, 0.927), (2183, 0.93),
(2184, 0.932), (2185, 0.934), (2186, 0.936), (2187, 0.937), (2188, 0.938),
(2189, 0.938), (2190, 0.938), (2191, 0.94), (2192, 0.943), (2193, 0.943),
(2194, 0.943), (2195, 0.942), (2196, 0.941), (2197, 0.938), (2198, 0.937),
(2199, 0.935), (2200, 0.933), (2201, 0.927), (2202, 0.921), (2203, 0.915),
(2204, 0.911), (2205, 0.908), (2206, 0.907), (2207, 0.908), (2208, 0.911),
(2209, 0.916), (2210, 0.923), (2211, 0.921), (2212, 0.919), (2213, 0.919),
(2214, 0.921), (2215, 0.925), (2216, 0.928), (2217, 0.932), (2218, 0.937),
(2219, 0.941), (2220, 0.947), (2221, 0.951), (2222, 0.954), (2223, 0.957),
(2224, 0.96), (2225, 0.963), (2226, 0.965), (2227, 0.966), (2228, 0.967),
(2229, 0.966), (2230, 0.965), (2231, 0.965), (2232, 0.964), (2233, 0.962),
(2234, 0.959), (2235, 0.957), (2236, 0.955), (2237, 0.954), (2238, 0.953),
(2239, 0.952), (2240, 0.952), (2241, 0.952), (2242, 0.953), (2243, 0.954),
(2244, 0.957), (2245, 0.961), (2246, 0.964), (2247, 0.968), (2248, 0.973),
(2249, 0.977), (2250, 0.983), (2251, 0.987), (2252, 0.991), (2253, 0.994),
(2254, 0.997), (2255, 0.999), (2256, 1.0), (2257, 1.0), (2258, 0.999),
(2259, 0.997), (2260, 0.994), (2261, 0.99), (2262, 0.984), (2263, 0.976),
(2264, 0.968), (2265, 0.958), (2266, 0.948), (2267, 0.938), (2268, 0.928),
(2269, 0.917), (2270, 0.906), (2271, 0.894), (2272, 0.882), (2273, 0.869),
(2274, 0.855), (2275, 0.841), (2276, 0.826), (2277, 0.81), (2278, 0.792),
(2279, 0.772), (2280, 0.749), (2281, 0.72), (2282, 0.688), (2283, 0.651),
(2284, 0.61), (2285, 0.566), (2286, 0.521), (2287, 0.475), (2288, 0.429),
(2289, 0.386), (2290, 0.342), (2291, 0.301), (2292, 0.263), (2293, 0.228),
(2294, 0.196), (2295, 0.168), (2296, 0.145), (2297, 0.125), (2298, 0.108),
(2299, 0.094), (2300, 0.082), (2301, 0.072), (2302, 0.063), (2303, 0.055),
(2304, 0.048), (2305, 0.043), (2306, 0.039), (2307, 0.035), (2308, 0.032),
(2309, 0.03), (2310, 0.027), (2311, 0.026), (2312, 0.024), (2313, 0.022),
(2314, 0.019), (2315, 0.016), (2316, 0.011), (2317, 0.007), (2318, 0.007),
(2319, 0.005), (2320, 0.002)]
Argument type: string
Acceptable values:
- String value
saveResponseFunction: Save spectral response function (optional)
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputResampledRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputResampledRaster: <outputRaster>
Output raster layer
Spectrally resample a spectral raster layer by applying spectral response function convolution, with spectral response function derived from wavelength and FWHM information stored inside a spectral raster layer.
Parameters
- Spectral raster layer [raster]
- A spectral raster layer to be resampled.
- Spectral raster layer with wavelength and FWHM [raster]
- A spectral raster layer with center wavelength and FWHM information defining the destination sensor.
- Save spectral response function [boolean]
Whether to save the spectral response function library as *.srf.gpkg sidecar file.
Default: False
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:SpectralResamplingToSpectralRasterLayerWavelengthAndFwhm
:
----------------
Arguments
----------------
raster: Spectral raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
responseRaster: Spectral raster layer with wavelength and FWHM
Argument type: raster
Acceptable values:
- Path to a raster layer
saveResponseFunction: Save spectral response function (optional)
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputResampledRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputResampledRaster: <outputRaster>
Output raster layer
Transformation¶
Factor Analysis. A simple linear generative model with Gaussian latent variables. The observations are assumed to be caused by a linear transformation of lower dimensional latent factors and added Gaussian noise. Without loss of generality the factors are distributed according to a Gaussian with zero mean and unit covariance. The noise is also zero mean and has an arbitrary diagonal covariance matrix. If we would restrict the model further, by assuming that the Gaussian noise is even isotropic (all diagonal entries are the same) we would obtain ProbabilisticPCA. FactorAnalysis performs a maximum likelihood estimate of the so-called loading matrix, the transformation of the latent variables to the observed ones, using SVD based approach.
Parameters
- Transformer [string]
Scikit-learn python code. See FactorAnalysis for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from sklearn.decomposition import FactorAnalysis factorAnalysis = FactorAnalysis(n_components=3) transformer = make_pipeline(StandardScaler(), factorAnalysis)
- Raster layer with features [raster]
- Raster layer with feature data X used for fitting the transformer. Mutually exclusive with parameter: Training dataset
- Sample size [number]
Approximate number of samples drawn from raster. If 0, whole raster will be used. Note that this is only a hint for limiting the number of rows and columns.
Default: 1000
- Training dataset [file]
- Training dataset pickle file used for fitting the transformer. Mutually exclusive with parameter: Raster layer with features
Outputs
- Output transformer [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitFactoranalysis
:
----------------
Arguments
----------------
transformer: Transformer
Default value: from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import FactorAnalysis
factorAnalysis = FactorAnalysis(n_components=3)
transformer = make_pipeline(StandardScaler(), factorAnalysis)
Argument type: string
Acceptable values:
- String value
featureRaster: Raster layer with features (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
sampleSize: Sample size (optional)
Default value: 1000
Argument type: number
Acceptable values:
- A numeric value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputTransformer: Output transformer
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputTransformer: <outputFile>
Output transformer
FastICA: a fast algorithm for Independent Component Analysis.
Parameters
- Transformer [string]
Scikit-learn python code. See FastICA for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from sklearn.decomposition import FastICA fastICA = FastICA(n_components=3) transformer = make_pipeline(StandardScaler(), fastICA)
- Raster layer with features [raster]
- Raster layer with feature data X used for fitting the transformer. Mutually exclusive with parameter: Training dataset
- Sample size [number]
Approximate number of samples drawn from raster. If 0, whole raster will be used. Note that this is only a hint for limiting the number of rows and columns.
Default: 1000
- Training dataset [file]
- Training dataset pickle file used for fitting the transformer. Mutually exclusive with parameter: Raster layer with features
Outputs
- Output transformer [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitFastica
:
----------------
Arguments
----------------
transformer: Transformer
Default value: from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import FastICA
fastICA = FastICA(n_components=3)
transformer = make_pipeline(StandardScaler(), fastICA)
Argument type: string
Acceptable values:
- String value
featureRaster: Raster layer with features (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
sampleSize: Sample size (optional)
Default value: 1000
Argument type: number
Acceptable values:
- A numeric value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputTransformer: Output transformer
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputTransformer: <outputFile>
Output transformer
Agglomerate features. Recursively merges pair of clusters of features.
Parameters
- Transformer [string]
Scikit-learn python code. See FeatureAgglomeration for information on different parameters.
Default:
from sklearn.cluster import FeatureAgglomeration transformer = FeatureAgglomeration(n_clusters=3)
- Raster layer with features [raster]
- Raster layer with feature data X used for fitting the transformer. Mutually exclusive with parameter: Training dataset
- Sample size [number]
Approximate number of samples drawn from raster. If 0, whole raster will be used. Note that this is only a hint for limiting the number of rows and columns.
Default: 1000
- Training dataset [file]
- Training dataset pickle file used for fitting the transformer. Mutually exclusive with parameter: Raster layer with features
Outputs
- Output transformer [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitFeatureagglomeration
:
----------------
Arguments
----------------
transformer: Transformer
Default value: from sklearn.cluster import FeatureAgglomeration
transformer = FeatureAgglomeration(n_clusters=3)
Argument type: string
Acceptable values:
- String value
featureRaster: Raster layer with features (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
sampleSize: Sample size (optional)
Default value: 1000
Argument type: number
Acceptable values:
- A numeric value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputTransformer: Output transformer
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputTransformer: <outputFile>
Output transformer
Kernel Principal component analysis (KPCA). Non-linear dimensionality reduction through the use of kernels
Parameters
- Transformer [string]
Scikit-learn python code. See PCA for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from sklearn.decomposition import KernelPCA kernelPCA = KernelPCA(n_components=3, fit_inverse_transform=True) transformer = make_pipeline(StandardScaler(), kernelPCA)
- Raster layer with features [raster]
- Raster layer with feature data X used for fitting the transformer. Mutually exclusive with parameter: Training dataset
- Sample size [number]
Approximate number of samples drawn from raster. If 0, whole raster will be used. Note that this is only a hint for limiting the number of rows and columns.
Default: 1000
- Training dataset [file]
- Training dataset pickle file used for fitting the transformer. Mutually exclusive with parameter: Raster layer with features
Outputs
- Output transformer [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitKernelpca
:
----------------
Arguments
----------------
transformer: Transformer
Default value: from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import KernelPCA
kernelPCA = KernelPCA(n_components=3, fit_inverse_transform=True)
transformer = make_pipeline(StandardScaler(), kernelPCA)
Argument type: string
Acceptable values:
- String value
featureRaster: Raster layer with features (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
sampleSize: Sample size (optional)
Default value: 1000
Argument type: number
Acceptable values:
- A numeric value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputTransformer: Output transformer
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputTransformer: <outputFile>
Output transformer
Scale each feature by its maximum absolute value. This estimator scales and translates each feature individually such that the maximal absolute value of each feature in the training set will be 1.0.
Parameters
- Transformer [string]
Scikit-learn python code. See MaxAbsScaler for information on different parameters.
Default:
from sklearn.preprocessing import MaxAbsScaler transformer = MaxAbsScaler()
- Raster layer with features [raster]
- Raster layer with feature data X used for fitting the transformer. Mutually exclusive with parameter: Training dataset
- Sample size [number]
Approximate number of samples drawn from raster. If 0, whole raster will be used. Note that this is only a hint for limiting the number of rows and columns.
Default: 1000
- Training dataset [file]
- Training dataset pickle file used for fitting the transformer. Mutually exclusive with parameter: Raster layer with features
Outputs
- Output transformer [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitMaxabsscaler
:
----------------
Arguments
----------------
transformer: Transformer
Default value: from sklearn.preprocessing import MaxAbsScaler
transformer = MaxAbsScaler()
Argument type: string
Acceptable values:
- String value
featureRaster: Raster layer with features (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
sampleSize: Sample size (optional)
Default value: 1000
Argument type: number
Acceptable values:
- A numeric value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputTransformer: Output transformer
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputTransformer: <outputFile>
Output transformer
Transform features by scaling each feature to a given range. This estimator scales and translates each feature individually such that it is in the given range on the training set, e.g. between zero and one.
Parameters
- Transformer [string]
Scikit-learn python code. See MinMaxScaler for information on different parameters.
Default:
from sklearn.preprocessing import MinMaxScaler transformer = MinMaxScaler(feature_range=(0, 1), clip=False)
- Raster layer with features [raster]
- Raster layer with feature data X used for fitting the transformer. Mutually exclusive with parameter: Training dataset
- Sample size [number]
Approximate number of samples drawn from raster. If 0, whole raster will be used. Note that this is only a hint for limiting the number of rows and columns.
Default: 1000
- Training dataset [file]
- Training dataset pickle file used for fitting the transformer. Mutually exclusive with parameter: Raster layer with features
Outputs
- Output transformer [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitMinmaxscaler
:
----------------
Arguments
----------------
transformer: Transformer
Default value: from sklearn.preprocessing import MinMaxScaler
transformer = MinMaxScaler(feature_range=(0, 1), clip=False)
Argument type: string
Acceptable values:
- String value
featureRaster: Raster layer with features (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
sampleSize: Sample size (optional)
Default value: 1000
Argument type: number
Acceptable values:
- A numeric value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputTransformer: Output transformer
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputTransformer: <outputFile>
Output transformer
Normalize samples individually to unit norm. Each sample (i.e. each row of the data matrix) with at least one non zero component is rescaled independently of other samples so that its norm (l1, l2 or inf) equals one.
Parameters
- Transformer [string]
Scikit-learn python code. See Normalizer for information on different parameters.
Default:
from sklearn.preprocessing import Normalizer transformer = Normalizer()
- Raster layer with features [raster]
- Raster layer with feature data X used for fitting the transformer. Mutually exclusive with parameter: Training dataset
- Sample size [number]
Approximate number of samples drawn from raster. If 0, whole raster will be used. Note that this is only a hint for limiting the number of rows and columns.
Default: 1000
- Training dataset [file]
- Training dataset pickle file used for fitting the transformer. Mutually exclusive with parameter: Raster layer with features
Outputs
- Output transformer [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitNormalizer
:
----------------
Arguments
----------------
transformer: Transformer
Default value: from sklearn.preprocessing import Normalizer
transformer = Normalizer()
Argument type: string
Acceptable values:
- String value
featureRaster: Raster layer with features (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
sampleSize: Sample size (optional)
Default value: 1000
Argument type: number
Acceptable values:
- A numeric value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputTransformer: Output transformer
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputTransformer: <outputFile>
Output transformer
Principal component analysis (PCA). Linear dimensionality reduction using Singular Value Decomposition of the data to project it to a lower dimensional space. The input data is centered but not scaled for each feature before applying the SVD.
Parameters
- Transformer [string]
Scikit-learn python code. See PCA for information on different parameters.
Default:
from sklearn.pipeline import make_pipeline from sklearn.preprocessing import StandardScaler from sklearn.decomposition import PCA pca = PCA(n_components=0.95) transformer = make_pipeline(StandardScaler(), pca)
- Raster layer with features [raster]
- Raster layer with feature data X used for fitting the transformer. Mutually exclusive with parameter: Training dataset
- Sample size [number]
Approximate number of samples drawn from raster. If 0, whole raster will be used. Note that this is only a hint for limiting the number of rows and columns.
Default: 1000
- Training dataset [file]
- Training dataset pickle file used for fitting the transformer. Mutually exclusive with parameter: Raster layer with features
Outputs
- Output transformer [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitPca
:
----------------
Arguments
----------------
transformer: Transformer
Default value: from sklearn.pipeline import make_pipeline
from sklearn.preprocessing import StandardScaler
from sklearn.decomposition import PCA
pca = PCA(n_components=0.95)
transformer = make_pipeline(StandardScaler(), pca)
Argument type: string
Acceptable values:
- String value
featureRaster: Raster layer with features (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
sampleSize: Sample size (optional)
Default value: 1000
Argument type: number
Acceptable values:
- A numeric value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputTransformer: Output transformer
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputTransformer: <outputFile>
Output transformer
Transform features using quantiles information. This method transforms the features to follow a uniform or a normal distribution. Therefore, for a given feature, this transformation tends to spread out the most frequent values. It also reduces the impact of (marginal) outliers: this is therefore a robust preprocessing scheme. The transformation is applied on each feature independently. First an estimate of the cumulative distribution function of a feature is used to map the original values to a uniform distribution. The obtained values are then mapped to the desired output distribution using the associated quantile function. Features values of new/unseen data that fall below or above the fitted range will be mapped to the bounds of the output distribution. Note that this transform is non-linear. It may distort linear correlations between variables measured at the same scale but renders variables measured at different scales more directly comparable.
Parameters
- Transformer [string]
Scikit-learn python code. See QuantileTransformer for information on different parameters.
Default:
from sklearn.preprocessing import QuantileTransformer transformer = QuantileTransformer()
- Raster layer with features [raster]
- Raster layer with feature data X used for fitting the transformer. Mutually exclusive with parameter: Training dataset
- Sample size [number]
Approximate number of samples drawn from raster. If 0, whole raster will be used. Note that this is only a hint for limiting the number of rows and columns.
Default: 1000
- Training dataset [file]
- Training dataset pickle file used for fitting the transformer. Mutually exclusive with parameter: Raster layer with features
Outputs
- Output transformer [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitQuantiletransformer
:
----------------
Arguments
----------------
transformer: Transformer
Default value: from sklearn.preprocessing import QuantileTransformer
transformer = QuantileTransformer()
Argument type: string
Acceptable values:
- String value
featureRaster: Raster layer with features (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
sampleSize: Sample size (optional)
Default value: 1000
Argument type: number
Acceptable values:
- A numeric value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputTransformer: Output transformer
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputTransformer: <outputFile>
Output transformer
Scale features using statistics that are robust to outliers. This Scaler removes the median and scales the data according to the quantile range (defaults to IQR: Interquartile Range). The IQR is the range between the 1st quartile (25th quantile) and the 3rd quartile (75th quantile). Centering and scaling happen independently on each feature by computing the relevant statistics on the samples in the training set. Median and interquartile range are then stored to be used on later data using the transform method. Standardization of a dataset is a common requirement for many machine learning estimators. Typically this is done by removing the mean and scaling to unit variance. However, outliers can often influence the sample mean / variance in a negative way. In such cases, the median and the interquartile range often give better results.
Parameters
- Transformer [string]
Scikit-learn python code. See RobustScaler for information on different parameters.
Default:
from sklearn.preprocessing import RobustScaler transformer = RobustScaler(quantile_range=(25, 75))
- Raster layer with features [raster]
- Raster layer with feature data X used for fitting the transformer. Mutually exclusive with parameter: Training dataset
- Sample size [number]
Approximate number of samples drawn from raster. If 0, whole raster will be used. Note that this is only a hint for limiting the number of rows and columns.
Default: 1000
- Training dataset [file]
- Training dataset pickle file used for fitting the transformer. Mutually exclusive with parameter: Raster layer with features
Outputs
- Output transformer [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitRobustscaler
:
----------------
Arguments
----------------
transformer: Transformer
Default value: from sklearn.preprocessing import RobustScaler
transformer = RobustScaler(quantile_range=(25, 75))
Argument type: string
Acceptable values:
- String value
featureRaster: Raster layer with features (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
sampleSize: Sample size (optional)
Default value: 1000
Argument type: number
Acceptable values:
- A numeric value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputTransformer: Output transformer
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputTransformer: <outputFile>
Output transformer
Standardize features by removing the mean and scaling to unit variance. The standard score of a sample x is calculated as: z = (x - u) / s where u is the mean of the training samples or zero if with_mean=False, and s is the standard deviation of the training samples or one if with_std=False. Centering and scaling happen independently on each feature by computing the relevant statistics on the samples in the training set. Mean and standard deviation are then stored to be used on later data using transform. Standardization of a dataset is a common requirement for many machine learning estimators: they might behave badly if the individual features do not more or less look like standard normally distributed data (e.g. Gaussian with 0 mean and unit variance). For instance many elements used in the objective function of a learning algorithm (such as the RBF kernel of Support Vector Machines or the L1 and L2 regularizers of linear models) assume that all features are centered around 0 and have variance in the same order. If a feature has a variance that is orders of magnitude larger that others, it might dominate the objective function and make the estimator unable to learn from other features correctly as expected.
Parameters
- Transformer [string]
Scikit-learn python code. See StandardScaler for information on different parameters.
Default:
from sklearn.preprocessing import StandardScaler transformer = StandardScaler()
- Raster layer with features [raster]
- Raster layer with feature data X used for fitting the transformer. Mutually exclusive with parameter: Training dataset
- Sample size [number]
Approximate number of samples drawn from raster. If 0, whole raster will be used. Note that this is only a hint for limiting the number of rows and columns.
Default: 1000
- Training dataset [file]
- Training dataset pickle file used for fitting the transformer. Mutually exclusive with parameter: Raster layer with features
Outputs
- Output transformer [fileDestination]
- Pickle file destination.
Command-line usage
>qgis_process help enmapbox:FitStandardscaler
:
----------------
Arguments
----------------
transformer: Transformer
Default value: from sklearn.preprocessing import StandardScaler
transformer = StandardScaler()
Argument type: string
Acceptable values:
- String value
featureRaster: Raster layer with features (optional)
Argument type: raster
Acceptable values:
- Path to a raster layer
sampleSize: Sample size (optional)
Default value: 1000
Argument type: number
Acceptable values:
- A numeric value
dataset: Training dataset (optional)
Argument type: file
Acceptable values:
- Path to a file
outputTransformer: Output transformer
Argument type: fileDestination
Acceptable values:
- Path for new file
----------------
Outputs
----------------
outputTransformer: <outputFile>
Output transformer
Uses a fitted transformer to inverse transform a raster layer.
Parameters
- Raster layer with features [raster]
- The raster layer to be inverse transformed.
- Transformer [file]
- A fitted transformer.
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:InverseTransformRasterLayer
:
----------------
Arguments
----------------
raster: Raster layer with features
Argument type: raster
Acceptable values:
- Path to a raster layer
transformer: Transformer
Argument type: file
Acceptable values:
- Path to a file
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Uses a fitted transformer to transform a raster layer.
Parameters
- Raster layer with features [raster]
- The raster layer to be transformed. Transformer features and raster bands are matched by name.
- Transformer [file]
- A fitted transformer.
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:TransformRasterLayer
:
----------------
Arguments
----------------
raster: Raster layer with features
Argument type: raster
Acceptable values:
- Path to a raster layer
transformer: Transformer
Argument type: file
Acceptable values:
- Path to a file
outputRaster: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRaster: <outputRaster>
Output raster layer
Unmixing¶
Implementation of the regression-based unmixing approach “Ensemble Learning From Synthetically Mixed Training Data for Quantifying Urban Land Cover With Support Vector Regression” in IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, vol. 10, no. 4, pp. 1640-1650, April 2017.
Parameters
- Endmember dataset [file]
- A classification dataset with spectral endmembers used for synthetical mixing.
- Raster layer [raster]
- A raster layer to be unmixed.
- Regressor [string]
- Scikit-Learn Python code specifying a regressor.
- Number of mixtures per class [number]
Number of mixtures per class.
Default: 1000
- Proportion of background mixtures (%) [number]
Proportion of background mixtures.
Default: 0
- Include original endmembers [boolean]
Whether to include the original library spectra into the dataset.
Default: True
- Mixing complexity probabilities [string]
A list of probabilities for using 2, 3, 4, … endmember mixing models. Trailing 0 probabilities can be skipped. The default values of 0.5, 0.5,results in 50% 2-endmember and 50% 3-endmember models.
Default: 0.5, 0.5
- Allow within-class mixtures [boolean]
Whether to allow mixtures with profiles belonging to the same class.
Default: True
- Class probabilities [string]
- A list of probabilities for drawing profiles from each class. If not specified, class probabilities are proportional to the class size.
- Ensemble size [number]
Number of individual runs/predictions.
Default: 1
- Robust decision fusion [boolean]
Whether to use median and IQR (interquartile range) aggregation for ensemble decicion fusion. The default is to use mean and standard deviation.
Default: False
Outputs
- Output class fraction layer [rasterDestination]
- Raster file destination.
- Output classification layer [rasterDestination]
- Raster file destination.
- Output class fraction variation layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:RegressionbasedUnmixing
:
----------------
Arguments
----------------
dataset: Endmember dataset
Argument type: file
Acceptable values:
- Path to a file
raster: Raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
regressor: Regressor
Argument type: string
Acceptable values:
- String value
n: Number of mixtures per class
Default value: 1000
Argument type: number
Acceptable values:
- A numeric value
background: Proportion of background mixtures (%)
Default value: 0
Argument type: number
Acceptable values:
- A numeric value
includeEndmember: Include original endmembers
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
mixingProbabilities: Mixing complexity probabilities (optional)
Default value: 0.5, 0.5
Argument type: string
Acceptable values:
- String value
allowWithinClassMixtures: Allow within-class mixtures
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
classProbabilities: Class probabilities (optional)
Argument type: string
Acceptable values:
- String value
ensembleSize: Ensemble size
Default value: 1
Argument type: number
Acceptable values:
- A numeric value
robustFusion: Robust decision fusion (optional)
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputFraction: Output class fraction layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputClassification: Output classification layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
outputFractionVariation: Output class fraction variation layer (optional)
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputFraction: <outputRaster>
Output class fraction layer
outputClassification: <outputRaster>
Output classification layer
outputFractionVariation: <outputRaster>
Output class fraction variation layer
Vector conversion¶
Rasterize a categorized vector layer into a categorized raster layer. Output category names and colors are given by the source layer. Resampling is done via a two-step majority voting approach. First, the categorized raster layer is resampled at x10 finer resolution, and subsequently aggregated back to the target resolution using majority voting. This approach leads to pixel-wise class decisions that are accurate to the percent.
Parameters
- Categorized vector layer [vector]
- A categorized vector layer to be rasterized.
- Grid [raster]
- The target grid.
- Minimum pixel coverage [number]
Exclude all pixel where (polygon) coverage is smaller than given threshold.
Default: 50
- Majority voting [boolean]
Whether to use majority voting. Turn off to use simple nearest neighbour resampling, which is much faster, but may result in highly inaccurate class decisions.
Default: True
Outputs
- Output categorized raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:RasterizeCategorizedVectorLayer
:
----------------
Arguments
----------------
categorizedVector: Categorized vector layer
Argument type: vector
Acceptable values:
- Path to a vector layer
grid: Grid
Argument type: raster
Acceptable values:
- Path to a raster layer
coverage: Minimum pixel coverage
Default value: 50
Argument type: number
Acceptable values:
- A numeric value
majorityVoting: Majority voting
Default value: true
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
outputRasterizedCategories: Output categorized raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRasterizedCategories: <outputRaster>
Output categorized raster layer
Converts vector geometries (points, lines and polygons) into a raster grid.
Parameters
- Vector layer [vector]
- A vector layer to be rasterized.
- Grid [raster]
- The target grid.
- Init value [number]
Pre-initialization value for the output raster layer.
Default: 0
- Burn value [number]
Fixed value to burn into each pixel, which is touched (point, line) or where the center is covered (polygon) by a geometry.
Default: 1
- Burn attribute [field]
- Numeric vector field to use as burn values.
- Burn feature ID [boolean]
Whether to use the feature ID as burn values. Initial value is set to -1. Data type is set to Int32.
Default: False
- Add value [boolean]
Whether to add up existing values instead of replacing them.
Default: False
- All touched [boolean]
Enables the ALL_TOUCHED rasterization option so that all pixels touched by lines or polygons will be updated, not just those on the line render path, or whose center point is within the polygon.
Default: False
- Data type [enum]
Output data type.
Default: 5
Outputs
- Output raster layer [rasterDestination]
- Raster file destination.
Command-line usage
>qgis_process help enmapbox:RasterizeVectorLayer
:
----------------
Arguments
----------------
vector: Vector layer
Argument type: vector
Acceptable values:
- Path to a vector layer
grid: Grid
Argument type: raster
Acceptable values:
- Path to a raster layer
initValue: Init value
Default value: 0
Argument type: number
Acceptable values:
- A numeric value
burnValue: Burn value
Default value: 1
Argument type: number
Acceptable values:
- A numeric value
burnAttribute: Burn attribute (optional)
Argument type: field
Acceptable values:
- The name of an existing field
- ; delimited list of existing field names
burnFid: Burn feature ID
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
addValue: Add value
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
allTouched: All touched
Default value: false
Argument type: boolean
Acceptable values:
- 1 for true/yes
- 0 for false/no
dataType: Data type
Default value: 5
Argument type: enum
Available values:
- 0: Byte
- 1: Int16
- 2: UInt16
- 3: UInt32
- 4: Int32
- 5: Float32
- 6: Float64
Acceptable values:
- Number of selected option, e.g. '1'
- Comma separated list of options, e.g. '1,3'
outputRasterizedVector: Output raster layer
Argument type: rasterDestination
Acceptable values:
- Path for new raster layer
----------------
Outputs
----------------
outputRasterizedVector: <outputRaster>
Output raster layer
Vector creation¶
This algorithm creates a new point layer with a given number of random points, all of them within the categories of the given categorized raster layer.
Parameters
- Categorized raster layer [raster]
- A categorized raster layer to draw points from.
- Number of points per category [string]
- Number of points to draw from each category. Set a single value N to draw N points for each category. Set a list of values N1, N2, … Ni, … to draw Ni points for category i.
- Minimum distance between points (in meters) [number]
A minimum (Euclidean) distance between points can be specified.
Default: 0
- Minimum distance between points inside category (in meters) [number]
A minimum (Euclidean) distance between points in a category can be specified.
Default: 0
- Random seed [number]
- The seed for the random generator can be provided.
Outputs
- Output point layer [vectorDestination]
- Vector file destination.
Command-line usage
>qgis_process help enmapbox:RandomPointsFromCategorizedRasterLayer
:
----------------
Arguments
----------------
stratification: Categorized raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
n: Number of points per category
Argument type: string
Acceptable values:
- String value
distanceGlobal: Minimum distance between points (in meters)
Default value: 0
Argument type: number
Acceptable values:
- A numeric value
distanceStatum: Minimum distance between points inside category (in meters)
Default value: 0
Argument type: number
Acceptable values:
- A numeric value
seed: Random seed (optional)
Argument type: number
Acceptable values:
- A numeric value
outputPoints: Output point layer
Argument type: vectorDestination
Acceptable values:
- Path for new vector layer
----------------
Outputs
----------------
outputPoints: <outputVector>
Output point layer
This algorithm creates a new point layer with a given number of random points, all of them in the area where the given mask evaluates to true.
Parameters
- Mask raster layer [raster]
- A mask raster layer to draw locations from.
- Number of points [number]
- Number of points to be drawn.
- Minimum distance between points (in meters) [number]
A minimum distance between points can be specified. A point will not be added if there is an already generated point within this (Euclidean) distance from the generated location.
Default: 0
- Random seed [number]
- The seed for the random generator can be provided.
Outputs
- Output point layer [vectorDestination]
- Vector file destination.
Command-line usage
>qgis_process help enmapbox:RandomPointsFromMaskRasterLayer
:
----------------
Arguments
----------------
mask: Mask raster layer
Argument type: raster
Acceptable values:
- Path to a raster layer
n: Number of points
Argument type: number
Acceptable values:
- A numeric value
distance: Minimum distance between points (in meters)
Default value: 0
Argument type: number
Acceptable values:
- A numeric value
seed: Random seed (optional)
Argument type: number
Acceptable values:
- A numeric value
outputPoints: Output point layer
Argument type: vectorDestination
Acceptable values:
- Path for new vector layer
----------------
Outputs
----------------
outputPoints: <outputVector>
Output point layer
EnMAP Data¶
Info
This section is intended to guide the user through the workflow of downloading their first EnMAP image. The section will cover information about:
- The EnMAP Instrument Planning Portal (IPP)
- The EOWEB ® GeoPortal (EGP)
- Download the data from the FTP server
For a more detailed description take a look at the User Manual.
EnMAP Data Access Portal¶
The EnMAP Data Access Portal (EDAP) includes two major entry points:
- the EnMAP Instrument Planning Portal (IPP)
- the EOWEB ® GeoPortal (EGP)
To access the EnMAP image archive, a primary registration to the IPP is necessary to be able to access the EOWEB ® GeoPortal.
![]()
Overview of the EnMAP Data Access Portals
Step 1: Instrument Planning Portal (IPP)¶
The IPP enables the user registration, the submission of user proposals, and the planning and submitting of future orders.
- Click the Sign-Up button to register at the Instrument Planning Portal landing page.
Note
An e-mail is send to your address containing a verification code.
After the successful registration, login to the Instrument Planning Portal and enter the User Portal
![]()
In the User Portal, the user has to go through the Role Assignment procedure which is used to assign different priorities to observation requests. For more information about the different User Roles please take a look at the User Manual.
Wait until the respective role is assigned. Note: This will take a few hours.
Once the role has been assigned, a new box will appear in the User Portal, allowing you tp access the EOWEB ® GeoPortal to search the EnMAP Data archive and order images.
Step 2: EOWEB ® GeoPortal¶
The EOWEB ® GeoPortal access link is created for Cat-1 users after the requested role has been approved by the reviewer. The login button appears on the User Portal page, which automatically directs to the EOWEB ® GeoPortal login page.
![]()
Entry point to the EOWEB GeoPortal
Login with the respective User ID associated with the approved role request. The password remains the same as when logging into the Instrument Planning Portal.
Once logged in, click Show advanced map to zoom, pan and draw a rectangle.
Select
EnMAP
in Filter Collection and confirm with Search.Note
You may also want to check the EnMAP-HSI (LO), Low Quality box to see additional records that are marked as low quality, but are still good.
Hide Show advanced map to see the results.
![]()
Place your order and wait until you get notified.
Step 3: Download data from the FTP Delivery Server¶
After the order is placed, an e-mail is sent including a link to the FTP server and the zipped data.
Note
The User ID and password to access the FTP server are identical to the EOWEB ® GeoPortal credentials.
To download the data use a FTP client, for example FileZilla. For further help on how to download the data from the FTP server take a look at Downloading Ordered Data.
![]()
Example of FTPS settings in FileZilla
Application Tutorials¶
Regression-based unmixing of urban land cover¶
Authors: Akpona Okujeni, Sam Cooper, Patrick Hostert, Clemens Jaenicke, Benjamin Jakimow, Andreas Rabe, Fabian Thiel & Sebastian van der Linden
Publication date: 05/02/2019
Latest update: 19/03/2020
Introduction¶

This tutorial is part of the HYPERedu online learning platform, an education initiative within the EnMAP mission hosted on EO College. HYPERedu provides annotated slide collections and hands-on tutorials using the open-source EnMAP-Box software, targeting basic principles, methods as well as applications of imaging spectroscopy.
Annotated slide collections for the tutorial Regression-based unmixing of urban land cover and a software description unit for the EnMAP-Box are provided here:
Land cover fraction mapping based on unmixing is well suited to describe the composition of surface types in heterogeneous environments. Especially when using coarser spatial resolution satellite data with a high share of mixed pixels, fraction mapping is more useful than a discrete classification. This, for example, applies to the use of 30 m resolution imagery from the forthcoming spaceborne imaging spectrometer mission EnMAP for urban mapping.
This tutorial focuses on regression-based unmixing of urban land cover using synthetically mixed training data from spectral libraries. Hyperspectral images from the airborne HyMap and the spaceborne EnMAP sensor (here simulated from HyMap), a corresponding spectral library, and reference land cover information are used for different exercises within this tutorial. These aim at providing both a theoretical background related to challenges in urban mapping and a hands-on training for working with the EnMAP-Box.
This tutorial requires at least version 3.6 of the EnMAP-Box 3. There might be some minor changes for higher versions (e.g., changed menu labels, added parameter options, etc.).
We recommend [1] for a comprehensive overview on imaging spectroscopy of urban environments and [2] & [3] for detailed introductions into the regression-based unmixing approach using synthetically mixed training data from spectral libraries.
[1] | van der Linden, et al. (2018). Imaging Spectroscopy of Urban Environments. Surveys in Geophysics, 1–18. |
[2] | Okujeni, A., et al. (2013). Support vector regression and synthetically mixed training data for quantifying urban land cover. Remote Sensing of Environment, 137, 184-197 |
[3] | Okujeni, A., et al. (2017). Ensemble learning from synthetically mixed training data for quantifying urban land cover with support vector regression. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 10, 1640-1650 |
You can download the data here:
https://box.hu-berlin.de/f/3c3f7b76d91b4bd2a688/?dl=1
The tutorial dataset contains an EnMAP-image (simulation) covering an area along the urban gradient of Berlin, Germany, a second hyperspectral image at higher spatial resolution (HyMap, 3.6 m), a spectral library and detailed land cover reference information.
Data type | Filename | Description |
---|---|---|
Raster | hymap_berlin.bsq |
Airborne hyperspectral data from the HyMap sensor with a spatial resolution of 3.6m, 111 bands and 346x3200 pixels (ENVI Standard Band Sequential bsq ) |
Raster | enmap_berlin.bsq |
Spaceborne hyperspectral data from the EnMAP sensor (here simulated from HyMAP) with a spatial resolution of 30m, 177 bands and 220x400 pixels (ENVI Standard Band Sequential bsq ) |
Spectral library | library_berlin.sli |
Urban spectral library with 75 pure surface materials categorized in a hierarchical class scheme. The Library was developed from the HyMap image and spectrally resampled to the EnMAP sensor (ENVI spectral library sli with metadata extensions csv & json ) |
Vector | landcover_berlin.shp |
Detailed land cover reference information categorized in a hierarchical class scheme (ESRI Shapefile shp with QGIS layer style file qml and metadata extension json ) |
The tutorial dataset is a subset extracted from the Berlin-Urban-Gradient dataset [4]. Please cite the dataset as follows:
[4] | Okujeni, Akpona; van der Linden, Sebastian; Hostert, Patrick (2016): Berlin-Urban-Gradient dataset 2009 - An EnMAP Preparatory Flight Campaign (Datasets). V. 1.2. GFZ Data Services. https://doi.org/10.5880/enmap.2016.008 |
Exercise A: Urban land cover¶
Description
Airborne imaging spectroscopy data is well suited for urban mapping. The high spectral and spatial resolution enhances the separability of surface types and preserves the spatial detail of many urban features. This exercise…
- provides an insight into how urban areas are depicted by airborne hyperspectral images and introduces a hierarchical classification scheme commonly adopted for urban mapping
- introduces basic functionalities of the EnMAP-Box. You will get to know the graphical user interface, and you will learn how to load data, visualize raster and vector data, and use the basic navigation tools
Duration: 15 min
- Start QGIS and click the
icon in the toolbar to open the EnMAP-Box. The GUI of the EnMAP-Box consists of a Menu and a Toolbar, panels for Data Sources and Data Views, and the QGIS Processing Toolbox including the EnMAP-Box geoalgorithms.

- The EnMAP-Box offers simple drag & drop capabilities to load data from an external explorer.
Drag the following datasets from your explorer into the Data Sources panel:
- Raster:
hymap_berlin.bsq
,enmap_berlin.bsq
- Vector:
landcover_berlin.shp
- Spectral library:
library_berlin.sli
- Raster:

The EnMAP-Box offers Map Windows (Map #) for visualizing raster and vector data. Click the
icon and drag the following datasets from the Data Sources panel into Map #1:
hymap_berlin.bsq
landcover_berlin.shp
Map #1 now appears in the Data Views panel, where the visibility, order and properties of datasets can be modified. Unfold Map #1:
- To change the order of stacked layers, drag one layer on top or below another one. Arrange the layer stack so that
landcover_berlin.shp
is displayed on top ofhymap_berlin.bsq
. - To assign a multibandcolor RGB combination to a raster image, right click on the dataset, select Layer Properties and
navigate to Band selection. You can now select predefined composites (RGB, nIR, swIR), or
manually select your bands using the slider or dropdown lists. Display
hymap_berlin.bsq
as true color composite, by selecting R-G-B. - You can specify things like contrast enhancement and data stretch under .
- The symbology of
landcover_berlin.shp
is predefined by a QGIS layer style file (.qml
). To change this symbology, right click on the vector layer, select Layer Properties and navigate to Symbology in the LayerProperties window. You can now change the symbology in accordance to the QGIS functionality. Use the Column and Classify options to explore the information content of the attribute tablelandcover_berlin.shp
.
- To change the order of stacked layers, drag one layer on top or below another one. Arrange the layer stack so that

Exercise B: Spectral mixing¶
Description
Forthcoming spaceborne imaging spectroscopy missions create new opportunities for global urban mapping. However, the step to satellite observations brings with it coarser spatial resolution, resulting in a loss in spatial detail and an increase in the number of mixed pixels. This exercise…
- provides an insight into how urban areas will be depicted by spaceborne hyperspectral images and illustrates challenges related to spectral mixing when using such data for urban mapping
- introduces additional basic functionalities of the EnMAP-Box. You will learn how to work with multiple map views, and how to visualize image spectra using Spectral Library Windows
Duration: 15 min
- Close Map #1 from the previous exercise by using the
icon on the blue Map #1 title bar.
- The EnMAP-Box enables users to work with multiple Map Windows, which can be flexibly organized and geospatially linked. Open two new Map Windows. For horizontal arrangement, click and hold on the blue Map #2 title bar and drag it to the right edge of Map #1. A transparent blue rectangle appears indicating the docking position once you stop holding the mouse button.

- Display
hymap_berlin.bsq
andenmap_berlin.bsq
as RGB composite of your choice in Map #1 and Map #2, respectively. - For geospatial linking, click on View in the Menu and select Set Map Linking. In the Map Linking
window, select the
Link Map Scale and Center option and close the dialog.

- The EnMAP-Box offers Spectral Library Windows (SpectralLibrary #) for visualizing spectra and handling their
metadata. To visualize image spectra, activate the Identify tool together with the Identify raster profiles
option. Click on an image pixel. SpectralLibrary #1 opens automatically displaying the respective pixel spectrum (green line). The plotted spectrum always refers to the top-most raster layer of the respective Map Window you click on (unless you change this in the Spectral Profile Sources panel).
- Make yourself familiar with the following tools in the Spectral Library #1 toolbar:
- The
icon adds a plotted spectrum to a collection. Each collected spectrum (white line) gets an entry in the attribute table with a predefined name (filename and id).
- By clicking
next to the
icon you can activate the
Add Profiles automatically mode, which will automatically add spectra to the collection when clicking on image pixels.
- The
icon switches on the editing mode. You can now edit the attribute table (e.g. edit the name of a spectrum), add or delete colums using the
icons, etc.
- You can delete selected spectra in editing mode using the
icon (hold Ctrl or Shift to select multiple rows).
- The
icon saves a spectrum or a collection of spectra as a spectral library. Further information on spectral libraries and library formats will follow in Exercise C.
- The

Learning activities
B1: Visually compare the airborne and spaceborne hyperspectral images (
hymap_berlin.bsq
,enmap_berlin.bsq
). How much of the spatial detail is lost when stepping from airborne to spaceborne scale?click to expand...
The spatial detail of most urban features (e.g., buildings, streets, trees along streets or in private gardens) disappears due to spatial aggregation at spaceborne scale. However, large homogenous urban features (e.g., waterbodies, sport grounds, tree stand in parks) remain apparent.
B2: Provide an average estimate on the percentage of pixels covered by 1, 2, 3, and 4 or more land cover classes for both images. Use level 3 of the classification scheme for your estimate. You may use the reference land cover information (
landcover_berlin.shp
) for orientation.click to expand...
B3: Compare pairs of spectra from the airborne and spaceborne hyperspectral images (
hymap_berlin.bsq
,enmap_berlin.bsq
). For which urban surface materials is it still possible to collect pure spectra at spaceborne scale, and for which not?click to expand...
Pure spectra can be collected for homogenous urban surfaces with a patch size of ~100 x 100 m and larger (e.g., roofing material spectra for large industrial buildings, ground paving material spectra for yards of industrial complexes, grass spectra on lawns or soccer fields, tree spectra in dense stands, water spectra from water bodies). Pure spectra cannot be collected for urban surfaces with a patch size below ~100 x 100 m (i.e., for most roofing materials, street asphalt, street trees).
Exercise C: Urban spectral libraries¶
Description
Urban spectral libraries are collections of pure surface spectra (endmembers) representing the spectral diversity and variability of urban land cover types at high spectral resolution. Library spectra are commonly based on laboratory, field, or image data, and are well suited for library-based mapping approaches such as unmixing. This exercise…
- provides an insight into the design of urban spectral libraries and illustrates challenges related to within-class variability and between-class similarity during urban mapping
- targets the handling of spectral libraries in the EnMAP-Box. You will get to know the spectral library format used in the EnMAP-Box, and learn how to load and visualize external urban spectral libraries and associated metadata
Duration: 15 min
- The EnMAP-Box makes use of labeled spectral libraries, which extend the standard ENVI Spectral Library (SLI) and associated header (HDR) by additional attribute information, e.g., class labels, class colors, description, etc. This information is stored in an ASCII Comma Separated Value (CSV) file and in a JavaScript Object Notation (JSON) file. The CSV file includes an attribute table for each library spectrum (the column ‘spectra names’ links the CSV with the HDR). The JSON file contains the unique attributes of given attribute columns.
- Open the
library_berlin.hdr
,library_berlin.csv
, andlibrary_berlin.json
files with a text editor and get familiar with the spectral library format used in the EnMAP-Box and the hierarchical classification scheme stored in the attribute information.
- Close all Map and Spectral Library Windows from the previous exercise.
- To load the urban spectral library, click on the
icon to open a new Spectral Library Window and drag
library_berlin.sli
from the Data Sources panel into SpectralLibrary #1. Get familiar with the representation of the spectral library and the attribute table. - By default, only 64 spectra will be displayed at once in the plot window. To change this number, right-click in the plot
area, go to
75
(total number of spectra inlibrary_berlin.sli
)
and enter a higher number, e.g. - To display a subset of spectra in a separate Library Window…
- Select the spectra of interest by clicking on their corresponding row numbers (use Ctrl or Shift to select multiple rows). To select spectra with the same attributes, prior sorting of the attribute table by clicking on the corresponding column header is recommended. You can also select the spectra directly in the plot window.
- Click on the
icon in the toolbar (or Ctrl+C) to copy the selected spectra to clipboard.
- Open a second Spectra Library Window. Similar to the work with multiple Map Windows, Spectral Library Windows can be arranged according to the user needs.
- Switch on the editing mode
in the SpectralLibrary #2 toolbar and use the
icon (or Ctrl+V) to paste the copied spectra into SpectralLibrary #2. Switch off the editing mode.

Learning activities
C1: Load the urban spectral library (
library_berlin.sli
) and display each level 3 class in a separate Spectral Library Window. How diverse is each class with regard to within-class variability?click to expand...
The roof class shows a very high within-class variability. The classes pavement, low vegetation, and tree show a high within-class variability. The classes soil and water show a rather low within-class variability.
C2: List classes which show a high between-class similarity and provide an explanation.
click to expand...
The classes roof and pavement are highly similar with regard to the following surface materials: bitumen vs. asphalt, red clay tiles vs. red sand, grey roofing materials (most likely concrete) vs concrete. The classes roof and soil are highly similar with regard to the following surface materials: concrete vs. bare soil, red clay tiles vs. bare soil. The classes low vegetation and tree are highly similar regarding the following vegetation types: darker grass types (clover, agricultural grassland) vs. brighter trees.
Exercise D: Regression-based unmixing¶
Description
To utilize data from forthcoming spaceborne imaging spectrometer missions for mapping the land cover composition of urban areas, unmixing is more useful than a discrete classification. This exercise…
- introduces a regression-based unmixing approach for land cover fraction mapping. The approach successfully copes with spectral diversity, variably and mixing, and makes use of synthetic mixtures from spectral libraries for regression model training
- demonstrates the work with the ‘Regression-based unmixing (synthMix)’ application of the EnMAP-Box
Duration: 30 min
The training of regression models with synthetically mixed data from spectral libraries for land cover fraction mapping is implemented as the Regression-based unmixing (synthMix) application in the EnMAP-Box 3. The workflow of the unmixing approach comprises the following steps:

Step 1: An endmember library with associated class labels is used to randomly create a synthetically mixed dataset, i.e., pairs of mixed spectra and mixing fractions, for each class.
Step 2: The synthetically mixed dataset is used to train a regression model for each class.
Step 3: The regression model is applied to an image to derive a fraction map for each class.
The approach can be embedded into an ensemble framework, i.e., steps 1-3 are iterated n-times and the final fraction map for each class is created by combining the intermediate maps. The ensemble modeling allows the inclusion of a multitude of different types of synthetic mixtures into the unmixing process while keeping the training sample size low.
- Click on Applications in the Menu and select Regression-based unmixing (synthMix). The graphical widget of the Regression-based unmixing (synthMix) consists of sections for specifying Inputs, for target Class Selection, for setting Mixing Parameters, for selecting the Regression Algorithm, and for specifying the Outputs.

- The specification of input data is the start of the unmixing process. This includes an Endmember Library with associated class labels (see Exercise 3), where the Class Attribute drop menu specifies the attribute column associated with the class labels, and the Spectral Image to unmix.
- Select / specify the following inputs:
- Endmember Library:
library_berlin.sli
- Class Attribute: level_1
- Spectral Image:
enmap_berlin.bsq
- Endmember Library:
- The selection of the classes of interest, i.e., Target Classes, is the next step of the unmixing process. Synthetically mixed data, regression models, and fraction maps are only created for target classes. Spectra of excluded classes are still used as background signatures in the synthetic mixing process.
- Select the following Target Classes: impervious, vegetation, soil, water (all level 1 classes)

- The mixing parameters steer the process of generating the synthetically mixed data from the endmember library. The Number of Synthetic Mixtures per Class
specifies the total number of mixtures per class to be created. The check option to
Include Original Library Endmembers allows to append the endmember library to the synthetically mixed data, with fractions of either 0% or 100% of a respective target class.

- The synthetic mixing process itself is randomized. That is, to generate a synthetic mixture…
- … a mixing complexity is randomly assigned. The mixing complexity defines the number of endmembers contributing to a mixture (e.g., 2EM, 3EM). The random selection is steered by user-defined Mixing Complexity Probabilities (e.g., 2EM=0.6, 3EM=0.4 means that there is a 60% likelihood that the mixture is made up of two endmembers and a 40% likelihood that the mixture is made up of three endmembers). The implementation allows the definition of probabilities for 2EM, 3EM and 4EM. Note that probabilities must sum up to 1.
- … endmembers are randomly drawn from the library. The number of endmembers is based on the previously assigned mixing complexity.
The first endmember is always drawn from the target class. The following endmembers are drawn based on Class Probabilities,
which are either proportional (class proportions within the library) or equalized (all classes with the same likelihood).
The
Allow Within-Class Mixtures check option allows the user to decide whether multiple endmembers of the same class can be drawn to create a mixture.
- … random mixing fractions between 0 and 1 (0-100%) are randomly assigned to the previously drawn endmembers. The total sum of fractions is always 1 (100%).
- … endmembers are linearly mixed based on the mixing fractions to create the mixture.


- Select the following mixing parameters:
- Number of Synthetic Mixtures per Class:
1000
(default) - Include Original Library Endmembers: Yes (default)
- Mixing Complexity Probabilities: 2EM=
0.4
, 3EM=0.4
, 4EM=0.2
- Allow Within-Class Mixtures: Yes (default)
- Class Probabilities: Proportional (default)
- Number of Synthetic Mixtures per Class:
- The selection of the regression algorithm and the setting up of the ensemble are the next steps in the unmixing process. The EnMAP-Box makes
use of the scikit-learn library (see https://scikit-learn.org/stable/index.html) to implement several state-of-the-art algorithms offered in the Regressor
drop menu. Note that the different algorithms lead to varying accuracies and processing times,
particularly when embedding the unmixing process into an ensemble. To do so, activate
Use Ensemble and set the Ensemble Size.

- Select the following regression settings:
- Regressor: RandomForestRegression (default, due to the low processing time)
- Use Ensemble: Yes (default), Ensemble Size:
3
(default)
- The specification of the outputs is the final step in the unmixing process. By default, the final fraction map is the only output:
- Folder: Specifies the output folder where results are saved.
- Name: Specifies the base name of the final fraction map. We add the suffix ‘_mean’ to this file as the default ensemble decision fusion is based on averaging.
- The advanced options allow user to save additional files created during the unmixing process, and to derive additional maps from the final fraction map.
- Decision Fusion (Ensemble): Selection of different statistics to evaluate the ensemble output. The following statistics are implemented: mean (default, suffix ‘_mean’), median (suffix ‘_median’), inter quartile range (suffix ‘_iqr’), and standard deviation (suffix ‘_std’).
- Save: Check to save Training Samples, Predictions, and Models. These outputs will be stored for each class and with a suffix ‘_run’ for each ensemble iteration in separate subfolders.
- Create Class Fraction RGB: Check to create a RGB class representation of the final fraction map. The RGB color of a specific pixel is the weighted mean value of the original class colors, where the weights are given by the corresponding class fractions.
- Derive Classification from Fraction Map: Check to derive a discrete classification map from the final fraction map. The winner class per pixel corresponds to the maximum class fraction.
- Specify the following outputs (and skip the advanced options):
- Folder: path to your working folder
- Name:
fraction_level1_estimation.bsq
- Display the newly created
fraction_level1_estimation.bsq
. The file consists of 4 bands, where each band represents a fraction map of the defined target classes. Display the fraction map in a useful render style and appropriate contrast stretch:- e.g., as multibandcolor RGB composite of three target classes in a single Map Window. For stretching fraction maps to the full range of possible fraction, set Min = 0 and Max = 1.
- e.g., as singlegray image per target class in multiple Map Windows. For stretching fraction maps to the full range of possible fraction, set Min = 0 and Max = 1.
- Visually explore your fraction map. You may open
enmap_berlin.bsq
in a separate Map Window for comparison. You may use the Identify tool together with the Identify cursor location values option to display fraction valuesof pixels.

Learning activities
D1: Visually explore the fraction map (
fraction_level1_estimation.bsq
). How are level 1 land cover distributed across the urban gradient. Are the fraction values physically plausible?click to expand...
High impervious fractions can be observed in the city center. A general increase in vegetation cover and decrease in impervious cover is observed when moving towards suburban areas. Soil is only abundant on single patches, e.g., along rail tracks or on construction sites. Fractions for each class are in the physically meaningful range between 0 and 1. The sum of fractions per pixel over all classes is, however, often larger than 1.
D2: Do you observe an over- or underestimation of fractions for specific land cover types indicating errors in map?
click to expand...
Soil fractions are overestimated by around 20%, particularly for areas where red clay tiles / bitumen / asphalt mixtures are apparent but no soil surfaces. Water fractions are overestimated by around 20% throughout the city on all impervious surfaces.
Exercise E: Validation of fraction maps¶
Description
Validation of fraction maps is commonly conducted by comparison of estimated and reference fractions using scatterplots and statistical measures (e.g., mean absolute error, root mean squared error, R², slope and intercept of a linear fitted regression model). This exercise……
- illustrates the validation procedure for fraction maps
- introduces EnMAP-Box geoalgorithms for producing reference fractions from high resolution land cover information and for statistical accuracy assessment of fraction maps.
Duration: 15 min
- A reference fraction map is created by rasterizing available reference land cover information to the pixel grid of the estimated fraction map. To obtain reasonable fractions, the reference land cover information needs to be at a significantly higher spatial resolution than the pixel grid. To create reference fractions, use the following processing algorithm .
- Enter the following data / parameters (use the tool tips for their description):
- Pixel Grid:
fraction_level1_estimation.bsq
- Vector:
berlin_landcover.shp
- Class id attribute: level_1_id
- Minimal overall coverage: 0.95
- Oversampling factor: 5
- Output fraction:
…path to your working folder…/fraction_level1_reference.bsq
- Pixel Grid:
- Run the process.

- The Regression Performance algorithm in the Accuracy Assessment tools of the EnMAP-Box geoalgorithms implements the accuracy assessment for quantitative data. Scatterplots and statistical measures are reported in an HTML report. Run the Regression Performance algorithm with the following inputs:
- Prediction:
fraction_level1_estimation.bsq
- Reference:
berlin_level1_reference.bsq
- Prediction:
- Make yourself familiar with the HTML report.

Learning activities
- E1: Visually compare your estimated fraction map (
fraction_level1_estimation.bsq
) with the reference fraction map (berlin_level1_reference.bsq
). Do both maps show a good agreement in terms of spatial patterns or are there areas with large differences? - E2: Discuss the accuracy of your fraction map. What are the accuracies for the different classes and which classes show striking errors like underestimation or overestimations of fractions?
Additional Exercises¶
Additional learning activities
- AE1: Repeat Exercises D & E using the two other class schemes (level 2, level 3) stored in the spectral library metadata and the land cover reference information. How do the accuracies vary and where are the limitations in mapping the more detailed class levels?
- AE2: Explore the effects of changing the mixing parameters on the mapping accuracy of the level 2 classes. For more direct comparison, we recommend to alter only one parameter at a time. We further recommend to use the Random Forest Regression due to the low processing time. For example, …
- change the Number of Synthetic Mixtures per Class: e.g. 10 vs. 1000 vs. 2000
- do not Include Original Library Endmembers
- change the Mixing Complexity Probabilities: e.g. only 2EM vs. only 3EM vs. only 4EM
- change the Ensemble Size: e.g. 1 vs. 10 vs. 20
- AE3: Compare the performance of the different regression algorithms offered in the EnMAP-Box. Please note that the other regressors have significantly longer processing times.
Regression-based mapping of forest aboveground biomass¶
Authors: Sam Cooper, Akpona Okujeni, Patrick Hostert, Clemens Jaenicke, Benjamin Jakimow, Andreas Rabe, Fabian Thiel & Sebastian van der Linden
Publication date: 03/07/2020
Last update: 02/08/2022
Introduction¶

This tutorial is part of the HYPERedu online learning platform, an education initiative within the EnMAP mission hosted on EO College. HYPERedu provides annotated slide collections and hands-on tutorials using the open-source EnMAP-Box software, targeting basic principles, methods as well as applications of imaging spectroscopy.
Annotated slide collections for the tutorial Regression-based mapping of forest aboveground biomass and a software description unit for the EnMAP-Box are provided here:
Forest aboveground biomass (AGB) is a measure of the living and dead plant material in a given area. As such, it is often used for forest management, assessing fire potential, and is an important metric used in modelling carbon and nutrient cycles. AGB can be directly measured at a plot level by harvesting and weighing vegetation, but this is both an expensive and highly invasive process. Through the use of statistical modelling and remotely sensed imagery, AGB can be mapped across broad, spatially continuous areas using only a small number of directly measured reference plots. This tutorial focuses on regression-based modeling of forest AGB using the EnMAP-Box. A hyperspectral image mosaic from the EnMAP sensor (here simulated from AVIRIS imagery) and a corresponding vector dataset containing plot-based AGB references are used for this tutorial. The aim is to provide an introduction into the functionality of the EnMAP-Box, as well as hands-on training for implementing regression-based mapping.
This tutorial requires at least version 3.10 of the EnMAP-Box 3. There might be some minor changes for higher versions (e.g., changed menu labels, added parameter options, etc.).
We recommend [1] and [2] for a comprehensive overview of imaging spectroscopy of terrestrial ecosystems, [3] for an overview of remote sensing of forest AGB and [4] for a companion study using the same data.
[1] | Foerster, S., Guanter, L., Lopez, T., Moreno, J., Rast, M., Schaepman, M.E. (2019) Exploring the Earth System with Imaging Spectroscopy. Springer International Publishing |
[2] | Thenkabail, P. S., & Lyon, J. G. (2016). Hyperspectral remote sensing of vegetation. CRC press. |
[3] | Lu, D., Chen, Q., Wang, G., Liu, L., Li, G., & Moran, E. (2016). A survey of remote sensing-based aboveground biomass estimation methods in forest ecosystems. International Journal of Digital Earth, 9(1), 63-105. |
[4] | Cooper, S., Okujeni, A., Pflugmacher, D., van der Linden, S., & Hostert, P. (2021). Combining simulated hyperspectral EnMAP and Landsat time series for forest aboveground biomass mapping. International Journal of Applied Earth Observation and Geoinformation, 98. |
You can download the data for this exercise here:
- https://box.hu-berlin.de/f/d73fa3ba95c143388832/?dl=1
The tutorial data contains a simulated hyperspectral EnMAP image, plot-based AGB references as well as a land cover map for a small study area located in Sonoma County, California, USA. The simulated EnMAP image is a subset extracted from the “2013 Simulated EnMAP Mosaics for the San Francisco Bay Area, USA” dataset [5]. AGB reference data was sampled from an existing LiDAR derived AGB map [6]. The land cover map was taken from the 2011 National Landcover Database (NLCD) [7].
Data type | Filename | Description |
---|---|---|
Raster | enmap_sonoma.bsq |
Simulated spaceborne hyperspectral data from the EnMAP sensor with a spatial resolution of 30m, 195 bands, and 1000x200 pixels (ENVI Standard Band Sequential bsq ) |
Raster | nlcd_sonoma.bsq |
National Land Cover Database 30m classification for the study region (ENVI Standard Band Sequential bsq ) |
Vector | agb_sonoma.gpkg |
343 AGB reference points sampled from the existing LiDAR derived AGB map (GeoPackage gpkg ) |
[5] | Dubayah, R.O., A. Swatantran, W. Huang, L. Duncanson, H. Tang, K. Johnson, J.O. Dunne, and G.C. Hurtt. 2017. CMS: LiDAR-derived Biomass, Canopy Height and Cover, Sonoma County, California, 2013. ORNL DAAC, Oak Ridge, Tennessee, USA. https://doi.org/10.3334/ORNLDAAC/1523 |
[6] | Cooper, S.; Okujeni, A.; Jänicke, C.; Segl, K.; van der Linden, S.; Hostert, P. (2020): 2013 Simulated EnMAP Mosaics for the San Francisco Bay Area, USA. GFZ Data Services. https://doi.org/10.5880/enmap.2020.002 |
[7] | Multi-Resolution Land Characteristics Consortium (MRLC) (2018). National Land Cover Database 2011 (NLCD 2011). Multi-Resolution Land Characteristics Consortium (MRLC). https://data.nal.usda.gov/dataset/national-land-cover-database-2011-nlcd-2011. Accessed 2022-08-08. |
Exercise A: Getting started with the EnMAP-Box¶
Description
This exercise introduces basic functionalities of the EnMAP-Box for this tutorial. You will get to know the graphical user interface and will learn how to load data, visualize raster and vector data, and use the basic navigation tools. Additionally, you will learn to work with multiple map views and how to visualize image spectra using Spectral Library Windows.
Duration: 30 min
- Start QGIS and click the
icon in the toolbar to open the EnMAP-Box. The GUI of the EnMAP-Box consists of a Menu and a Toolbar as well as panels for Data Sources and Data Views.
- The QGIS Processing Toolbox including the EnMAP-Box algorithms can be optionally added to the GUI by clicking on View in the Menu and by checking the Processing Toolbox from the Panel list.

- To load new datasets into the EnMAP-Box, click the
icon and navigate to the file directory containing your data. Select
agb_sonoma.gpkg
from the Open data source dialogue and select Open. - Alternatively, the EnMAP-Box offers simple drag & drop capabilities to load data from an external file manager
(e.g. Windows File Explorer). Load
enmap_sonoma.bsq
by dragging and dropping the file from your file manager into the Data Sources panel. - All data currently open in the EnMAP-Box will appear in the Data Sources panel.

The EnMAP-Box offers Map Views (Map #) for visualizing raster and vector data. Click the
icon to open a new Map View and drag
enmap_sonoma.bsq
from the Data Sources panel into Map #1.In addition to a new Map View opening, a corresponding Data View entry is created in the Data Views panel which shows all data currently loaded in a given Map View.
The
enmap_sonoma.bsq
image will be displayed as true color RGB composite. True color rendering is based on predefined RGB band combinations (R: 658 nm, G: 569 nm, B: 479 nm) stored in the QGIS Style Fileenmap_sonoma.qml
.To assign a different RGB combination to the RGB channels, right click on the dataset in the Data Views panel, select
Layer Properties and navigate to Symbology. Set Render type to Multiband color and select bands to display in the red, green and blue color channels. Choose appropriate Min/Max Value Settings (e.g. Cumulative Count Cut: 2-98%). Common RGB combinations are listed below.
Combination Red Green Blue TrueColor 658 nm 569 nm 479 nm nIR 847 nm 658 nm 569 nm swIR 847 nm 1645 nm 658 nm

Tip
If the raster image has wavelength information associated with it, you may also select an RGB combination from different custom RGB band combinations (True Color, Colored IR, SWIR-NIR-R or NIR-SWIR-R). Right click on the dataset in the Data Views panel, select Layer Properties and navigate to Raster Band. Don’t forget to choose appropriate Min/Max Value Settings.
The EnMAP-Box enables users to work with multiple Map Views, which can be flexibly organized and geospatially linked.
Open a new Map View (Map #2) by clicking the
icon.
Note
A new Data view appears corresponding to the newly added Map View.
Display
enmap_sonoma.bsq
as an RGB composite of your choice in Map #2.
Tip
When loading a raster image to a map view, you may also right click the filename in the Data Sources panel and select either Open in existing map or Open in new map. If the raster image has wavelength information associated with it, you may also select a predefined composite from the context menu.
- For geospatial linking, click on View in the Menu and select Set Map Linking. In the Map Linking window,
select the
Link Map Scale and Center option and close the dialog. You may also right click a map window and select Link with other maps to initialize the linking process.

Tip
Map Windows can be re-arranged by clicking on the blue Map title bar (Map #) and dragging it to the desired position.
A transparent blue rectangle will appear indicating the docking position once you release the mouse button.
You may also undock map views from the EnMAP-Box window by selecting from the blue Map title bar.
To re-dock a Map View, click and drag the blue Map title bar to an open Map View already docked in the EnMAP-Box window.
Close Map #2 from the previous step.
Load
agb_sonoma.gpkg
to Map #1.To change the order of stacked layers, go to the Data Views panel and drag one layer on top or below another one. Arrange the layer stack so that
agb_sonoma.gpkg
is displayed on top ofenmap_sonoma.bsq
.By default, vector files are displayed with a single uniform symbol. To change this symbology, right click on
agb_sonoma.gpkg
in the Data Views panel, select Layer Properties and navigate to Symbology in the Layer Properties window. You can now change the symbology in accordance to the QGIS functionality.- Select Graduated from the dropdown menu, and select
biomass
in Value andColor
in Method. - Set the Color ramp to run from white to green.
- Press Classify and then OK to display the biomass values associated with each point.
- Select Graduated from the dropdown menu, and select

The EnMAP-Box offers Spectral Library Windows (SpectralLibrary #) for visualizing spectra and handling their metadata.
This tool may also be used to extract and visualize spectra which are spatially associated with vector data open in the EnMAP-Box, i.e., the AGB reference points. To do this, open a new Spectral Library window by selecting the
icon on the toolbar.
Next, import spectral profiles from other sources by clicking at the
icon in the SpectralLibrary #1 menu. Specify the following settings:
Terminate the Import Spectral Profile dialogue with OK. A spectral library is automatically built based on the geographic location of each point in the vector file. The associated attribute information is displayed in the table on the right.
In Exercise B, you will learn how to create regression models based on the illustrated spectra and related AGB quantities to predict AGB across the whole image.

Learning Activities
- A1: What land cover types are present in the imagery? How are the AGB reference plots distributed throughout the scene?
- A2: What different information can you see when switching from a true color composite to a NIR false color composite?
Exercise B: Regression based mapping of AGB¶
Description
One of the strengths of remote sensing comes from its ability to take high-quality plot measurements of a variable of interest and building statistical models with which wall to wall maps of this variable can be created. One of the most common ways of doing this is to create regression models based on the optical properties of the training data and applying it to large scale imagery. This exercise …
- Introduces a regression-based mapping approach for taking plot measurements of AGB and generating spatial AGB estimates using an input raster of hyperspectral imagery.
- Demonstrates the Regression Dataset Manager and the Regression Workflow applications of the EnMAP-Box.
Duration: 20 min
The Regression Dataset Manager offers different options to prepare data for the Regression Workflow application. In the context of this tutorial, you will create a Regression Dataset from a raster and a vector layer containing the spectral features (independent variable) and the target variable (dependent variable), respectively. The regression dataset will be stored as pickle file (
.pkl
).Open
enmap_sonoma.bsq
andagb_sonoma.gpkg
in a single Map Window. Close all other opened Map and Spectral Library Windows.Click on Applications in the Menu and select Regression Dataset Manager.
To create the Regression Dataset from a raster and a vector layer, click on the
icon and choose Create regression dataset (from continuous-valued vector layer and feature raster). A new widget will be opened. Run the dialog with the following inputs:
- Continuous-valued vector layer: select
agb_sonoma.gpkg
- Raster layer with features: select
enmap_sonoma.bsq
- Fields with targets: select attribute
biomass
- Output Data: select and define an output path and file name
(e.g.
agb_regression_data.pkl
).
- Continuous-valued vector layer: select
After running the dialog,
agb_regression_data.pkl
will be opened under Models in the Data Sources panel. Close the Regression Dataset Manager.

The Regression Workflow application offers several state-of-the-art regression algorithms from the scikit-learn library (see https://scikit-learn.org/stable/index.html) for predicting continuous variables. The application further includes an optional cross-validation for assessing model performances.
Click on Applications in the Menu and select Regression Workflow to open the regression application.
- Choose
agb_regression_data.pkl
as Training dataset. - Select
RandomForestRegressor
(default, due to the low processing time) as Regressor, and use the default model parameters. Note that the different algorithms provided lead to varying accuracies and processing times. Refer to the scikit-learn documentation for more information. - Raster layer with features specifies the raster image to which the regression model will be applied.
Select
enmap_sonoma.bsq
. Specify output path and file name (e.g.agb_estimation.bsq
) under Output regressor layer to save the result in your working directory. - To make use of a cross-validation, set the Number of cross-validation folds to
10
(default) and leave the Open output performance report optionchecked. Specify output path and file name (e.g.
agb_estimation_cv.html
) under Output regressor performance report to save the report in your working directory. - The regression model can be optionally saved, e.g. for applying the model again to a dataset.
Specify output path and file name (e.g.
agb_rfmodel.pkl
) under Output regressor to save the result in your working directory. - Click run to start the Regression Workflow.
- Choose

Tip
All processing options of the Regression Workflow that are labeled as [optional] can be disregarded by
setting the Output to Skip Output
.
- After running the Regression Workflow, the performance report with scatterplots and statistical measures will be opened in your default web browser.
- Based on the 10-fold cross-validation, you can now access the performance of your model to predict AGB.

- After running the Regression Workflow, all outputs will appear in the Data Sources panel.
- Close all opened Map/SpectralLibrary Windows. Open
enmap_sonoma.bsq
as an RGB composite of your choice in Map #1. - Open the
agb_estimation.bsq
in a new Map View and link to the Map #1. Use the Layer Properties to change the color ramp to white-green (Singleband pseudocolor).

Learning Activities
- B1: What general trends do you see in the biomass estimations? How do they compare to landscape features seen in the EnMAP imagery?
- B2: Discuss the accuracy results, both in terms of the statistical measures, as well as the form of the scatterplot and histograms.
Exercise C: Compare AGB estimates with the NDVI¶
Description
In this exercise, you will learn how to use the ImageMath application to calculate a NDVI map and generate a forest mask based on the NLCD land cover map. Based on the forest area only, you will then assess the AGB prediction from Exercise B relative to the NDVI using the Scatter Plot Tool.
Duration: 30 min
The ImageMath tool in the EnMAP-Box allows users to apply a mathematical operation, python function or user defined function to an image. In the following sections, you will utilize standard numpy array processing protocols
- to calculate a NDVI map from two bands of our EnMAP imagery,
- to generate a forest mask from the NLCD land cover map,
- and to apply a forest mask to both the NDVI and AGB maps.
Close all opened Map/Spectral Library Windows. Display
enmap_sonoma.bsq
,nlcd_sonoma.bsq
andagb_estimation.bsq
in a single or in multiple Map Views.Open the ImageMath application by going to Applications then selecting
ImageMath
ImageMath consists of several panels:
- Inputs: defines input variables and variable names.
- Outputs: defines output variable names and locations to be saved to.
- Code editor: Text editor in which programmatic manipulation of the input datasets can be defined using Python scripting syntax.
- Output Grid: Allows users to manually set the output grid.
- Processing: Allows users to select block sizes for processing large datasets with limited memory.
- Log Window: Displays the status (and error messages) of executed code.
- Additionally, a tab for Routines allows users to select a number of common python-based tools for manipulating spatial datasets with linked documentation.

The Normalized Difference Vegetation Index (NDVI) is a commonly used vegetation index that is correlated with both vegetation cover and AGB. The formula for NDVI is:
\[NDVI = \frac{NIR-Red}{NIR+Red}\]where NIR is the near-infrared band reflectance (~850nm) and Red is the red band reflectance (~660nm). We will now calculate NDVI from the EnMAP imagery using ImageMath.
In the Inputs panel, select
enmap_sonoma.bsq
from the dropdown menu. The variable name is automatically taken from the filename, but may be changed if desired.In the Code Editor, define the RED and NIR bands in our EnMAP imagery. These correspond to bands 42 and 73, respectively, and we can define them using python indexing syntax (i.e. 0 indexed array slicing):
RED = enmap_sonoma[41] NIR = enmap_sonoma[72]
Next, we define the formula we wish to run:
NDVI = (NIR - RED)/(NIR + RED)
In the Outputs panel, define the output variable name as
NDVI
, and select an output file path and file name (e.g.ndvi.bsq
).Finally, click on the
button to run the script. A new raster dataset
ndvi.bsq
will appear in the Data Sources panel.
Attention
Input and output variable names in the Code Editor must exactly match corresponding names defined in the Inputs and Outputs panels.

- As the model was trained using AGB reference plots from forest areas, only limited inference can be made of the non-forest AGB estimates. We will therefore apply a forest mask to our AGB map as well as to the NDVI map. The forest mask will be generated based on the available NLCD land cover map.
- Below are the NLCD classes and color legend represented in the raster data. We will consider any pixel to be forest which is labelled as Deciduous (41), Evergreen (42), or Mixed (43) forest according to the NLCD classification.

Open the ImageMath application and set
nlcd_sonoma.bsq
as the input file.Enter the following code into the code editor:
Forest_Mask = nlcd_sonoma forest_classes = [42, 43, 44] for x in range(Forest_Mask.shape[1]): for y in range(Forest_Mask.shape[2]): if Forest_Mask[0, x, y] in forest_classes: Forest_Mask[0, x, y] = 0 else: Forest_Mask[0, x, y] = 1
Line by line, this
- Copies the NLCD information to a new object we will manipulate to create the mask
- Creates a list of classes which we consider forest
- Loops through the x dimension of the raster. For each loop, x will be an integer representing the current location in the x dimension.
- Loops through the y dimension of the raster. For each loop, y will be an integer representing the current location in the y dimension. These two loops allow us to look at each element in the array individually. While numpy offers more efficient ways to analyse arrays (See section C4), this is one basic approach.
- Check if the element at the current x and y position is in the forest_classes list
- If it is, set that value to 0
- If it is not
- Set that value to 1
Set
Forest_Mask
as the output and define the path and file name (e.g.forest_mask.bsq
) for saving the result.A new raster dataset
forest_mask.bsq
will appear in the Data Sources panel. The resulting mask now has a value of 0 for forested pixels, and 1 for non-forested pixels.

- Open the ImageMath application and set
agb_estimation.bsq
,ndvi.bsq
andforest_mask.bsq
as the input files. Note that these datasets need to be opened in a single or in multiple Map Views to make them selectable input files. - Enter the following code into the Code Editor to apply the forest mask to the AGB and NDVI images.
Forest_Mask = forest_mask.astype(bool)
AGB_Masked = agb_estimation
AGB_Masked[Forest_Mask] = -99
setNoDataValue(AGB_Masked, -99)
NDVI_Masked = ndvi
NDVI_Masked[Forest_Mask] = -99
setNoDataValue(NDVI_Masked, -99)
- Line by line, this script:
- Sets the mask to a Boolean data type (i.e. True/False). The mask file contains binary values where 0
indicates forest (i.e. non-masked pixels) and 1 indicates non-forest (i.e. pixels to be ignored).
In Python, 1 also represents True while 0 represents False, and by setting the datatype to
bool
, we explicitly tell Python to treat these values in this manner. - Copies the AGB values to a new array.
- Steps through each value in the new array and sets the value to -99 if the mask value is True.
In numpy array speak, this line can therefore read: “For each value in
AGB_Masked
, if the corresponding value inForest_Mask
is True (i.e. non-forest), then set that value to -99”. If the mask value is False (i.e. forested), nothing will happen, and the biomass value will remain in the array. - Sets the no data value for the masked array to -99. This helps the EnMAP-Box to automatically display the data correctly, and since it is not a realistic value for both AGB and NDVI, we can safely ignore it.
- Steps 2-4 are then repeated for NDVI.
- Sets the mask to a Boolean data type (i.e. True/False). The mask file contains binary values where 0
indicates forest (i.e. non-masked pixels) and 1 indicates non-forest (i.e. pixels to be ignored).
In Python, 1 also represents True while 0 represents False, and by setting the datatype to
- Set
AGB_Masked
andNDVI_Masked
as the outputs and define the path and the file names (e.g.agb_estimation_masked.bsq
,ndvi_masked.bsq
) for saving results. - Run the script by clicking
. The new raster datasets
agb_estimation_masked.bsq
andndvi_masked.bsq
will appear in the Data Source panel.

- Close all Map Views.
- Open an RGB composite of
enmap_sonoma.bsq
in Map #1. - Display
agb_estimation_masked.bsq
andndvi_masked.bsq
in Map#2 and Map#3, respectively and use the Layer Properties to change the color ramp of both maps to white-green. Link all Map Views.

To investigate the relationship between estimated AGB and NDVI, we will make use of the EnMAP-Box’s Scatter Plot tool. This is one of several tools integrated into the EnMAP-Box to support data visualization and assessment
Open the Scatter Plot tool by going to Tools then selecting Scatter Plot.
- Select
agb_estimation_masked.bsq
and Band 1 for specifying X values andndvi_masked.bsq
and Band 1 for specifying Y values. If a selected raster has multiple bands, you would specify the desired band from the dropdown. - Click on Apply to visualize the Scatter Plot.
- Select
- The
Settings offer different options for visualizing the scatter plot.
- You may change the Min and Max values, Coloring or Cumulative count cut options to improve your visualization.
- Under Extent you may choose
Current canvas
orWhole raster
to display data of the current map canvas only or to display all raster data. ChooseWhole raster
. - Under Accuracy you may choose to display
Estimated
orActual
.Actual
will display all available data, whileEstimated
will only display a random subset. For large raster extents,Estimated
is much faster, and for that reason is the default. Leave Accuracy asEstimated
. - Click on Apply to update the Scatter Plot. If Live update is checked, visualization of the scatter plot will be automatically updated.
- The
The
Analytics offers options to assess the relationship between x and y values.
- The 1:1 line represents the linear 1:1 relationship between the two variables of the same unit if they were perfectly correlated.
- The Fitted line represents the linear regression line fitted between the actual data from the two variables. The linear regression function, the coefficient of determination (r^2) and the Root Mean Squared Error (rmse) will be additionally displayed. Activate the Min-max line by checking the box to its left.

Learning Activities
- C1: Why was it necessary to mask the AGB results?
- C2: What relationships can you see between AGB and NDVI? Do these relationships hold true if you look at the un-masked AGB and NDVI maps?
- C3: Given the relationships between AGB and NDVI, do you think NDVI could be used to map AGB? What limitations would you expect from such a model?
Additional Exercises¶
Learning Activities
- AE1: Use the Image Statistics tool in the Tools menu to look at the band statistics for the biomass predictions both with and without the tree mask applied.
- AE2: Because we randomly subsetted the training data prior to model training, the performance of the model has an element of uncertainty to it. To better understand this, rerun the regression workflow 3-5 times. Then use the ImageMath tool to calculate the average estimate and variance. How does running the regression in such an ensemble approach affect the results? What is the spatial pattern of variation in estimates?
- AE3: Rerun regression (Exercise B) using NDVI as the input rather than the hyperspectral imagery.
Ocean Colour analysis with ONNS¶
Ocean Colour analysis with the OLCI Neural Network Swarm (ONNS)
Overview¶

Satellites observe the oceans, coasts and inland waters. Water quality parameters can be estimated from ocean colour using the in-water algorithm ONNS, which has been developed at the Institute of Coastal Research at the Helmholtz-Zentrum Geesthacht. The EnMAP-Box is a free and open source plug-in for QGIS to visualize and process satellite remote sensing data with special emphasis to the hyperspectral EnMAP sensor. The following tutorial describes the usability and functionality of the Python-based ONNS processing tool in the EnMAP-Box.
In opposite to most other remote sensing applications it is not the water surface itself that determines the reflectance (ocean colour), it is the upper layer of the water body beneath. Water is transparent for light in the visible spectral range. Sunlight is absorbed and scattered along the water column, whereby four constituents are usually differentiated: pure water itself, phytoplankton particles, sediments, and coloured dissolved organic matter (CDOM). The composition of the water constituents determines the light penetration depth and portion of the backscattered light. The remote sensing signal contains the backscattered light from the top layer only, approximately until a depth where only 90 % of the spectral sunlight is still present (the 90%-depth). This information-containing water depth can be up to 60 m for clear oceanic waters (spectral maximum around 450 nm), few metres for coastal waters (spectral maximum at 600 nm) or even few centimetres for very turbid waters. By the way – photosynthesis of phytoplankton is only possible with sufficient sunlight roughly until the 1%-depth, also referred to as euphotic depth.
The primary aim of ocean colour remote sensing is to quantify the water constituents, i.e. the phytoplankton biomass in terms of their Chlorophyll-a pigment content, Chl [mg m −3], total (organic + inorganic) suspended matter concentration, TSM [g m -3], and CDOM absorption at 440 nm, a cdom (440) [m -1]. Beyond this, additional water mass-characterizing optical parameters, e.g. absorption and scattering properties, can be estimated. Hyperspectral information, as provided by the EnMAP mission, allow further differentiation of spectral features associated to algae types (phytoplankton groups) or sediment properties.
The present tutorial is an overview about the usage and functionality of the water algorithm implemented in the EnMAP-Box. The processor contains three main steps: the atmospheric correction, an optical water type classification, and the application of suitable in-water algorithms. Ocean, coastal and inland water bodies can be characterized by means of these algorithms. The core in-water processor including optical water type classification is the ONNS (OLCI Neural Network Swarm) algorithm [1] version 0.9. It is an EnMAP-precursor algorithm, which is specially developed for data evaluation of the multi-spectral Ocean and Land Colour Instrument (OLCI) on board Sentinel-3. Satellite data from other ocean colour sensors can be analysed as well by means of an intermediate band-shifting procedure [2]. Atmospheric correction must be provided before utilization of the in-water algorithm, different models are available for this, e.g. Polymer [3] or C2RCC [4] (but may lead to different retrieval results). Alternatively, in situ remote-sensing reflectance data (in a txt-format) can be processed.
The ONNS algorithm itself consists of several blended neural networks that are specialized for 13 different optical water classes. These comprise clearest natural waters but also extreme absorbing or scattering waters. Considered Chlorophyll-a concentrations reach up to 200 mg m −3, non-algae particle concentrations up to 1,500 g m −3, and CDOM absorption coefficient at 440 nm is up to 20 m −1. The algorithm generates different concentrations of water constituents, inherent and apparent optical properties, and a color index. In addition, all products are delivered with an uncertainty estimate.
[1] | Hieronymi, M., D. Müller, and R. Doerffer (2017), The OLCI Neural Network Swarm (ONNS): A bio-geo-optical algorithm for open ocean and coastal waters, Frontiers in Marine Science, 4 (140). (https://www.frontiersin.org/articles/10.3389/fmars.2017.00140/full) |
[2] | Hieronymi, M. (2019), Spectral band adaptation of ocean color sensors for applicability of the multi-water biogeo-optical algorithm ONNS, Optics Express, 27 (12), A707-A724. (https://www.osapublishing.org/oe/abstract.cfm?uri=oe-27-12-A707) |
[3] | Steinmetz, F., P. Y. Deschamps, and D. Ramon (2011), Atmospheric correction in presence of sun glint: application to MERIS, Optics Express, 19(10), 9783-9800. (https://www.osapublishing.org/oe/abstract.cfm?uri=oe-19-10-9783) |
[4] | Brockmann, C., R. Doerffer, M. Peters, K. Stelzer, S. Embacher, and A. Ruescas (2016), Evolution of the C2RCC neural network for Sentinel 2 and 3 for the retrieval of ocean colour products in normal and extreme optically complex waters, In Proc. Of the Living Planet Symposium, Vol. 740, p. 54. (https://www.brockmann-consult.de/wp-content/uploads/2017/11/sco1_12brockmann.pdf) |
Data¶
You can download the test data here: https://bitbucket.org/janzandr/onns_for_enmap-box/downloads/S3A_OL_2_WFRC8R_20160720T093421_20160720T093621_20171002T063739_0119_006_307______MR1_R_NT_002_sylt.nc
The present version of the ONNS algorithm is able to process atmospherically corrected data of different ocean colour sensors, namely OLCI, MERIS, MODIS and VIIRS. The corresponding data format must be NETCDF4. Moreover, ONNS can handle tabulated remote-sensing reflectances at selected wavebands of OLCI, SeaWiFS, MODIS, MERIS, OCM-2, VIIRS, SGLI, GOCI-2, EnMAP or PACE/OCI (text format).
One example of (C2RCC) atmospherically corrected Sentinel-3A/OLCI data is provided. The sub-scene shows the coastal
waters off the island Sylt in the German Bight, North Sea (2016-07-20, 09:34 UTC):
S3A_OL_2_WFRC8R_20160720T093421_20160720T093621_20171002T063739_0119_006_307______MR1_R_NT_002_sylt.nc
Note that processing of a satellite scenes may take a long time depending on the number of valid water pixels.

Figure 1: Sentinel-3A/OLCI top-of-atmosphere image with marked area of provided sub-scene (contains modified Copernicus Sentinel data [2016] processed by ESA/EUMETSAT/HZG).
The minimum output of the water algorithm ONNS contains 12 typical ocean colour products each with an estimate of their associated uncertainties:
- Concentration of Chlorophyll-a, Chl [mg m −3],
- Concentration of inorganic suspended matter (minerals), ISM [g m -3],
- Absorption coefficient of CDOM at 440 nm, a cdom (440) [m -1],
- Absorption coefficient of phytoplankton particles at 440 nm, a p (440) [m -1],
- Absorption coefficient of minerals at 440 nm, a m (440) [m -1`],
- Absorption coefficient of detritus plus gelbstoff at 412 nm, a dg (412) [m -1],
- Scattering coefficient of phytoplankton particles at 440 nm, b p (440) [m -1],
- Scattering coefficient of minerals at 440 nm, b m (440) [m -1]`,
- Total backscattering coefficient of all particles (organic and inorganic) at 510 nm, b bp (510) [m -1],
- Downwelling diffuse attenuation coefficient at 490 nm, K d (490) [m -1],
- Upwelling diffuse attenuation coefficient at 490 nm, K u (490) [m -1] and
- Forel-Ule number, FU [-].
The standard output contains additional derived properties, such as total absorption and scattering coefficients at 440 nm, optical dominance at 440 nm as well as estimated concentration of dissolved organic carbon (DOC [mg m -3]). In addition, input remote-sensing reflectances and some information on the optical water types (OWT) are provided. In a third saving option, excessive information on OWT classification can be stored.



Estimated Chlorophyll-a concentration, CDOM absorption and particulate backscattering from the Sentinel-3 OLCI test scene
Usage¶
Satellite data, e.g. Level-2 products of Sentinel-3/OLCI, are often available in NETCDF4 format, which can be visualized and processed by means of the QGIS/EnMAP-Box as raster layer. It is possible to process atmospherically corrected satellite ocean colour data with the ONNS algorithm via the EnMAP-Box processing tools (
).
Overview of available processing tools in the EnMAP-Box. The raster layer data show remote-sensing reflectance at 510 nm.

GUI of the ONNS algorithm

GUI of the ONNS algorithm upon completion of the processing.
Depending on the size of the satellite scene, processing may take a few minutes up to some hours. The results are saved in NETCDF4 format and can be viewed and transferred for example as raster layer.
Credits¶
Martin Hieronymi (martin.hieronymi@hzg.de)
Hajo Krasemann (Helmholtz-Zentrum Geesthacht)
Andreas Rabe (Humboldt-Universität zu Berlin)
![]() |
![]() |
![]() |
![]() |
EnGeoMAP 3.1 Tutorial¶
EnGeoMAP 3.1 the EnMAP Geological Mapper for Mineral Classification (EnGeoMAP)
Authors: Helge L. C. Daempfling, Nicole Köllner, Saeid Asadzadeh
Contributions: Christian Mielke, Friederike Koerting, Friederike Klos, Christian Rogass, Nina K. Boesche, Agnieszka Kuras, Christopher Loy
Introduction to EnGeoMAP 3.1¶
The EnMAP geological mapper (EnGeoMAP), as part of the EnMAP Box, is an expert-system-based tool for the processing and characterization of geologic surface cover types from hyperspectral data in general and EnMAP satellite data in particular. EnGeoMAP 3.1 is based on the EnGeoMAP 2.0 algorithm developed by Christian Mielke (Mielke et al., 2016).
EnGeoMAP 3.1 is optimized for Windows 10 and 11 and the Windows version of QGIS (LTS).
The software requires a hyperspectral reflectance data cube, a spectral library with user-defined endmembers, and a user-supplied color scheme as inputs to run. The software then classifies the hyperspectral data based on the provided endmembers and represents it according to the supplied color scheme.
EnGeoMAPhas been primarily designed for EnMAP data, yet it works for most full-range hyperspectral sensor suites, provided that VNIR and SWIR data are all available.
1. Data Preparation and Requirements¶
The hyperspectral data cubes must be in the Band Sequential (BSQ) format conforming to L3Harris ENVI header file information (.hdr)
- Overlapping bands need to be removed from the dataset i.e., the wavelength succession vector in the header files need to be strictly ascending.
- Clipping and interpolation are required in both strong water vapor residuals at 940 nm and 1130 nm to assure an artifact-reduced analysis result.
- Nanometer (nm) is the recommended wavelength unit, and the floating-point or unsigned integer (ranging from 0-10000, as is common for many imaging spectrometers) is recommended for the reflectance values.
- Adaptive filtering is suggested to further reduce noise and artifacts from reflectance data.
The spectral library files also must be in Band Sequential (BSQ) format according to the L3Harris ENVI header file information (.hdr). The necessary spectral library files can be prepared with the EnMAP Box spectral library wizard or with any other software that is able to write spectral library files in band sequential (BSQ) format. The entries of the spectral library are plotted according to the RGB color code from the CSV file (see the RGB Color Scheme CSV file section).
- Overlapping bands need to be removed from the dataset i.e., the wavelength succession vector in the header files need to be strictly ascending.
- For field-measured spectral libraries: Clipping and interpolation are required both strong water vapor residuals at 940 nm and at 1130 nm to assure an artifact-reduced analysis result.
- Nanometer (nm) is recommended as wavelength unit, as well as float or an unsigned integer from 0-10000 (standard for many imaging spectrometers) for the reflectance values.
- Adaptive filtering is suggested to further reduce noise and artifacts.
- The spectral library should be resampled to the spectral resolution of the reflectance data cube for the two datasets to match spectrally.
The RGB (Red, Green, Blue) color scheme needs to be provided by the user in a CSV file format (UTF-8). The entries have to be in the right order and matching to the entries of the spectral library. Through the CSV color file, the user can choose the colors with which EnGeoMAP classifies the according library entries in the hyperspectral image. There are several online tools available to visualize RGB color code for a preview of the chosen colors. CSV files can either be edited with a standard text editor (Figure 1) or spreadsheet editor (Figure 2).

Figure 1: Color scheme CSV file example opened in a text editor. Here the legend includes four different endmembers.

Figure 2: Color scheme CSV file example opened in a spreadsheet editor. Here the legend includes four different endmembers.
Test data for EnGeoMAP can be downloaded here:
‘ https://nextcloud.gfz-potsdam.de/s/oWF6GHdRGBk4e6y ‘
The dataset contains a hyperspectral EO-1 Hyperion image data cube which was acquired over the Gamsberg Mine (South Africa) prior to its opening, a field-based spectral library, and a CSV color file defining the color codes of each endmember for visual representation.
2. How to use/run the EnGeoMAP toolbox¶
Figure 3 shows how you get access to the EnGeoMAP toolbox.

Figure 3: Access to EnGeoMAP.
The EnMAP-Box provides a graphical user interface (GUI) for EnGeoMAP 3.1 (Figure 4). The three main input fields for the location of the user input files comprises:
- The hyperspectral image data
- The spectral library file
- The CSV color file
Note: For the hyperspectral data and the library file only the path to the main files are required. The header (.hdr) files need to be in the same folder as the reflectance data files and are loaded automatically by the software. Choosing the header files in the data selection will lead to an error.
The user can choose the minimum reflectance threshold in the VNIR and SWIR regions. The values should be chosen depending on the noisiness of the data. They should be as low as possible for data with a good SNR. - Standard settings are recommended according to Figure 5.
The minimum fit threshold sets the lower cutoff value for the minimum acceptable valid spectral correlation value between the image spectrum and the library spectra. Values below this threshold are set to zero.
For the unmixing data products, the maximum number of endmembers needs to be set by the user. The default is set to 10 (see Results section). This number should not exceed the total number of endmembers embedded in the spectral library file.
Processing is started by pressing the OK button and then pressing OK in the subsequent notification window.
A status indicator in the lower right corner shows if the software is still processing the data or is ready to process new data.

Figure 4: The graphical user interface (GUI) of EnGeoMAP 3.1.
4. The Results¶
The preprocessing module within EnGeoMAP extracts the characteristic absorption features of the input spectra (Figure 5). These features are then used in a weighted fitting operation in the spectral module to calculate the material similarity scores of the unknown pixel spectrum compared to the reference library. According to those fit values, a user defined minimum fit threshold may now be applied to only use those library spectra in a Bounded Value Least Squares (BVLS) unmixing meeting the user-defined threshold (see Figure 4 option: Minimum Fit Threshold Weighted Fitting). The resulting unmixing as well as the correlation data cube are then sorted in descending order.
The first band of each of the sorted results is then used in the spatial module together with the CSV file to provide a color-coded best fit (highest correlation score) material map and highest abundance (highest BVLS fraction) map.

Figure 5: Basic processing workflow for EnGeoMAP 3.1 with modules, input and output highlighted.
EnGeoMAP3.1 provides 6 data products which are identifiable by their suffixes to the original filename (basename). See Table 1 for an overview of the data products and suffixes.
_correlation_result | Raw correlation scores from the spectral module for characteristic absorption features. |
_best_matches_best_fit_coleur | Results relating to the highest correlation score. The data product is based on sorted correlation scores (the first band contains the highest score values, the second the second highest scores and so on) |
_best_fit_coleur_class_geotiff | The material / geological classification thematic map Standard RGB color maps assigned from the sorted Band 1 of the best_matches results using the .csv colorfile. It can be directly viewed with the image viewer of your choice. Class images,can be used for a quick legend generation within the QGIS map composer. |
_abundance_result | Raw Bounded Value Least Squares (BVLS) unmixing scores from the spectral module for characteristic absorption features. |
_abundance_unmix_best_unmix _coleur | Highest abundance (highest BVLS fraction) sorted color map. |
_abundance_unmix__ best_unmix_coleur_class_geotiff | The (BVLS unmixing) abundance map result. Standard RGB color maps assigned from the sorted Band 1 of the best_unmix (highest BVLS fraction) results using the .csv color file. It can be directly viewed with the image viewer of your choice. Class images,can be used for a quick legend generation within the QGIS map composer. |
5. Acknowledgements¶
Algorithm, Python code, and GUI was developed by Christian Mielke. Current version GUI and algorithm product adjustments (EnGeoMAP version 3.1) by Helge L. C. Daempfling.
6. Further Reading¶
For theoretical background information on EnGeoMAP algorithm please consider reading Mielke et al. (2016) EnGeoMAP 2.0 Automated Hyperspectral Mineral Identification for the German EnMAP Space Mission.
Literature¶
- Mielke, C.; Rogass, C.; Boesche, N.; Segl, K.; Altenberger, U. EnGeoMAP 2.0—Automated Hyperspectral Mineral Identification for the German EnMAP Space Mission. Remote Sens. 2016, 8, 127.
- Clark, R.N.; Swayze, G.A.; Livo, K.E.; Kokaly, R.F.; Sutley, S.J.; Dalton, J.B.; McDougal, R.R.; Gent, C.A. Imaging spectroscopy: Earth and planetary remote sensing with the USGS Tetracorder and expert systems. J. Geophys. Res. Planets 2003, 108.
- Kokaly, R.F. Spectroscopic remote sensing for material identification, vegetation characterization, and mapping. Proc. SPIE 2012, 8390.
- Clark, R.N.; Swayze, G.A.; Wise, R.; Livo, E.; Hoefen, T.M.; Kokaly, R.F.; Sutley, S.J. USGS Digital Spectral Library Splib06a; U.S. Geological Survey: Denver, CO, USA, 2007.
Workshop Tutorials¶
12th EARSeL Imaging Spectroscopy Workshop - Part I: Introduction into the EnMAP-Box¶
Authors: Andreas Rabe
Date: 17/06/2022
EnMAP-Box 3: version 3.10
QGIS: version 3.24
Introduction¶
- Abstract
- In this tutorial we will show the basic components of the EnMAP-Box. Participants will learn how to manage, visualize and process raster and vector data inside the EnMAP-Box. We will detail the multiple-viewer concept of the EnMAP-Box, that allows the exploration of data in different visualizations at the same time. Here we will especially highlight, how we capitalize on the spectral characteristics of optical (hyperspectral) EO data, e.g. by correctly plotting pixel profiles against the given center wavelength, or by quickly selecting target bands for visualization. Finally, we will perform a Classification Analysis Workflow using PRISMA or (simulated) EnMAP data to illustrate EO data processing.
- Requirements
- This tutorial requires version 3.10+ of the EnMAP-Box 3 running in QGIS 3.24+.
- Data
You can download the data for this exercise here:
https://box.hu-berlin.de/f/2ecf8943d6fa4474bf38/?dl=1The tutorial dataset contains a PRISMA L2D image over Berlin, Germany, as well as a point based landcover reference sample.
Type Filename Description Raster PRS_L2D_STD_20201107101404_20201107101408_0001_SPECTRAL.tif
Surface reflectance, coregistersed, hyperspectral cube from the PRISMA sensor with a spatial resolution of 30m, 234 bands, and 1281x1238 pixels Vector landcover_berlin_point.gpkg
58 landcover reference points For more details on PRISMA data see: https://prisma.asi.it/
Exercise A: Visualize PRISMA data inside the EnMAP-Box¶
- Open the PRISMA raster
In the EnMAP-Box, open the PRS_L2D_STD_20201107101404_20201107101408_0001_SPECTRAL.tif raster and visualize it in a map view using drag&drop.
- Style the PRISMA layer using an RGB visualization
We can improve the visualization using the Raster Layer Styling panel.
As the PRISMA layer contains information about the center wavelength location for each band, we can directly choose from a list of predefined RGB band combinations, e.g. Natural color (R-G-B) for showing Red band, Green band and Blue band as an RGB visualization, or Agricultural 1 (S1-N-B) for showing SWIR 1 band, NIR band Blue band as an RGB visualization.
Use the A, B, …, S2 buttons, to select individual PRISMA bands that best match the predefined broad bands from the Sentinel-2 sensor, e.g. N is associated with the Sentinel-2 NIR band at 833 nanometers.
Use the widgets in the Min / Max Value Settings to interactively alter and improve the contrast stretch.
- Use a singleband gray visualization to identify bad bands
Due to atmospheric conditions, the PRISMA raster may contain bad bands, which can be identified easily using a singleband gray visualization.
In the Raster Layer Styling panel select the Gray tab to change the visualization.
Use the band selection slider or the band selection combobox (together with the Arrow-Up and Arrow-Down keys) to browse the PRISMA bands and identify potential bad bands.
As before, you can also use the A, B, …, S2 buttons.
- Plot spectral profiles and show cursor location values
Use the Identify map tool to plot PRISMA spectral profiles and query band values for the selected location.
In the Spectral Profile Sources panel you can easily alter the plot style.
Exercise B: Perform a land cover classification¶
- Derive a landcover map for the PRISMA raster
Use the Classification workflow algorithm to perform a full landcover classification. This includes training data preparation, fitting a Random Forest Classifier, and predicting landcover classes and class probabilities.
The original PRISMA raster and the derived classification and class probabilities can be visualized next to each other using multiple map views.
Finally, visualize the probabilities for the classes impervious, tree and water as RGB multiband color.
- Visualize the predicted maps
Use the Classification Statistics app to visualize the derived classification map.
Use the Class Fraction/Probability Statistics app to visualize the derived class probability map.
- View the fitted Random Forest Classifier model
The training data and the fitted model can be explored inside the Data Sources panel.
Last Update: 2020-08-12
Installation¶
Overview¶
If you like to develop an EnMAP-Box application, or more general, a QGIS and Qt application, we recommend to use a state-of-the-art Integrated Development Environment (IDE) like PyCharm. It offers run-time debugging, code completion, spell-checking, syntax highlighting, SCM support, unit-testing and many other helpful things.
1. Have Git installed¶
If not, download and install Git from https://git-scm.com/downloads
Check if git is installed to your local shell, e.g. as:
C:\Windows\System32>git --version
git version 2.26.0.windows.1
2. Clone this repository¶
Clone the EnMAP-Box repository (or a fork) to your local my_repositories
folder and update
its submodules by:
cd my_repositories
git clone --recurse-submodules git@github.com:EnMAP-Box/enmap-box.git
cd enmap-box
git config --local include.path ../.gitconfig
The last line ensures that pull requests will update submodules as well.
Now you can use git pull to update your local copy of the EnMAP-Box repository:
cd my_repositories/enmap-box
git pull
Tip
Replace the repo uri with that of your EnMAP-Box repo fork, if you like to provide code via pull requests.
3. Setup a QGIS environment¶
This section gives examples how you can setup a QGIS & EnMAP-Box development used by PyCharm on different platforms.
a) OSGeo4W (Windows)¶
- Install QGIS using the OSGeo4W Network installer https://qgis.org/en/site/forusers/download.html
- Install the OSGeo4W environment to a folder of choice (preferably one you have permanent writing access to). In following this is called OSGeo4W.
Start the OSGeo4W Setup.
- Go forward to these steps by clicking next. Usually the default settings should be fine
- ‘Advanced Install’
- ‘Install from Internet’
- ‘Root Directory’ (should be your OSGEO4W directory)
- Select Local Package Directory (default)
- Select Your Internet Connect (default Direct Connection)
- Choose A Download Site (default https://download.osgeo.org )
Select Packages to install / update
Package Note qgis recent official QGIS version python3-scikit-learn Press Next to install packages / updates
Copy the qgis-env.bat and start_pycharm.bat from https://github.com/EnMAP-Box/enmap-box/tree/main/scripts/OSGeo4W to a local folder, e.g. your windows desktop
Modify the qgis-env.bat config section to fit to your local environment, i.e. set the correct paths to your local OSGeoW installation and PyCharm executable
@echo off :: ### CONFIG SECTION ### :: root of local OSGEO4W installation set OSGEO4W_ROOT=D:\OSGeo4W :: PyCharm executable, adjust for version updates set PYCHARM_EXE="C:\Program Files (x86)\JetBrains\PyCharm 2022.1.2\bin\pycharm64.exe" :: git binaries and git lfs binaries set BIN_GIT=C:\Program Files\Git\bin set BIN_LFS=C:\Program Files\Git LFS
Call start_pycharm.bat to open PyCharm within the latest QGIS release. You can modify the start script to start a different QGIS build. E.g.
call "%~dp0\qgis-env.bat" qgis-ltr start "PYCHARM" /B %PYCHARM_EXE%
will start the QGIS Long Term Release (if installed) instead of the latest QGIS release (qgis).
Possible QGIS versions provided by the OSGeo4W installer are:
Build Description qgis QGIS Desktop (latest release) qgis-ltr QGIS Desktop (long term release) qgis-dev QGIS nightly build of the development branch qgis-rel-dev QGIS nightly build of the latest release branch
b) Linux¶
- Install QGI as described in https://qgis.org/en/site/forusers/download.html
c) macOS¶
- Install QGIS as described in https://qgis.org/en/site/forusers/download.html
d) Docker¶
tbd.
e) Setup Conda (all platforms)¶
Warning
Installing QGIS via conda is not officially supported by the QGIS core development team. The QGIS versions available in conda can therefore differ from the official QGIS versions!
The installation of QGIS within a conda / anaconda environment is (almost) the same on macOS, windows or linux. Using conda it is often much easier to install additional python packages while admin rights are not required.`
- Make sure conda is installed on your system.
- Create a new conda environment named qgis_stable as specified in conda_environment.yml:
conda env create --name qgis_stable --file https://raw.githubusercontent.com/EnMAP-Box/enmap-box/main/conda_environment.yml
Tip
Depending on the components and applications you like to use, it might be required to install more packages.
If you cloned the EnMAP-Box repository you can also point to the local conda_environment.yml
.
Edit the --name
or the YAML file itself as you wish. For more information on creating and managing conda environments visit the conda documentation
Activate the new environment
conda activate qgis_stable
Now you can start `QGIS`_, the Qt Designer and Qt Assistant from your conda shell:
qgis designer assistant
To easily start applications like PyCharm in this environment, which have not been installed by conda, you might define an alias during the activation of the environment.
Create an activation script and define an alias for PyCharm:
Windows: <your conda installation>/envs/qgis_stable/etc/conda/activate.d/pycharm-activate.bat
@echo off doskey pycharm="<path to pycharm executable>"
MacOS: <your conda installation>/envs/qgis_stable/etc.conda/activate.d/pycharm-activate.sh
alias pycharm='open -a PyCharm\ CE.app'
For completeness, also create a deactivation script:
Windows: <your conda installation>/envs/qgis_stable/etc/conda/deactivate.d/others-deactivate.bat
@echo off doskey pycharm=
MacOS/Linux: <your conda installation>/envs/qgis_stable/etc.conda/deactivate.d/pycharm-deactivate.sh
alias pycharm=
4. Setup PyCharm¶
Start PyCharm and add my_repositories/enmap-box as new project via File > Open File or Project
If this is not already the case, tell PyCharm where to find your Git-executable. Open File > Settings > Version Control > Git to set Path to Git executable. Press Test to check the used Git version.
Set the Git executable used by PyCharm
Tip
Use
where
to return the path of a git-executable that is available in your DOS/Linux/macOS shell(qgis_stable) C:\>where git C:\Users\geo_beja\AppData\Local\Programs\Git\cmd\git.exe
Switch to Project: enmap-box > Project Interpreter and select the QGIS python as python interpreter.
Add the qgis_stable python to the list of python interpreters
Select the qgis_stable python as project interpreter
Switch to Project Structure and add the QGIS python folder as additional project content root.
OSGeo4W <your OSGeo4W folder>\bin\python
Linux /usr/bin/python3
macOS /Application/QGIS.app/Contents/MacOS/bin/python3
conda (win) <your conda installation>/envs/qgis_stable/Library/python
conda (linux) <your conda installation>/envs/qgis_stable/share/qgis/python
conda (macOS) <your conda installation>/envs/qgis_stable/QGIS.app/Contents/MacOS/../Resources/python
Right-click on the
plugins
subfolder and select Sources. This makes QGIS internal plugins like the “processing” plugin available to PyCharm.Now the PyQGIS API is available to your Python installation.
Tip
The same way allows you to include other directories to your project’s PYTHONPATH, e.g. to make code available from other folder or repositories.
Use
qgis_stable/Library/python
as additional content rootPyCharm and PyQGIS may need the environmental variable
QGIS_PREFIX_PATH
. Typical paths are:QGIS Installation QGIS_PREFIX_PATH OSGeo4W <OSGeo4W>/apps/qgis Linux conda (Windows) <conda installation>\envs\qgis_stable\Library conda (Linux) <conda installation>/envs/qgis_stable conda (macOS) <conda installation>/envs/qgis_stable/QGIS.app/Contents/Resources If not already set in the environment from which you started PyCharm, you can set it explicitly. Open Run > Debug … > Edit Configurations and add the QGIS_PREFIX_PATH to the User environmental variables. This way PyCharm runs python files in a environment with QGIS_PREFIX_PATH defined.
Also define the Environment variables for the Python console. Go to File > Settings > Build, Execution, Deployment > Console > Python Console and add QGIS_PREFIX_PATH to the Environment variables.
You may also modify the shell used in your PyCharm terminal to use the QGIS environment. Open Tools > Terminal and set the shell path to, for example:
QGIS Installation Terminal path OSGeo4W cmd.exe "/K" qgis_env.bat
(see above how to create theqgis_env.bat
)conda (Windows) cmd.exe "/K" <conda installation>\Scripts\activate.bat qgis_stable
How to use the conda terminal in PyCharm
Test the Python environment
To check if the QGIS API is available, open a Python Console and import the QgsApplication object.
from qgis.core import QgsApplication QgsApplication.instance() is None
The output should return
True
, as we have not initialized any QgsApplication.Now check if we can use the EnMAP-Box API to start the EnMAP-Box
import enmapbox enmapbox.run()
This should initialize a new QgsApplication and start the EnMAP-Box. The outputs printed to the python shell should look like:
Application state: QGIS_PREFIX_PATH env var: D:\miniconda3\envs\qgis_stable\Library Prefix: D:\miniconda3\envs\qgis_stable\Library Plugin Path: D:\miniconda3\envs\qgis_stable\Library/plugins Package Data Path: D:\miniconda3\envs\qgis_stable\Library/. Active Theme Name: Active Theme Path: D:\miniconda3\envs\qgis_stable\Library/./resources/themes\\icons/ Default Theme Path: :/images/themes/default/ SVG Search Paths: D:\miniconda3\envs\qgis_stable\Library/./svg/ C:\Users\geo_beja\AppData\Local\Temp\QGIS-PythonTestConfigPathp1k7w_s_\profiles\default/svg/ User DB Path: D:\miniconda3\envs\qgis_stable\Library/./resources/qgis.db Auth DB Path: C:\Users\geo_beja\AppData\Local\Temp\QGIS-PythonTestConfigPathp1k7w_s_\profiles\default/qgis-auth.db
If the terminal environment was setup well, you can start the EnMAP-Box from the Terminal window as well by
(qgis_stable) ..\enmap-box>python enmapbox
Other Tools¶
The Qt company provides several tools to that help to create Qt applications and are useful for PyQt and PyQGIS users as well.
Qt Assistant¶
The Qt Assistant allows you to browse fast and offline through Qt help files (*.qch
). These files exists for
all Qt classes and the QGIS API. They can be generated event with Sphinx, which allows you to provide your
own source-code documentation as .qch
file as well.
Start the Qt Assistant, e.g. from your PyCharm terminal:
(qgis_stable) $>assistant
Download the
*.qch*
files which contain:- the Qt API documentation files: https://github.com/PierreRaybaut/PyQtdoc
- the QGIS API documentation qgis.qch
Go to Preferences > Add and add the following
*.qch
filesFile Documentation qgis.qch qgis.core, qgis.gui qtcore.qch Qt5.QtCore qtgui.qch Qt5.QtGui qtwidgets.qch Qt5.QtWidgets Now you can explore the Qt (
Q...
) and QGIS (Qgs...
) classes
Qt Designer¶
The Qt Designer is a powerful tool to create GUI frontends by drawing, drag and drop.
Created GUI form files are saved in a XML file ending with *.ui
. These can be called from
python to automatically create the entire GUI backend, e.g. windows and buttons defined with the Qt Designer.
You can start the Qt Designer from your PyCharm terminal by:
(qgis_stable) $>designer
Qt Creator¶
Qt Creator is the one-in-all IDE to develop Qt C++ applications. It includes the functionality covered by Qt Assistant (here called Help) and Qt Designer (here called form designer) and helps to browse C++ code. It is the preferred tool to explore the QGIS C++ source code, for example if you like to better understand what it does behind the QGIS python API.
Qt and the Qt Creator are available at https://www.qt.io/download. Ensure to install the code documentation for the same Qt version used by QGIS.
OSGeo4W for Devs¶
If you work on windows and want to test your code based on nightly builds of the upcoming QGIS version, or like to inspect/debug the QGIS C++ API at runtime, you might use the OSGeo4W installer to setup your development environment:
Setup Environment¶
Download the (new) OSGeo4W installer (osgeo4w-setup.exe from https://www.qgis.org/en/site/forusers/download.html )
Install the nightly build branch qgis-dev and related debug symbols qgis-dev-pdb.
Install other required packages, e.g. pip3 etc. Later on. In case of missing packages, search and install via OSGeo4W installer first. If not available there, use the OSGeo4W shell and call pip.
Create a qgis-dev-env.bat to setup your QGIS environment
set OSGEO4W_ROOT=D:\OSGeo4W set QGISDISTR=qgis-dev set DIR_GIT=C:\Program Files\Git\cmd set DIR_LFS=C:\Program Files\Git LFS :: add GIT and LFS to path call "%OSGEO4W_ROOT%\bin\o4w_env.bat" path %OSGEO4W_ROOT%\apps\%QGISDISTR%\bin;%DIR_GIT%;%DIR_LFS%;%PATH% set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/%QGISDISTR% set GDAL_FILENAME_IS_UTF8=YES rem Set VSI cache to be used as buffer, see #6448 set VSI_CACHE=TRUE set VSI_CACHE_SIZE=1000000 set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\%QGISDISTR%\qtplugins;%OSGEO4W_ROOT%\apps\qt5\plugins set PYTHONPATH=%OSGEO4W_ROOT%\apps\%QGISDISTR%\python;%OSGEO4W_ROOT%\apps\%QGISDISTR%\python\plugins;%PYTHONPATH%
Don’t forget to make git and git-lfs available in this environment.
Create a qgis-dev-pycharm.bat in the same folder as qgis-dev.bat that starts PyCharm
call "%~dp0\QGIS-dev.bat" set PYCHARM_EXE="C:\Program Files (x86)\JetBrains\PyCharm 2020.3.4\bin\pycharm64.exe" start "PYCHARM" /B %PYCHARM_EXE% :: uncomment to start QGIS :: start "QGIS" /B "%OSGEO4W_ROOT%\bin%QGISDISTR%-bin.exe" %*
Call qgis-dev-pycharm.bat to start PyCharm and set your project settings to:
Project Interpreter: <OSGEO4W>binpython.exe
Terminal Shell Path: cmd.exe “/K” <your path to>qgis-dev.bat (this is why we created two batch files. qgis-dev.bat setups the environment, but does not start any app)
add <OSGEO4W>appsqgis-devpython and <OSGEO4W>appsqgis-devpythonplugins as source folders
Debug QGIS with Visual Studio¶
- Clone the QGIS repo and checkout the latest master
- Install Visual Studio and open the QGIS repo
- Start a QGIS desktop, e.g. with qgis-dev from the OSGeo4W shell
- Attach the Visual Studio debugger to a QGIS desktop instance
- Open Debug > Attach to Process (CTRL+ALT+P)
- Filter available processes by ‘QGIS’ and, e.g., select qgis-dev-bin.exe
- Press the Attach button
References¶
- Git -the simple guide (no deep shit) https://rogerdudler.github.io/git-guide/
- Qt5 C++ API https://doc.qt.io/qt-5/
- QGIS C++ API https://api.qgis.org/api/
- QGIS Python https://qgis.org/pyqgis
- QGIS Python developer cookbook https://docs.qgis.org/3.4/en/docs/pyqgis_developer_cookbook
EnMAP-Box repository¶
The EnMAP-Box source code is hosted in a Git repository at https://github.com/EnMAP-Box/enmap-box
Structure¶
Overview¶
The repository contains the following files and folders:
Folder/File | Purpose |
---|---|
doc/ | EnMAP-Box Sphinx *.rst documentation |
doc_*/ | Deprecated doc folders (will be removed) |
enmapbox/ | EnMAP-Box source code |
enmapboxtesting/ | Unit tests |
scripts/ | Scripts to maintain the repository and build the EnMAP-Box QGIS Plugin |
examples/ | Code examples how to use the EnMAP-Box API |
examples/minimumexample/ | Exemplary EnMAP-Box Application |
site-packages/ | Other python libraries the EnMAP-Box depends on |
snippets/ | Small source code snippets. |
CHANGELOG | |
LICENCE.txt | |
LICENCE.md | |
README.md | |
__init__.py | |
CONTRIBUTORS.md | |
index.html | |
requirements.txt | |
requirements_developer.txt | |
setup.py | required for read-the-docs installation |
.gitignore | defines files that should be ignored by the repository |
.gitattributes | defines binary files that are stored with git-lfs |
.readthedocs.yml |
Scripts for Developers¶
The scripts
directory contains scrips to support developers. Ensure that this folder is part of your python path, e.g add
it as source in your PyCharm project (left-mouse, mark directory as source):
Script | Purpose |
---|---|
scripts/setup_repository.py |
Creates resource files etc. required to test the EnMAP-Box by calling other scripts |
scripts/create_plugin.py |
Create the EnMAP-Box Plugin ZIP file. |
scripts/create_plugin.py |
Create the two shell-scripts runtests.bat and runtests.sh to run unit tests. |
scripts/install_testdata.py |
Downloads and installs the EnMAP-Box testdata and qgisresources |
scripts/compile_resourcefiles.py |
Complies EnMAP-Box resources (*.svg, *.png) into *_rc.py files |
scripts/iconselect.py |
Opens a browser to show EnMAP-Box and QGIS resources, e.g. icons |
Generated Folders¶
Some directories and files are not part of the repository and explicitly ignore in the .gitignore file, but required or created during the development process. These are:
enmapboxtestdata/ | Official EnMAP-Box testdata. Not part of repository code, can be installed calling
scripts/install:_testdata.py . |
enmapboxunittestdata/ | Unit test testdata. Not part of repository code, can be installed calling
scripts/install:_testdata.py . |
qgisresources/ | QGIS resources compiled as python modules. Read here for details. |
deploy/ | Builds of the EnMAP-Box plugin. |
deploy/enmapboxplugin | Folder with last EnMAP-Box Plugin build. |
deploy/enmapboxplugin.3.X…zip | Zipped version of a EnMAP-box Plugin build. |
Install the EnMAP-Box repository¶
Open your shell, clone the EnMAP-Box repository including its submodules:
cd <my_repositories> git clone --recurse-submodules git@github.com:EnMAP-Box/enmap-box.git cd enmapbox git config --local include.path ../.gitconfig
- Add
<my_repositories>/enmapbox/
as source location to your PyCharm project (instead of that in your QGIS active profile!)
- Add
(Optional) install the QGIS source code repository.
For the next step, but also if you like to discover the QGIS ++ code, it is recommended to install the QGIS repository as well. Some EnMAP-Box scripts can use data from the QGIS source code, e.g. to show images that otherwise are available on runtime in the QGIS Desktop application only.
cd <my_repositories> git clone https://github.com/qgis/QGIS.git
Now define a environmental variable
QGIS_REPO
in the IDE / PyCharm startup script (4. Setup PyCharm)OS Command Windows set QGIS_REPO=<my_repositories/QGIS> Linux /macOS DIR_REPO=<my_repositories/QGIS> export QGIS_REPO Run
scripts/setup_repository.py
to create Qt resource modules and perform a dependency check.The EnMAP-Box uses the Qt resource system (see https://doc.qt.io/qt-5/resources.html for details) to access icons. This step creates for each Qt resource file (
filename.qrc
) a corresponding python module (filename.py
) that contains a binary encrypted description of resources (icons, images, etc.). During startup, these resources are loaded and can be accessed by resource path strings.The EnMAP-Box re-uses several icons provided by the QGIS desktop application. For example, the QGIS icon for raster layers is available at
:/images/themes/default/mIconPolygonLayer.svg
and can be visualized in the QGIS python shell as followed:If we start and develop application from inside PyCharm, we usually don’t have access to QGIS desktop application resources. However, if you have downloaded the QGIS repository as described above,
scripts/setup_repository.py
will look for it, compile the resource files and write them into folderenmap-box/qgisresources
.
Install / Update EnMAP-Box Testdata¶
The most-recent EnMAP-Box testdata is hosted on https://bitbucket.org/hu-geomatics/enmap-box/downloads
If missing or outdatet, it will be downloaded and installed after a user
clicks on Project > Load Example Data. The downloaded data will be extracted into
<root>/enmapboxtestdata
, with <root>
either being the EnMAP-Box repository folder or the QGIS plugin installation
folder.
The testdata can be download explicitly:
import enmapbox.dependencycheck
enmapbox.dependencycheck.installTestData(ask=False, overwrite_existing=True)
Get Updates from other Repositories¶
The EnMAP-Box includes source-code from external code repositories. They are defined as submodules in .gitmodules, e.g. like:
[submodule "enmapbox/qgispluginsupport"]
path = enmapbox/qgispluginsupport
url = git://github.com/EnMAP-Box/qgispluginsupport.git
pushurl = git@github.com:EnMAP-Box/qgispluginsupport.git
branch = master
Updating submodules from its origin lication (url
) can be done by:
.. code-block:: bash
cd enmapbox git submodule update –remote
Pushing local modification into a new branch of the submodule’s origin can be done with:
cd <path/submodule>
git add .
git commit -m "my changes"
git push -u origin HEAD:my_update_branch
Build and publish the EnMAP-Box¶
Build the EnMAP-Box Plugin¶
Building the EnMAP-Box plugin is done by creating a zip file which the QGIS Plugin Manager can use to install the EnMAP-Box. This requires that you have setup your development environment as described in the installation for developers
Calling:
python scripts/create_plugin.py
creates or updates the folder deploy
with:
- the folder
enmapboxplugin
. It contains the plugin code and additional files - a file named like
enmapboxplugin.3.7.20190214T1125.develop.zip
. This is theenmapboxplugin`
folder compresses as zip file, which can be used by the QGIS Plugin Installer to install the EnMAP-Box.
Using the -t
keyword adds the EnMAP-Box test data, so that you can use and test the EnMAP-Box in QGIS
with having example data already installed.
Note
The <subsubversion>
consists of <date>T<time>.<active branch>
and is generated automatically.
This helps to generate, test and differentiate between EnMAP-Box versions of different development steps.
A successful build ends with a printout like:
### To update/install the EnMAP-Box, run this command on your QGIS Python shell:
from pyplugin_installer.installer import pluginInstaller
pluginInstaller.installFromZipFile(r"C:\Users\user\Repositories\QGIS_Plugins\enmap-box\deploy\enmapboxplugin.3.5.20191030T0634.develop.zip")
#### Close (and restart manually)
QProcess.startDetached(QgsApplication.arguments()[0], [])
QgsApplication.quit()
## press ENTER
Copy and run it in your QGIS python shell to install the build EnMAP-Box plugin and restart QGIS. Alternatively, you can install the plugin in QGIS with a few mouse clicks more by:
- Open the QGIS Plugin Manager
- Install from ZIP with the created ZIP file
- Restart QGIS to account for activate changes in python code
Build the EnMAP-Box documentation¶
To create the HTML based documentation on your local system call:
cd doc
make html
This creates the folder doc/build
with the HTML documentation. To view the documentation,
just open doc/build/html/index.html
in your webbrowser of choice.
Publish the EnMAP-Box¶
Official EnMAP-Box plugin master versions are named like enmapboxplugin.3.3.20190214T1125.main.zip
. They need to be uploaded
to https://plugins.qgis.org/plugins/ using an OSGeo account.
Other versions, e.g. development snapshots are named like enmapboxplugin.3.3.20190214T1125.develop.zip
or enmapboxplugin.3.3.20190214T1125.my_feature_branch.zip
and might be distributed using the repositories download section https://bitbucket.org/hu-geomatics/enmap-box/downloads/.
Updates to the EnMAP-Box documentation (folder doc/source
) are detected by readthedocs
when pushed to the develop or master branch of the EnMAP-Box repository.
Dev Cookbook¶
EnMAP Cookbook¶
The following examples show how to interact with the EnMAP-Box GUI. They are available unittest TestCases in examples/api_examples.py
Important
For simplicity, we always import the following Qt and QGIS libraries globally:
from qgis.core import *
from qgis.gui import *
from qgis.PyQt.QtWidgets import *
from qgis.PyQt.QtGui import *
from qgis.PyQt.QtCore import *
So we can use several classes like QgsMapCanvas or QWidget and do not need to import them explicitly.
1. Start the EnMAP-Box¶
As we like to start our examples from an IDE like PyCharm, we first need to start a QgsApplication. It provides the main GUI loop that receives user interactions, like mouse clicks and keyboard entries:
from enmapbox.testing import start_app
qgsApp = start_app()
Now we can start and open the EnMAP-Box and load some example data:
from enmapbox import EnMAPBox
enmapBox = EnMAPBox(None)
enmapBox.openExampleData()
qgsApp.exec_()
If we would’nt call the GUI loop with qgsApp.exec_()
, our program will terminate immediately.
The EnMAPBox object is a singleton, which means that there exist only one EnMAPBox instance. You can connect to a running EnMAP-Box instance like this:
from enmapbox import EnMAPBox
enmapBox = EnMAPBox.instance()
print(enmapBox)
Finally, shut down the EnMAP-Box instance:
enmapBox = EnMAPBox.instance()
enmapBox.close()
2. Data Sources¶
The EnMAP-Box differentiates between Raster, Vector, Spectral Libraries and other data sources. To add new data sources,
you just need to provide a file-path or other unique resource identifier via enmapBox.addSource(r'uri')
enmapBox = EnMAPBox.instance()
# add some data sources
from enmapboxtestdata import enmap as pathRasterSource
from enmapboxtestdata import landcover_polygons as pathVectorSource
from enmapboxtestdata import library as pathSpectralLibrary
#add a single source
enmapBox.addSource(pathRasterSource)
#add a list of sources
enmapBox.addSources([pathVectorSource, pathSpectralLibrary])
A the EnMAP-Box uses the QGIS API to visualize spatial data, we can add OpenGIS Web Services (OWS) like Web Map Services (WMS) and Web Feature Services (WFS) as well:
wmsUri = 'referer=OpenStreetMap%20contributors,%20under%20ODbL&type=xyz&url=https://tiles.wmflabs.org/hikebike/%7Bz%7D/%7Bx%7D/%7By%7D.png&zmax=17&zmin=1'
wfsUri = r'restrictToRequestBBOX=''1'' srsname=''EPSG:25833'' typename=''fis:re_postleit'' url=''https://fbinter.stadt-berlin.de/fb/wfs/geometry/senstadt/re_postleit'' version=''auto'''
enmapBox.addSource(wmsUri, name="Open Street Map")
enmapBox.addSource(wfsUri, name='Berlin PLZ')
.. image:: ../img/gstart_datasources.png
:width: 100%
You can iterate over all or specific type of data sources:
for source in enmapBox.dataSources():
print(source)
for source in enmapBox.dataSources('RASTER'):
print(source)
Data sources can be removed by its source path:
enmapBox = EnMAPBox.instance()
enmapBox.removeSource('source_path')
# or remove multiple sources
enmapBox.removeSources(['list-of-source_path'])
EnMAP-Box Data sources are unique; which means that only one data source refers to the same source path. Adding the same source multiple times does not change the total number of data sources:
from enmapbox import EnMAPBox
from enmapboxtestdata import enmap
enmapBox = EnMAPBox(None)
enmapBox.addSource(enmap)
print('# data sources: {}'.format(len(enmapBox.dataSources())))
# add the same source again
enmapBox.addSource(enmap)
print('# data sources: {}'.format(len(enmapBox.dataSources())))
Note
- Data sources are internally described by the enmapbox.gui.datasources.DataSource class.
- A DataSource object stores information on the data source uri, name, type and its creation date.
The Qt Signals sigDataSourceAdded and sigDataSourceAdded can be used to be informed on changes of the EnMAP-Box data sources:
from enmapbox import EnMAPBox
enmapBox = EnMAPBox(None)
enmapBox.sigDataSourceAdded.connect(lambda uri:print('DataSource added: {}'.format(uri)))
enmapBox.sigDataSourceRemoved.connect(lambda uri: print('DataSource removed: {}'.format(uri)))
Overwriting a file source and adding it again to the EnMAP-Box will remove the data source first and add it’s again. This allows to react on changes and to ensure data integrity, e.g. to account for changes in file size and metadata.
Create a text file and add it to the EnMAP-Box:
import tempfile, os, time
tempDir = tempfile.mkdtemp()
pathFile = os.path.join(tempDir, 'testfile.txt')
with open(pathFile, 'w', encoding='utf-8') as f:
f.write('First version')
assert os.path.isfile(pathFile)
enmapBox.addSource(pathFile)
assert len(enmapBox.dataSources()) == 1
This creates a printout like:
DataSource added: C:\Users\user\AppData\Local\Temp\tmp4gjczg1u\testfile.txt
Wait a while, then overwrite the text file and add it again:
time.sleep(2)
with open(pathFile, 'w', encoding='utf-8') as f:
f.write('Second version')
assert os.path.exists(pathFile)
enmapBox.addSource(pathFile)
assert len(enmapBox.dataSources()) == 1
The shell printouts should be like:
DataSource removed: C:\Users\user\AppData\Local\Temp\tmp4gjczg1u\testfile.txt
DataSource added: C:\Users\user\AppData\Local\Temp\tmp4gjczg1u\testfile.txt
3. Dock Windows¶
The EnMAP-Box Docks to visualize spatial data and spectral libraries. Docks are based on the pyqtgraphDock which inherits QDockWidget, but can be arranged much more flexible, e.g. in nested layouts. We use these Docks as containers for specialized widgets, in particular the enmapbox.gui.mapcanvas.MapCanvas (as MapDock) and the SpectralLibraryWidget (SpectralLibraryDock).
You can create new docks with EnMAPBox.createDock('<dockType>')
:
from enmapbox.gui.enmapboxgui import EnMAPBox, Dock, MapDock, SpectralLibraryDock
enmapBox = EnMAP-Box.instance()
enmapBox.createDock('MAP') # a spatial map
enmapBox.createDock('SPECLIB') # a spectral library
enmapBox.createDock('TEXT') # a text editor
enmapBox.createDock('WEBVIEW') # a browser
enmapBox.createDock('MIME') # a window to drop mime data (for developers)
Dock titles, visibility and behaviour can be modified:
# modify dock properties
mapDock1 = enmapBox.createDock('MAP')
mapDock2 = enmapBox.createDock('MAP')
mapDock3 = enmapBox.createDock('MAP')
# set dock title
mapDock1.setTitle('Map 1 (fixed)')
mapDock2.setTitle('Map 2 (floated)')
mapDock3.setTitle('Map 3 (hidden)')
mapDock2.float()
mapDock3.setVisible(False)
Docks can be accessed similar to DataSources:
from enmapbox.gui.docks import Dock, SpectralLibraryDock
for dock in enmapBox.dockManager().docks():
assert isinstance(dock, Dock)
print(dock)
The dockType keyword serves as filter:
# list map docks only
for dock in enmapBox.dockManager().docks(dockType='MAP'):
assert isinstance(dock, Dock)
print(dock)
# list all spectral library docks
for dock in enmapBox.dockManager().docks(dockType='SPELCIB'):
assert isinstance(dock, Dock)
print(dock)
5. Map Tools¶
QgsMapTools control what happens when a user clicks into a QgsMapCanvas, e.g. to zoom in or zoom out. You can set the current map tool as followed:
from enmapbox.gui import MapTools
enmapBox.setMapTool(MapTools.ZoomIn)
The map tool will be set to all MapCanvases known to the EnMAP-Box, in particular those in MapDocks. Possible map tools are:
Icon | Key (str) | Key (Enum) | Description |
---|---|---|---|
PAN |
MapTools.Pan |
Activate pan tool to move the map | |
ZOOM_IN |
MapTools.ZoomIn |
Zoom in | |
ZOOM_OUT |
MapTools.ZoomOut |
Zoom Out | |
ZOOM_FULL |
MapTools.Zoom Full |
Zoom to the full extend | |
ZOOM_PIXEL_SCALE |
MapTools.ZoomPixelScale |
Raster pixel have same size like screen pixel | |
CURSOR_LOCATION |
MapTools.CursorLocation |
Select cursor location information |
6. Spatial Points and Extents¶
Working with spatial data often requires to convert coordinates between different coordinate reference systems (CRS). The EnMAP-Box classes SpatialPoint and SpatialExtent inherit QgsPointXY and QgsRectangle, respectively and enhance their parent classes by keeping a reference on the QgsCoordinateReferenceSystem used to specify the coordinates.
Retrieve a QgsRasterLayer center coordinate and convert it into geographic lat/lon coordinates:
from enmapboxtestdata import enmap
from enmapbox.gui import SpatialPoint
layer = QgsRasterLayer(enmap)
point = SpatialPoint.fromMapLayerCenter(layer)
targetCrs = QgsCoordinateReferenceSystem('EPSG:4326')
print('Original CRS: "{}"'.format(layer.crs().description()))
print('QgsPointXY : {}'.format(QgsPointXY(point)))
print('SpatialPoint: {}\n'.format(point))
pointTargetCRS = point.toCrs(targetCrs)
print('Target CRS : "{}"'.format(targetCrs.description()))
print('QgsPointXY : {}'.format(QgsPointXY(pointTargetCRS)))
print('SpatialPoint: {}\n'.format(pointTargetCRS))
Same can be done with map layer extents:
from enmapbox.gui import SpatialExtent
extent = SpatialExtent.fromLayer(layer)
print('Original CRS: "{}"'.format(layer.crs().description()))
print('QgsRectangle : {}'.format(QgsRectangle(extent)))
print('SpatialExtent: {}'.format(extent))
extentTargetCRS = point.toCrs(targetCrs)
print('Target CRS: "{}"'.format(targetCrs.description()))
print('QgsRectangle : {}'.format(QgsPointXY(pointTargetCRS)))
print('SpatialExtent: {}'.format(extentTargetCRS))
Note
Be aware that some CRS transformations are not possible and might cause errors. This might happen in particular when transforming coordinates from regional projected CRS, like an UTM Zone, into a CRS that is defined for another region of the world.
7. Map Locations and Spectral Profiles¶
The EnMAP-Box emits a sigCurrentLocationChanged signal if the Identify map tool is activated and user left-clicks on a map canvas.

from enmapbox.gui import MapTools, SpatialPoint
def printLocation(spatialPoint:SpatialPoint):
print('Mouse clicked on {}'.format(spatialPoint))
enmapBox.sigCurrentLocationChanged.connect(printLocation)
The overloaded sigCurrentLocationChanged signature can be used to get the map canvas instance where the location was selected from:
def printLocationAndCanvas(spatialPoint: SpatialPoint, canvas:QgsMapCanvas):
print('Mouse clicked on {} in {}'.format(spatialPoint, canvas))
enmapBox.sigCurrentLocationChanged[SpatialPoint, QgsMapCanvas].connect(printLocationAndCanvas)
If “Identify raster profile” is activated, the EnMAP-Box extracts SpectralProfiles from the raster layer(s) below the mouse-click location. These spectra can be received from the sigCurrentSpectraChanged signal:

def printSpectralProfiles(currentSpectra:list):
print('{} SpectralProfiles collected'.format(len(currentSpectra)))
for i, p in enumerate(currentSpectra):
assert isinstance(p, QgsFeature)
p = SpectralProfile.fromSpecLibFeature(p)
assert isinstance(p, SpectralProfile)
print('{}: {}'.format(i+1, p.values()['y']))
enmapBox.sigCurrentSpectraChanged.connect(printSpectralProfiles)
The last cursor location and/or spectral profiles are saved and can be accessed:
print('Last location: {}'.format(enmapBox.currentLocation()))
print('Last SpectralProfile: {}'.format(enmapBox.currentSpectra()))
Create EnMAP-Box Applications¶
Applications for the EnMAP-Box define an EnMAPBoxApplication instance that describes basic
information like the Applications name and how a user can start it. The following examples are taken from the
examples/minimumexample
package, which you might copy and modify to implement own EnMAPBox Applications.
1. Initialize a new EnMAP-Box Application¶
An EnMAP-Box application inherits from EnMAPBoxApplication and defines basic information like a name and version. The variable license defaults to GNU GPL-3, but might be changed:
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtWidgets import QMenu, QAction, QWidget, QHBoxLayout, QLabel, QPushButton
from enmapbox.gui.applications import EnMAPBoxApplication
from qgis.core import *
VERSION = '0.0.1'
LICENSE = 'GNU GPL-3'
APP_DIR = os.path.dirname(__file__)
APP_NAME = 'My First EnMAPBox App'
class ExampleEnMAPBoxApp(EnMAPBoxApplication):
"""
This Class inherits from an EnMAPBoxApplication
"""
def __init__(self, enmapBox, parent=None):
super(ExampleEnMAPBoxApp, self).__init__(enmapBox, parent=parent)
#specify the name of this app
self.name = APP_NAME
#specify a version string
self.version = VERSION
#specify a licence under which you distribute this application
self.licence = LICENSE
3. Define QgsProcessingAlgorithms for the EnMAPBoxAlgorithm Provider¶
Your Application might provide one or multiple QgsProcessingAlgorithms for the QGIS Processing Framework. This way your algorithms become visible in the QGIS Processing Toolbox and can be used in the QGIS Model Builder. To add your QgsProcessingAlgorithms to the EnMAP-Box Algorithm Provider implement EnMAPBoxApplication.processingAlgorithms(…).
For the sake of simplicity, let’s define a simple function and a QgsProcessingAlgorithm to call it:
def exampleAlgorithm(*args, **kwds)->list:
"""
An dummy algorithm that prints the provided arguments and keywords and returns its inputs.
"""
print('Start exampleAlgorithm...')
text = ['Arguments: {}'.format(len(args))]
for i, a in enumerate(args):
text.append('Argument {} = {}'.format(i+1, str(a)))
text.append('Keywords: {}'.format(len(kwds)))
for key, parameter in kwds.items():
text.append('{} = {}'.format(key, parameter))
print('\n'.join(text))
print('exampleAlgorithm finished')
return args, kwds
class ExampleProcessingAlgorithm(QgsProcessingAlgorithm):
"""
Exemplary implementation of a QgsProcessingAlgorithm.
See https://api.qgis.org/api/classQgsProcessingAlgorithm.html for API documentation
"""
def __init__(self):
super(ExampleProcessingAlgorithm, self).__init__()
def createInstance(self)->QgsProcessingAlgorithm:
"""
Creates a new instance of the algorithm class.
:return: QgsProcessingAlgorithm
"""
return ExampleProcessingAlgorithm()
def name(self)->str:
return 'examplealgorithm'
def displayName(self):
return 'Minimal Example Algorithm'
def groupId(self)->str:
"""
Returns the unique ID of the group this algorithm belongs to.
:return: str
"""
return GROUP_ID
def group(self)->str:
"""
Returns the name of the group this algorithm belongs to.
:return: str
"""
return APP_NAME
def initAlgorithm(self, configuration:dict=None):
"""
Initializes the algorithm using the specified configuration.
:param configuration: dict
"""
self.addParameter(QgsProcessingParameterRasterLayer('pathInput', 'The Input Dataset'))
self.addParameter(QgsProcessingParameterNumber('value','The value', QgsProcessingParameterNumber.Double, 1, False, 0.00, 999999.99))
self.addParameter(QgsProcessingParameterRasterDestination('pathOutput', 'The Output Dataset'))
def processAlgorithm(self, parameters:dict, context:QgsProcessingContext, feedback:QgsProcessingFeedback):
"""
Runs the algorithm using the specified parameters.
:param parameters: dict
:param context: QgsProcessingContext
:param feedback: QgsProcessingFeedback
:return: dict
"""
assert isinstance(parameters, dict)
assert isinstance(context, QgsProcessingContext)
assert isinstance(feedback, QgsProcessingFeedback)
args, kwds = exampleAlgorithm(parameters)
outputs = {'args' : args, 'kwds': kwds}
return outputs
Now define EnMAPBoxApplication.processingAlgorithms(…) to add the ExampleProcessingAlgorithm to the EnMAPBoxProcessingProvider:
def processingAlgorithms(self)->list:
"""
This function returns the QGIS Processing Framework algorithms specified by your application
:return: [list-of-QgsProcessingAlgorithms]
"""
return [ExampleProcessingAlgorithm()]
Calling the ExampleProcessingAlgorithm from the QGIS Processing Toolbox should now create a printout on your python console like:
Parameters:
pathInput = <qgis._core.QgsRasterLayer object at 0x0000018AA3C47A68>
pathOutput = <QgsProcessingOutputLayerDefinition {'sink':C:/Users/ivan_ivanowitch/AppData/Local/Temp/processing_cb76d9820fc64087aa8264f0f8505334/642d8e0abb764557881346399dda9c68/pathOutput.bsq, 'createOptions': {'fileEncoding': 'System'}}>
value = 1.0
4. Create a Graphical User Interface¶
The startGUI() function is used to open the graphical user interface. A very simple GUI could be:
def onButtonClicked():
print('Button was pressed')
w = QWidget()
w.setLayout(QVBoxLayout())
w.layout().addWidget(QLabel('Hello World'))
btn = QPushButton()
btn.setText('click me')
btn.clicked.connect(onButtonClicked)
w.layout().addWidget(btn)
w.show()
A GUI quickly becomes complex if programmed line-by-line only. We prefer to use the QDesigner. It allows to draw the GUI frontend which then is saved as *.ui XML file. This file can be translated into the PyQt code where you just write the backend.
List of environmental variables¶
Warning
This will be changed soon
The following environmental variables can be set to change the starting behaviour of the EnMAP-Box.
Name | Values, * = Default | Description |
---|---|---|
EMB_LOAD_PF | TRUE*/FALSE | Load QGIS processing framework. |
EMB_LOAD_EA | TRUE*/FALSE | Loads external applications. |
EMB_DEBUG | TRUE/FALSE* | Enable additional debug printouts. |
EMB_SPLASHSCREEN | TRUE*/FALSE | Splashscreen on EnMAP-Box start. |
EMB_MESSAGE_TIMEOUT | integer | Timeout in seconds for popup messages in the message bar. |
EMB_APPLICATION_PATH | string | list of directories (separated by ‘;’ or ‘n’ (newline)) to load EnMAPBoxApplications from. |
RFC list¶
This section is a collection of request for comments (RFC).
RFC 1: Enhanced GDAL PAM for QGIS Raster Layers¶
Author: Andreas Janz
Contact: andreas.janz@geo.hu-berlin.de
Started: 2021-12-23
Last modified: 2022-01-10
Status: Proposed
Summary¶
It is proposed that the well known GDAL raster metadata handling is extented to QgsRasterLayer objects via the custom layer property interface. This approach is refered to as QGIS PAM (in analogy to the existing GDAL PAM).
By default, information is fetched from QGIS PAM first, and, if not available, from GDAL PAM as usual.
Edits to QGIS PAM are stored as map layer custom properties (QgsMapLayer.customProperties), which are stored in-memory at the layer object, inside the QGIS project, and inside layer QML style file.
API support for QGIS PAM management will be implemented in the enmapboxprocessing.rasterreader.RasterReader class.
Motivation¶
GDAL organises raster metadata in a PAM (Persistent Auxiliary Metadata) *.aux.xml file. Reading and writing GDAL PAM items is done via gdal.Dataset and gdal.Band objects.
Currently we restrict metadata handling to GDAL raster. Metadata IO is implemented using the GDAL API:
On the dataset level we use:
value = gdal.Dataset.GetMetadataItem(key, domain)
valueDict = gdal.Dataset.GetMetadata(domain)
valuesDictDict = gdal.Dataset.GetMetadata_Dict()
gdal.Dataset.SetMetadataItem(key, value, domain)
gdal.Dataset.SetMetadata(valueDict, domain)
gdal.Dataset.SetMetadata_Dict(valueDictDict)
On the band level we use:
value = gdal.Band.GetMetadataItem(key, domain)
valueDict = gdal.Band.GetMetadata(domain)
valuesDictDict = gdal.Band.GetMetadata_Dict()
gdal.Band.SetMetadataItem(key, value, domain)
gdal.Band.SetMetadata(valueDict, domain)
gdal.Band.SetMetadata_Dict(valueDictDict)
This is fully sufficient for raster processing, but can be limiting in GUI applications, where we usually don’t use gdal.Dataset, but QgsRasterLayer objects.
Problem: QgsRasterLayer class can’t access GDAL PAM directly. We need to re-open the layer source via gdal.Open, which is usually fine for read-access. But when writing new items to the GDAL PAM aux.xml file, the approach fails, because QGIS will overwrite the aux.xml file again, when the QgsRasterLayer object is closed.
Approach¶
We introduce another level of abstraction on top of GDAL PAM, using QGIS custom properties (i.e. QGIS PAM)
On the dataset level we use the following standardized property key format:
value = layer.customProperty('QGISPAM/dataset/<domain>/<key>')
layer.setCustomProperty('QGISPAM/dataset/<domain>/<key>', value)
On the band level we use:
value = layer.customProperty('QGISPAM/band/<bandNo>/<domain>/<key>')
layer.setCustomProperty('QGISPAM/band/<bandNo>/<domain>/<key>', value)
An application that queries metadata from a raster source should use the following priorities:
- Check QGIS PAM first.
- If not found, check GDAL PAM afterwards.
- If still not found, use a suitable fallback value.
Technically: QGIS PAM shadows GDAL PAM
- Guide line 1:
- If you need to set metadata in a processing algorithm: set it to GDAL PAM, so that GDAL can read it later!
- Guide line 2:
- If you need to set/update metadata in a GUI application: set it to QGIS PAM.
Implementation¶
Technically, we don’t need any new functions or methods, because we fully rely on the layer custom property interface.
But, the handling of property keys, and QGIS PAM over GDAL PAM priority, can be tedious and should be encapsulated in utils functions or methods. An example implementation is given by the RasterReader class.
On the dataset level we can use:
from enmapboxprocessing.rasterreader import RasterReader
reader = RasterReader(layer)
value = reader.metadataItem(key, domain)
reader.setMetadataItem(key, value, domain)
On the band level we use:
from enmapboxprocessing.rasterreader import RasterReader
reader = RasterReader(layer)
value = reader.metadataItem(key, domain, bandNo)
reader.setMetadataItem(key, value, domain, bandNo)
Also check out the RasterReader unittests: https://github.com/EnMAP-Box/enmap-box/blob/main/enmapboxprocessing/test/test_rasterreaderrfc1.py
RFC 2: Spectral Properties¶
Author: Andreas Janz
Contact: andreas.janz@geo.hu-berlin.de
Started: 2021-12-23
Last modified: 2021-12-24
Status: Proposed
Summary¶
It is proposed to implement functions or methods for reading and writing spectral properties from/to QGIS PAM. Relevant items are: center wavelength, wavelength units, full width at half maximum (fwhm) and bad band multiplier values.
Both, QGIS and GDAL, don’t have a concept for spectral property management. In GDAL we have rudimentary support for ENVI files. We currently use the ENVI format as a conceptual base for spectral property handling in the EnMAP-Box.
The here proposed approach will integrate spectral property handling into QGIS PAM management, while honoring the well known ENVI format and naming conventions. This allows to set/update spectral properties for QgsRasterLayer objects, which is critical for GUI applications.
API support will be implemented in the enmapboxprocessing.rasterreader.RasterReader class.
Motivation¶
GDAL has rudimentary support for spectral properties specified inside ENVI *.hdr header files:
ENVI
...
wavelength units = Micrometers
wavelength = {0.46, 0.465, 0.47, ..., 2.393, 2.401, 2.409}
fwhm = {0.0058, 0.0058, 0.0058, ..., 0.0091, 0.0091, 0.0091}
bbl = {1, 1, 1, ..., 1, 1, 1}
GDAL will dump all items into the ENVI dataset domain, including relevant spectral properties like the list of center wavelength, the wavelength units, the list of full width at half maximum (fwhm) values, and the list of bad band multipliers (bbl):
<Metadata domain="ENVI">
...
<MDI key="fwhm">{ 0.005800, 0.005800, 0.005800, ..., , 0.009100, 0.009100, 0.009100}</MDI>
<MDI key="wavelength">{ 0.46, 0.465, 0.47, ..., 2.393, 2.401, 2.409}</MDI>
<MDI key="bbl">{ 1, 1, 1, ..., 1, 1, 1}</MDI>
<MDI key="wavelength_units">Micrometers</MDI>
</Metadata>
GDAL will store the wavelength units inside the default dataset domain:
<Metadata>
<MDI key="wavelength_units">Micrometers</MDI>
</Metadata>
For each band, GDAL will store center wavelength and wavelength units inside the band default domain:
<PAMRasterBand band="1">
<Metadata>
<MDI key="wavelength">0.46</MDI>
<MDI key="wavelength_units">Micrometers</MDI>
</Metadata>
</PAMRasterBand>
<PAMRasterBand band="2">
<Metadata>
<MDI key="wavelength">0.465</MDI>
<MDI key="wavelength_units">Micrometers</MDI>
</Metadata>
</PAMRasterBand>
...
Given that ENVI specific behaviour, we propose the following approach for fetching band-specific spectral properties.
Approach¶
Band-wise spectral properties like wavelength, wavelength units, full width at half maximum (fwhm), and bad band multiplier values, are fetched with the following priorisation:
1. Look at QGIS PAM band default domain. This is mainly relevant for GUI applications, where we need to set/update spectral properties using QgsRasterLayer objects:
wavelengthUnits = layer.customProperty('QGISPAM/band/42//wavelength_units')
wavelength = layer.customProperty('QGISPAM/band/42//wavelength')
fwhm = layer.customProperty('QGISPAM/band/42//fwhm')
badBandMultiplier = layer.customProperty('QGISPAM/band/42//bad_band_multiplier')
2. Look at GDAL PAM band default domain. This follows the behaviour of the ENVI driver, that sets wavelength and wavelength units to this location. We consequently also look for fwhm and bad band multiplier here:
wavelengthUnits = gdalDataset.GetRasterBand(42).GetMetadataItem('wavelength_units')
wavelength = gdalDataset.GetRasterBand(42).GetMetadataItem('wavelength')
fwhm = gdalDataset.GetRasterBand(42).GetMetadataItem('fwhm')
badBandMultiplier = gdalDataset.GetRasterBand(42).GetMetadataItem('bbl')
3. Look at GDAL PAM dataset ENVI domain. This follows the behaviour of the ENVI driver, that sets lists of wavelength, fwhm and bad band multipliers (bbl) and the wavelength units to this location:
wavelengthUnit = gdalDataset.GetMetadataItem('wavelength_unit', 'ENVI')
wavelength = parseEnviString(gdalDataset.GetMetadataItem('wavelength', 'ENVI'))[42 - 1]
fwhm = parseEnviString(gdalDataset.GetMetadataItem('fwhm', 'ENVI'))[42 - 1]
badBandMultiplier = parseEnviString(gdalDataset.GetMetadataItem('bbl', 'ENVI'))[42 - 1]
4. Look at GDAL PAM dataset default domain:: This follows the behaviour of the ENVI driver, that set the wavelength units to this location. We consequently also look for lists of wavelength, fwhm and bad band multipliers (bbl) here:
wavelengthUnit = gdalDataset.GetMetadataItem('wavelength_unit')
wavelengthList = parseEnviString(gdalDataset.GetMetadataItem('wavelength'))[42 - 1]
badBandMultiplier = parseEnviString(gdalDataset.GetMetadataItem('bbl'))[42 - 1]
Note that the parseEnviString function is assumed to parse ENVI list string like ‘{1, 2, 3}’ into Python lists like [1, 2, 3].
- Guide line 1:
- If you need to set band-wise spectral properties in a processing algorithm: set it to the GDAL PAM band default domain. This way, i) the information is accessible with the GDAL API, and ii) consecutive band subsetting via gdal.Translate and gdal.BuildVrt can easily copy the band domains to the destination dataset.
- Guide line 2:
- If you need to set/update metadata in a GUI application: set it to QGIS PAM. This is most flexible and secure. The spectral properties are i) available as custom layer properties, ii) stored in the QGIS project, and iii) can be saved to QML layer style files.
- Guide line 3:
- Do not update GDAL PAM *.aux.xml file, while the corresponding source is opened as a QgsRasterLayer in QGIS. QGIS will potentially overwrite any changes, when closing the layer.
Implementation¶
Technically, we don’t need any new functions or methods, because we fully rely on QGIS PAM.
But, the handling of property keys, and the assurance of fetching priorities, can be tedious and should be encapsulated in util functions or methods. An example implementation is given by the RasterReader class.
To query spectral properties for band 42 (in nanometers), we can use:
from enmapboxprocessing.rasterreader import RasterReader
reader = RasterReader(layer)
wavelength = reader.wavelength(42)
fwhm = reader.fwhm(42)
badBandMultiplier = reader.badBandMultiplier(42)
The destination wavelength units (default is nanometers) can also be stated:
wavelengthInNanometers = reader.wavelength(42, 'nanometers')
wavelengthInMicrometers = reader.wavelength(42, 'micrometers')
wavelengthInMillimeters = reader.wavelength(42, 'millimeters')
wavelengthInMeter = reader.wavelength(42, 'meters')
To find the band closest to 850 nanometers use:
bandNo = reader.findWavelength(850)
bandNo = reader.findWavelength(0.850, 'micrometers')
Also check out the RasterReader unittests: https://github.com/EnMAP-Box/enmap-box/blob/main/enmapboxprocessing/test/test_rasterreaderrfc2.py
RFC 3: Temporal Properties¶
Author: Andreas Janz
Contact: andreas.janz@geo.hu-berlin.de
Started: 2021-12-24
Last modified: 2021-12-26
Status: Proposed
Summary¶
It is proposed to implement functions or methods for reading and writing temporal properties from/to QGIS PAM, while also concidering the existing QgsRasterLayerTemporalProperties layer properties for QgsRasterLayer.
A survey of software (QGIS, GDAL, ENVI, Google Earth Engine) and EO product metadata formats (Landsat, Sentinel-2, EnMAP, DESIS) shows that there is no clear naming convention for temporal properties. We observe two types of temporal annotation: a) specification of a scene center time, and b) specification of a temporal range (start time and end time).
The specification of scene center time may be sufficient for individual images (e.g. a single Landsat scene), but is not suitable for larger area products like daily MODIS composite products, or other derived cloud-free composites using scenes from a temporal range (e.g. a full year).
Thus, we propose to use the more general temporal range concept. Usecases where a center time is sufficient, may just specify the start time.
We further propose to support spectral-temporal timeseries stacks (e.g. a stack of Landsat images, or a stack of cloud-free full-year NDVI composites). This would allow proper plotting of spectral-temporal timeseries profiles, which is currently (v3.9) not well supported in the EnMAP-Box.
API support will be implemented in the enmapboxprocessing.rasterreader.RasterReader class.
Motivation¶
Temporal property naming convensions in software and EO product metadata formats are quite diverse.
- QGIS
QGIS has functionality for managing temporal properties (QgsRasterLayerTemporalProperties) of a QgsRasterLayer:
>>>layer.temporalProperties() >>>layer.temporalProperties().fixedTemporalRange() >>>layer.temporalProperties().fixedTemporalRange().begin() >>>layer.temporalProperties().fixedTemporalRange().end() <qgis._core.QgsRasterLayerTemporalProperties object> <qgis._core.QgsDateTimeRange object> PyQt5.QtCore.QDateTime(2021, 12, 24, 0, 0, 0, 0) PyQt5.QtCore.QDateTime(2021, 12, 25, 0, 0, 0, 0)
- GDAL
The GDAL Raster Data Model suggests to specify ACQUISITIONDATETIME as dataset-level IMAGERY-domain metadata:
# see https://gdal.org/user/raster_data_model.html#imagery-domain-remote-sensing <PAMDataset> <Metadata domain="IMAGERY"> <MDI key="ACQUISITIONDATETIME">2021-12-24T12:30:42.123</MDI> </Metadata>
ENVI files may specify the acquisition time as dataset-level ENVI-domain metadata:
<PAMDataset> <Metadata domain="ENVI"> <MDI key="acquisition_time">2021-12-24T12:30:42.123</MDI> </Metadata>
GeoTiff files may specify the TIFFTAG_DATETIME baseline TIFF tag as dataset-level metadata:
<PAMDataset> <Metadata> <MDI key="TIFFTAG_DATETIME">2019:12:12 19:10:18</MDI> </Metadata>
Since some software use the TIFFTAG_DATETIME to store file creation/manipulation time, and EO data provider don’t use it to specify acquisition time, we propose to ignore it.
- Google Earth Engine
Google Earth Engine images specify system:time_start and system:time_end properties in milliseconds since Unix Epoch (1970-01-01T00:00:00):
Image MODIS/006/MOD09GA/2012_03_09 properties system:time_start: 1331251200000 # 2012-03-09T00:00:00 system:time_end: 1331337600000 # 2012-03-10T00:00:00
- Landsat products
Landsat products specify DATE_ACQUIRED and SCENE_CENTER_TIME properties in the *MTL.txt metadata file:
GROUP = LANDSAT_METADATA_FILE GROUP = IMAGE_ATTRIBUTES DATE_ACQUIRED = 2021-07-24 SCENE_CENTER_TIME = "09:56:22.1248370Z"
- Sentinel-2 products
Sentinel-2 products specify PRODUCT_START_TIME and PRODUCT_STOP_TIME properties in the MTD_MSIL2A.xml metadata file:
<n1:Level-2A_User_Product ... <n1:General_Info> <Product_Info> <PRODUCT_START_TIME>2020-08-16T10:10:31.024Z</PRODUCT_START_TIME> <PRODUCT_STOP_TIME>2020-08-16T10:10:31.024Z</PRODUCT_STOP_TIME>
- EnMAP and DESIS products
EnMAP and DESIS products specify startTime and endTime properties in the METADATA.xml metadata file:
<hsi_doc ...> <base> <temporalCoverage> <startTime>2019-12-03T02:14:39.035473Z</startTime> <endTime>2019-12-03T02:14:43.381243Z</endTime>
- PRISMA products
PRISMA products specify Product_StartTime and Product_StopTime properties in each HE5 sub-dataset:
Product_StartTime=2020-11-07T10:14:04.343999 Product_StopTime=2020-11-07T10:14:08.649690
The survey shows that there is no clear naming convention for temporal properties. We observe two types of temporal annotation: a) specification of a scene center time, and b) specification of a temporal range (start time and end time).
All formats only take single scene images into account. None of the formats is suitable for specifying temporal properties of a timeseries stack (e.g. a stack of Landsat images, or a stack of cloud-free full-year NDVI composites), where each band may have an individual temporal range.
The here proposed approach will integrate temporal property handling into QGIS PAM management, while honoring well known software format and naming conventions, and available QgsRasterLayerTemporalProperties information. This allows to set/update temporal properties for QgsRasterLayer objects, which is critical for GUI applications. It also takes care of information stored as GDAL PAM.
A key feature is the support for timeseries stacks, that is a prerequisite for proper plotting of spectral-temporal timeseries data, which is not well supported in the EnMAP-Box. We currently (v3.9) only support single content timeseries stacks (e.g. a stack of NDVI bands). where time information is specified as decimal years in the ENVI-domain wavelength item. This quite hacky approach is well known in the ENVI Classic community for creating temporal profile plots.
We propose the following approach for fetching band-specific temporal properties.
Approach¶
Band-wise temporal start time and end time properties are fetched with the following priorisation:
1. Look at QGIS PAM band-level default-domain. This is mainly relevant for GUI applications, where we need to set/update temporal properties using QgsRasterLayer objects:
startTime: QDateTime = layer.customProperty('QGISPAM/band/42//start_time')
endTime = layer.customProperty('QGISPAM/band/42//end_time')
Look at GDAL PAM band-level default-domain:
startTime = parseDateTimeString(gdalDataset.GetRasterBand(42).GetMetadataItem('start_time')) endTime = parseDateTimeString(gdalDataset.GetRasterBand(42).GetMetadataItem('end_time'))
3. Look at GDAL PAM dataset-level IMAGERY-domain. This follows the GDAL Raster Data Model specification, that assumes the ACQUISITIONDATETIME to be set to this location:
centerTime = parseDateTimeString(gdalDataset.GetMetadataItem('ACQUISITIONDATETIME', 'IMAGERY'))
3. Look at GDAL PAM dataset-level ENVI-domain. This follows the behaviour of the ENVI driver, that sets the acquisition time to this location:
centerTime = parseDateTimeString(gdalDataset.GetMetadataItem('acquisition_time', 'ENVI'))
Note that the parseDateTimeString function is assumed to parse timestamps into QDateTime objects. It is proposed to support the following formats:
2021-12-24 # date
2021-12-24T12:30:42.123... # date time
1640349042123 # Unix epoche timestamp in milliseconds since 1970-01-01T00:00:00.000
Also note that we don’t support the various sensor product and software naming conventions presented in the survey above. We assume that the acquisition time is properly set to the GDAL PAM dataset-level IMAGERY-domain during product import.
- Guide line 1:
- If you need to set band-wise temporal properties in a processing algorithm: set it to the GDAL PAM band-level default-domain. This way, i) the information is accessible with the GDAL API, and ii) consecutive band subsetting via gdal.Translate and gdal.BuildVrt can easily copy the band domains to the destination dataset.
- Guide line 2:
- If you need to set/update metadata in a GUI application: set it to QGIS PAM. This is most flexible and secure. The temporal properties are i) available as custom layer properties, ii) stored in the QGIS project, and iii) can be saved to QML layer style files.
- Guide line 3:
- Do not update GDAL PAM *.aux.xml file, while the corresponding source is opened as a QgsRasterLayer in QGIS. QGIS will potentially overwrite any changes, when closing the layer.
Implementation¶
Technically, we don’t need any new functions or methods, because we fully rely on QGIS PAM and the QgsRasterLayerTemporalProperties.
But, the handling of property keys, and the assurance of fetching priorities, can be tedious and should be encapsulated in util functions or methods. An example implementation is given by the RasterReader class.
To query temporal properties for band 42, we can use:
from enmapboxprocessing.rasterreader import RasterReader
reader = RasterReader(layer)
startTime = reader.startTime(42)
endTime = reader.endTime(42)
centerTime = reader.centerTime(42) # derives temporal range center time
In case of a standart image, where all bands share the same time range, you may skip the band number:
startTime = reader.startTime()
endTime = reader.endTime()
centerTime = reader.centerTime()
To set temporal properties use:
# for band 42
reader.setStartTime(startTime, 42)
reader.setEndTime(endTime, 42)
# for each band
reader.setStartTime(startTime)
reader.setEndTime(endTime)
Find the band whose center time is closest to christmas eve. If multiple bands match, the first is returned.:
bandNo = reader.findCenterTime(QDateTime(2021, 12, 24, 18, 00))
Use temporal properties and spectral properties (see RFC 2) together for a full description of a spectral-temporal timeseries:
for bandNo in range(1, layer.bandCount() + 1):
startTime, endTime = reader.temporalRange(bandNo)
centerTime = reader.centerTime(bandNo)
wavelength = reader.wavelength(bandNo)
print(startTime, endTime, centerTime, wavelength)
Also check out the RasterReader unittests: https://github.com/EnMAP-Box/enmap-box/blob/main/enmapboxprocessing/test/test_rasterreaderrfc3.py
RFC 4: Band Properties¶
Author: Andreas Janz
Contact: andreas.janz@geo.hu-berlin.de
Started: 2022-01-09
Last modified: 2022-01-10
Status: Proposed
Summary¶
It is proposed to implement functions or methods for reading and writing band properties from/to QGIS PAM.
So far we identified the following band properties to be required or useful:
- band name
- Spectral Properties (see RFC 2): wavelength, wavelength units, fwhm, bad band multiplier
- Temporal Properties (see RFC 3): start time, end time
- Data Properties: offset, scale, no data value
API support will be implemented in the enmapboxprocessing.rasterreader.RasterReader class.
GUI support will be implemented in the qps.layerconfigwidgets.rasterbands.RasterBandPropertiesConfigWidget class.
Motivation¶
Band property management is a cruitial, but a not well support raster layer preparation step in QGIS and the EnMAP-Box.
We need for example:
- band name information to subset or match raster bands by name instead of band numbers, and for setting proper names for reports
- wavelength information for plotting spectral profiles
- time information for plotting temporal profiles
- bad band multipliers to exclude noisy bands from specific plotting/analysis tasks
- data offset and scale information for scaling data stored as integer into 0 to 1 reflectance range
Spectral and Temporal Properties is already detailed in RFC 2 and 3.
Note that band no data value handling is fully supported by QGIS API directly via QgsRasterDataProvider methods: setNoDataValue, setUserNoDataValue, setUseSourceNoDataValue, sourceHasNoDataValue, sourceNoDataValue, userNoDataValues, useSourceNoDataValue.
- Problem
- Band name, offset and scale information can be accessed via QgsRasterLayer methods, but can’t be modified. This is especially limiting in GUI applications, where we usually have a read-only handle to a raster source that we aren’t supposed to modify.
The here proposed approach will integrate band property handling into QGIS PAM management. This allows to set/update band properties for QgsRasterLayer objects, which is critical for GUI applications. It also takes care of information stored as GDAL PAM.
We propose the following approach for fetching band-specific properties.
Approach¶
Note that fetching Spectral and Temporal Properties is already detailed in RFC 2 and 3.
Band-wise properties are fetched with the following priorisation.
1. Look at QGIS PAM band-level default-domain. This is mainly relevant for GUI applications, where we need to set/update band properties using QgsRasterLayer objects:
bandName: str = layer.customProperty('QGISPAM/band/42//name')
offset: floast = layer.customProperty('QGISPAM/band/42//offset')
scale: float = layer.customProperty('QGISPAM/band/42//scale')
Note that those information is only concidered by EnMAP-Box applications and algorithms and always ignored by QGIS and GDAL. To manifest those changes you are required to translate the layer to an intermediate VRT using the EnMAP-Box Translate raster layer algorithm, which will transfer all QGIS PAM information to GDAL PAM.
2. Use QgsRasterLayer and QgsRasterDataProvider methods for accessing the band name, offset and scale:: This is mainly relevant for processing algorithms:
bandName = layer.bandName(42)
offset = layer.dataProvider().bandOffset(42)
scale = layer.dataProvider().bandScale(42)
Note that when reading raster band data, the application or algorithm is responsible for properly applying the band offset and scale. Notice that GDAL won’t scale data automatically, when calling gdal.Band.ReadAsArray(). On the contrary, QGIS will automatically scale the data using the QgsRasterDataProvider.bandOffset and QgsRasterDataProvider.bandScale information, but will ignore potential modifications stored in QGIS PAM.
For that reason, we highly encourage the use of the RasterReader.array methode for reading raster data, which will take care of all the data scaling details.
- Guide line 1:
- If you need to set band-wise properties in a processing algorithm: set it to the GDAL PAM band-level default-domain or use approriate gdal.Band methods. This way, i) the information is accessible with the GDAL API, and ii) consecutive band subsetting via gdal.Translate and gdal.BuildVrt can easily copy the band domains to the destination dataset.
- Guide line 2:
- If you need to set/update band properties in a GUI application: set it to QGIS PAM. This is most flexible and secure. The band properties are i) available as custom layer properties, ii) stored in the QGIS project, and iii) can be saved to QML layer style files. Note that those modifications are only used by EnMAP-Box applications and algorithms, QGIS and GDAL will ignore it! To manifest those changes in GDAL PAM, translate the layer to an intermediate VRT using the EnMAP-Box Translate raster layer algorithm.
- Guide line 3:
- Do not update GDAL PAM *.aux.xml file, while the corresponding source is opened as a QgsRasterLayer in QGIS. QGIS will potentially overwrite any changes, when closing the layer.
Implementation¶
Technically, we don’t need any new functions or methods, because we fully rely on existing QGIS/GDAL API functionality.
But, the handling of property keys, the assurance of fetching priorities, and proper data scaling, can be tedious and should be encapsulated in util functions or methods. An example implementation is given by the RasterReader class.
Note that Spectral and Temporal Properties is already detailed in RFC 2 and 3.
To query band properties for band 42, we can use:
from enmapboxprocessing.rasterreader import RasterReader
reader = RasterReader(layer)
bandName = reader.bandName(42)
bandOffset = reader.bandOffset(42)
bandScale = reader.bandScale(42)
To set band properties use:
reader.setBandName('band 42 (0.685000 Micrometers)', 42)
reader.setBandOffset(0, 42)
reader.setBandScale(10000, 42)
To read (scaled) band data use:
array = reader.array(bandList=[42])
maskArray = reader.maskArray(array, bandList=[42])
Also check out the RasterReader unittests: https://github.com/EnMAP-Box/enmap-box/blob/main/enmapboxprocessing/test/test_rasterreaderrfc4.py
Documentation Guidelines¶
This documentation guideline provides an overview of the general style guidelines and on how to contribute to the documentation. It is based on the QGIS documentation guidelines.
The EnMAP-Box documentation is written in the reStructuredText(reST) format, coupled with some external libraries, e.g. Sphinx. To keep things consistent, the following chapter contains guidelines on how to style the EnMAP-Box documentation.
Writing Guidelines¶
Using the reST format for the documentation, allows to create several webpages with chapters, sections and subsections. The section For Writers in the QGIS documentation guidelines guides you through the most important general rules for contributing to documentation, including the design of headings, inline tags and the insertion of captions and references.
Furthermore, you might want to take a look at the Sphinx Python Documentation Generator Guide that describes the first steps using Sphinx and reStructuredText in more detail and also gives some examples of how to include e.g. images, source code or hyperlinks.
In addition to the two guidelines mentioned above, we have developed some simple rules for EnMap Box documentation, which are described below.
1. reStructuredText¶
Use
- one asterisk for italic text (
*italic text*
) to emphasize something - two asterisk for bold text (
**bold text**
) to emphasize something strongly - two backquotes for
code examples
(``code examples``
), variables, filenames, etc.
In addition, when describing a workflow of some algorithm or tool, use the following instructions.
Element | Style | Markup | Example |
---|---|---|---|
Labels describing an interaction | GUI label | :guilabel:`text ` | Drag and drop the file from your file manager into the Data Sources panel. |
Describing an algorithm in general | bold | **text** | The EnMAP-Box offers Spectral Library Windows for visualizing spectra. |
Captions of images, screenshots, etc. | italic | *text* | Fig. 2: Example of adding a screenshot with explanation. |
Including files, samples, variables | file label + backquotes | :file: ``text` ` | Vector = agb_sonoma.gpkg |
Use numbering to describe individual steps. This makes it is easier to distinguish between information and actual steps and to follow them easily:

Workflow example with numbering
2. Figures & Screenshots¶
Font: Verdana
Size: 14 pt
Text color: RGB – 61-61-61
Line color: RGB – 192-0-0
Line width: 1 pt
Description to the left of the screenshot at the level of the function to be explained
Description text in box right-aligned
Example of adding a screenshot with explanation
Info boxes, tooltips and notes should be aligned with the preceding text, i.e., if the info box follows a bulleted list, the box should also be indented.
Example of placing info boxes within / after bullet points
Images should always be centred, but can vary in size (adjust according to readability). Also add a caption to the image if it is not placed between two bullet points.
*Placement of images for (left) after body text, (right) within bullet points *