EnMAP#

class torchgeo.datasets.EnMAP(paths='data', crs=None, res=None, bands=None, transforms=None, cache=True, time_series=False)[source]#

Bases: RasterDataset

EnMAP dataset.

The Environmental Mapping and Analysis Program (EnMAP) is a German hyperspectral satellite mission that monitors and characterizes Earth’s environment on a global scale. EnMAP measures geochemical, biochemical and biophysical variables providing information on the status and evolution of terrestrial and aquatic ecosystems.

Mission Outline:

  • Dedicated pushbroom hyperspectral imager mainly based on modified existing or pre-developed technology

  • Broad spectral range from 420 nm to 1000 nm (VNIR) and from 900 nm to 2450 nm (SWIR) with high radiometric resolution and stability in both spectral ranges

  • 30 km swath width at a spatial resolution of 30 x 30 m, nadir revisit time of 27 days and off-nadir (30°) pointing feature for fast target revisit (4 days)

  • Sufficient on-board memory to acquire 1,000 km swath length per orbit and a total of 5,000 km per day.

If you use this dataset in your research, please cite the following papers:

Added in version 0.7.

filename_glob = 'ENMAP*SPECTRAL_IMAGE*'#

Glob expression used to search for files.

This expression should be specific enough that it will not pick up files from other datasets. It should not include a file extension, as the dataset may be in a different file format than what it was originally downloaded as.

filename_regex = '\n        ^ENMAP\n        (?P<satellite>\\d{2})-\n        (?P<product_type>____L[12][ABC])-\n        (?P<datatake_id>DT\\d{10})_\n        (?P<date>\\d{8}T\\d{6})Z_\n        (?P<tile_id>\\d{3})_\n        (?P<version>V\\d{6})_\n        (?P<processing_date>\\d{8}T\\d{6})Z-\n    '#

Regular expression used to extract date from filename.

The expression should use named groups. The expression may contain any number of groups. The following groups are specifically searched for by the base class:

  • date: used to calculate mint and maxt for index insertion

  • start: used to calculate mint for index insertion

  • stop: used to calculate maxt for index insertion

When separate_files is True, the following additional groups are searched for to find other files:

  • band: replaced with requested band name

date_format = '%Y%m%dT%H%M%S'#

Date format string used to parse date from filename.

Not used if filename_regex does not contain a date group or start and stop groups.

all_bands: tuple[str, ...] = ('B1', 'B2', 'B3', 'B4', 'B5', 'B6', 'B7', 'B8', 'B9', 'B10', 'B11', 'B12', 'B13', 'B14', 'B15', 'B16', 'B17', 'B18', 'B19', 'B20', 'B21', 'B22', 'B23', 'B24', 'B25', 'B26', 'B27', 'B28', 'B29', 'B30', 'B31', 'B32', 'B33', 'B34', 'B35', 'B36', 'B37', 'B38', 'B39', 'B40', 'B41', 'B42', 'B43', 'B44', 'B45', 'B46', 'B47', 'B48', 'B49', 'B50', 'B51', 'B52', 'B53', 'B54', 'B55', 'B56', 'B57', 'B58', 'B59', 'B60', 'B61', 'B62', 'B63', 'B64', 'B65', 'B66', 'B67', 'B68', 'B69', 'B70', 'B71', 'B72', 'B73', 'B74', 'B75', 'B76', 'B77', 'B78', 'B79', 'B80', 'B81', 'B82', 'B83', 'B84', 'B85', 'B86', 'B87', 'B88', 'B89', 'B90', 'B91', 'B92', 'B93', 'B94', 'B95', 'B96', 'B97', 'B98', 'B99', 'B100', 'B101', 'B102', 'B103', 'B104', 'B105', 'B106', 'B107', 'B108', 'B109', 'B110', 'B111', 'B112', 'B113', 'B114', 'B115', 'B116', 'B117', 'B118', 'B119', 'B120', 'B121', 'B122', 'B123', 'B124', 'B125', 'B126', 'B127', 'B128', 'B129', 'B130', 'B131', 'B132', 'B133', 'B134', 'B135', 'B136', 'B137', 'B138', 'B139', 'B140', 'B141', 'B142', 'B143', 'B144', 'B145', 'B146', 'B147', 'B148', 'B149', 'B150', 'B151', 'B152', 'B153', 'B154', 'B155', 'B156', 'B157', 'B158', 'B159', 'B160', 'B161', 'B162', 'B163', 'B164', 'B165', 'B166', 'B167', 'B168', 'B169', 'B170', 'B171', 'B172', 'B173', 'B174', 'B175', 'B176', 'B177', 'B178', 'B179', 'B180', 'B181', 'B182', 'B183', 'B184', 'B185', 'B186', 'B187', 'B188', 'B189', 'B190', 'B191', 'B192', 'B193', 'B194', 'B195', 'B196', 'B197', 'B198', 'B199', 'B200', 'B201', 'B202', 'B203', 'B204', 'B205', 'B206', 'B207', 'B208', 'B209', 'B210', 'B211', 'B212', 'B213', 'B214', 'B215', 'B216', 'B217', 'B218', 'B219', 'B220', 'B221', 'B222', 'B223', 'B224')#

Names of all available bands in the dataset

rgb_bands: tuple[str, ...] = ('B48', 'B30', 'B16')#

Names of RGB bands in the dataset, used for plotting

__init__(paths='data', crs=None, res=None, bands=None, transforms=None, cache=True, time_series=False)[source]#

Initialize a new EnMAP instance.

Parameters:
  • paths (str | PathLike[str] | Iterable[str | PathLike[str]]) – one or more root directories to search or files to load

  • crs (CRS | None) – coordinate reference system (CRS) to warp to (defaults to the CRS of the first file found)

  • res (float | tuple[float, float] | None) – resolution of the dataset in units of CRS in (xres, yres) format. If a single float is provided, it is used for both the x and y resolution. (defaults to the resolution of the first file found)

  • bands (Sequence[str] | None) – bands to return (defaults to all bands)

  • transforms (Callable[[dict[str, Any]], dict[str, Any]] | None) – a function/transform that takes an input sample and returns a transformed version

  • cache (bool) – if True, cache file handle to speed up repeated sampling

  • time_series (bool) – if True, stack data along the time series dimension [T, C, H, W]. If False, merge data into a [C, H, W] mosaic.

Raises:

DatasetNotFoundError – If dataset is not found.

Added in version 0.9: The time_series parameter.

plot(sample, suptitle=None)[source]#

Plot a sample from the dataset.

Parameters:
Returns:

A matplotlib Figure with the rendered sample.

Raises:

RGBBandsMissingError – If bands does not include all RGB bands.

Return type:

Figure

__annotate_func__()#

The type of the None singleton.