EOPatch visualizations

Note: Most of visualizations in this notebook are dynamic and can only be seen when executing the notebook.

First some imports. We only need basic stuff from eolearn.core and geoviews package for visualizing background layers.

[1]:
%load_ext autoreload
%autoreload 2

import os

import geoviews as gv

from eolearn.core import EOPatch, FeatureType

We are going to load eopatch from TestEOPatch folder. This is example eopatch with lots of different data.

[2]:
data_folder = os.path.join('..', '..', 'example_data', 'TestEOPatch')
eopatch = EOPatch.load(data_folder)
eopatch
[2]:
EOPatch(
  data: {
    BANDS-S2-L1C: numpy.ndarray(shape=(68, 101, 100, 13), dtype=float32)
    CLP: numpy.ndarray(shape=(68, 101, 100, 1), dtype=float32)
    NDVI: numpy.ndarray(shape=(68, 101, 100, 1), dtype=float32)
    REFERENCE_SCENES: numpy.ndarray(shape=(5, 101, 100, 13), dtype=float32)
  }
  mask: {
    CLM: numpy.ndarray(shape=(68, 101, 100, 1), dtype=uint8)
    IS_DATA: numpy.ndarray(shape=(68, 101, 100, 1), dtype=uint8)
    IS_VALID: numpy.ndarray(shape=(68, 101, 100, 1), dtype=bool)
  }
  scalar: {
    CLOUD_COVERAGE: numpy.ndarray(shape=(68, 1), dtype=float16)
  }
  label: {
    IS_CLOUDLESS: numpy.ndarray(shape=(68, 1), dtype=bool)
    RANDOM_DIGIT: numpy.ndarray(shape=(68, 2), dtype=int8)
  }
  vector: {
    CLM_VECTOR: geopandas.GeoDataFrame(columns=['TIMESTAMP', 'VALUE', 'geometry'], length=55, crs=epsg:32633)
  }
  data_timeless: {
    MAX_NDVI: numpy.ndarray(shape=(101, 100, 1), dtype=float64)
  }
  mask_timeless: {
    LULC: numpy.ndarray(shape=(101, 100, 1), dtype=uint16)
    RANDOM_UINT8: numpy.ndarray(shape=(101, 100, 13), dtype=uint8)
    VALID_COUNT: numpy.ndarray(shape=(101, 100, 1), dtype=int64)
  }
  scalar_timeless: {
    LULC_PERCENTAGE: numpy.ndarray(shape=(6,), dtype=float64)
  }
  label_timeless: {
    LULC_COUNTS: numpy.ndarray(shape=(6,), dtype=int32)
  }
  vector_timeless: {
    LULC: geopandas.GeoDataFrame(columns=['RABA_ID', 'AREA', 'DATE', 'LULC_ID', 'LULC_NAME', 'geometry'], length=88, crs=epsg:32633)
  }
  meta_info: {
    maxcc: 0.8
    service_type: 'wcs'
    size_x: '10m'
    size_y: '10m'
    time_difference: datetime.timedelta(-1, 86399)
    time_interval: [datetime.datetime(2015, 1, 1, 0, 0), datetime.datetime(2018, 1, 1, 0, 0)]
  }
  bbox: BBox(((465181.0522318204, 5079244.8912012065), (466180.53145382757, 5080254.63349641)), crs=EPSG:32633)
  timestamp: [datetime.datetime(2015, 7, 11, 10, 0, 8), ..., datetime.datetime(2017, 12, 22, 10, 4, 15)], length=68
)

Single plots

We can plot single element from eopatch or we can combine multiple elements either side by side or overlay them.

Data

Elements in data are 4 dimensional Numpy Arrays. Eopatch.data[‘BANDS-S2-L1C’] has 4 dimension: time, y, x and band. When we do a simple eopatch.plot, time and band are sliders, x and y are x and y in the plot. With slider we can choose time and band.

[3]:
eopatch.plot((FeatureType.DATA, 'BANDS-S2-L1C'))