An xarray backend to read the data archives provided by the EOWEB data portal of the EnMAP mission.
mamba install xarray-enmap
or
conda install xarray-enmap
⚠️ Starting with release 0.0.3, xarray-enmap will include the command-line toolconvert-enmap. If you wish to useconvert-enmap, you should also install the optional packageszarrandnumcodecs.
⚠️ xarray-enmap requires the gdal library, which cannot be installed with pip. If you're working in a conda environment, you can use conda or mamba to install thelibgdal-corepackage before starting the pip install. See the GDAL documentation for other installation methods.
To install the basic package:
pip install xarray-enmap
If you want to export Zarr archives using the included command-line tool
convert-enmap (available from release 0.0.3):
pip install xarray-enmap[zarr]
Clone the repository and set the current working directory:
git clone https://github.com/bcdev/xarray-enmap.git
cd xarray-enmapInstall the dependencies with mamba or conda:
mamba env create
mamba activate xarray-enmapInstall xarray-enmap itself:
pip install --no-deps --editable .import xarray as xr
enmap_dataset = xr.open_dataset(
"/path/to/enmap/data/filename.tar.gz",
engine="enmap"
)
The supplied path can reference:
- a
.tar.gzarchive as provided by the EnMAP portal, containing one or more EnMAP products in.ZIPsub-archives, or - a
.ZIParchive containing a single product, as found within an EnMAP.tar.gzarchive, or - a directory contained the unpacked contents of either of the aforementioned archive types.
At present, if the archive or directory contains multiple EnMAP products, xarray-enmap will open only the first.
Note that, to use the --zarr-output option, you must install the appropriate
optional packages (see installation instructions).
usage: convert-enmap [-h] [--zarr-output ZARR_OUTPUT]
[--tiff-output TIFF_OUTPUT] [--tempdir TEMPDIR]
[--compress] [--verbose]
input_filename
Extract data from EnMAP archives. The expected input is a Zip archive, or a
.tar.gz archive of multiple Zip archives, downloaded from the EnMAP portal.
Output can be written as TIFF, Zarr, or both.
positional arguments:
input_filename Either a Zip for a single product, or a .tar.gz
containing multiple Zips
options:
-h, --help show this help message and exit
--zarr-output ZARR_OUTPUT
Write Zarr output to this directory.
--tiff-output TIFF_OUTPUT
Write TIFF output to this directory.
--tempdir, -t TEMPDIR
Use specified path as temporary directory, and don't
delete it afterwards (useful for debugging)
--compress, -c Higher Zarr output compression. ~25% smaller than
default compression. Compression process (but not
decompression) is much slower.
--verbose, -v