Installation
EnPT can be installed in two different ways:
as a standalone package which can be used via the Python API or from the command line
along with the EnMAP-Box (a QGIS plugin) which provides a GUI for EnPT.
Installing EnPT as a standalone package (backend code only)
Using Mambaforge (recommended)
This is the preferred way to install EnPT. It is the fastest one and it always installs the most recent stable release and automatically resolves all the dependencies.
Install Mambaforge.
Open a Mambaforge command line prompt and proceed there (e.g., on Windows you can find it in the start menu).
Install enpt into a separate environment and activate it:
$ mamba create --name enpt enpt $ mamba activate enpt
Using Anaconda or Miniconda (slower)
Using conda (latest version recommended), EnPT is installed as follows:
$ conda create --name enpt -c conda-forge enpt
$ conda activate enpt
Using pip (not recommended)
There is also a pip installer for EnPT. However, please note that EnPT depends on some open source packages that may cause problems when installed with pip. Therefore, we strongly recommend to resolve the following dependencies before the pip installer is run:
cachetools
cartopy
gdal
geopandas
glymur
h5py
numba
numpy
llvmlite
lxml
matplotlib
packaging
pandas
pygrib
pyhdf
pyproj >3.4.0
pyresample
pytables
scikit-image
scikit-learn
shapely
Then, the pip installer can be run by:
$ pip install enpt
If you don’t have pip installed, this Python installation guide can guide you through the process.
Optional: Install Polymer for advanced atmospheric correction over water surfaces
For atmospheric correction of water surfaces using the Polymer algorithm instead of SICOR (which is mainly designed for land surfaces), the additional package polymer is required. The Polymer atmospheric correction is made available in EnPT by the ACwater package, a wrapper developed by AWI Bremerhaven, which is already contained in the default EnPT installation.
To install the optional package polymer, first activate the previously created enpt conda environment:
$ mamba activate enpt
Then register at the HYGEOS support forum, download polymer from there (EnPT was tested with polymer v4.16.1, later versions may fail), unpack it and run the following commands from the unpacked root directory of polymer:
$ make $ make auxdata_common $ make ancillary $ mkdir -p ANCILLARY/ERA5 $ pip install -e .
Note
When using a conda environment on Linux or Mac OSX, the needed compilers to build polymer should be already installed. On Windows, you need to install the Microsoft build tools for visual studio including the C++ build tools, the latest versions of MSVCv142 - VS 2019 C++ x64/x86 build tools and Windows 10 SDK (see here for details). However, polymer is currently not Windows compatible and will likely not run as expected.
Apart from that, you need to register at the CDS registration page and install a CDS API key. This is required to automatically download atmospheric AUX data at runtime, which are needed to run Polymer. Further details are given in the ACwater Polymer installation instructions.
Installing EnPT along with QGIS and the EnMAP-Box (backend + GUI)
If you want to use EnPT including the GUI in the EnMAP-Box, it is highly recommended to install QGIS, the EnMAP-Box requirements, the EnPT backend code and the EnPT GUI into a single conda environment within Mambaforge.
To do so, run the following command on a Mambaforge conda command line:
$ mamba env create -n enpt_full -f https://git.gfz-potsdam.de/EnMAP/GFZ_Tools_EnMAP_BOX/EnPT/raw/main/tests/gitlab_CI_docker/context/environment_enpt_full.yml
Then activate the newly created conda environment and start QGIS:
$ mamba activate enpt_full
$ qgis
The EnMAP-Box QGIS plugin can then be installed via the QGIS Plugin manager and the EnPT GUI can be started from within the EnMAP-Box as described here.
If you want to use advanced atmospheric correction over water surfaces, please install the optional requirement polymer into the enpt_full environment as described above.
Hint
Contributors of the EnPT source code or plugins may install EnPT along with all packages needed for development with:
$ mamba env create -n enpt_full -f https://git.gfz-potsdam.de/EnMAP/GFZ_Tools_EnMAP_BOX/EnPT/raw/main/tests/gitlab_CI_docker/context/environment_enpt_full_dev.yml
Note
EnPT has been tested with Python 3.8+ on Linux, Windows and Mac OSX.