semantique.datacube.Opendatacube

semantique.datacube.Opendatacube#

class semantique.datacube.Opendatacube(layout=None, connection=None, tz='UTC', **config)[source]#

Opendatacube specific EO data cube configuration.

This class is an interface to Opendatacube backends. See the Opendatacube manual for details.

Parameters:
  • layout (dict) – The layout file describing the EO data cube. If None, an empty EO data cube is constructed.

  • connection (datacube.Datacube) – Opendatacube interface object allowing to read from the data cube.

  • tz – Timezone of the temporal coordinates in the EO data cube. Can be given as str referring to the name of a timezone in the tz database, or as instance of any class inheriting from datetime.tzinfo.

  • **config

    Additional keyword arguments tuning the data retrieval configuration. Valid options are:

    • trim (bool): Should each retrieved data layer be trimmed? Trimming means that dimension coordinates for which all values are missing are removed from the array. The spatial dimensions are trimmed only at the edges, to maintain their regularity. Defaults to True.

    • group_by_solar_day (bool): Should the time dimension be resampled to the day level, using solar day to keep scenes together? Defaults to True.

    • value_type_mapping (dict): How do value type encodings in the layout map to the value types used by semantique? Defaults to a one-to-one mapping:

      {
        "nominal": "nominal",
        "ordinal": "ordinal",
        "binary": "binary",
        "continuous": "continuous",
        "discrete": "discrete"
      }
      
    • resamplers (dict): When data need to be resampled to a different spatial and/or temporal resolution, what resampling technique should be used? Should be specified separately for each possible value type in the layout. Valid techniques are:

      'nearest', 'average', 'bilinear', 'cubic', 'cubic_spline',
      'lanczos', 'mode', 'gauss',  'max', 'min', 'med', 'q1', 'q3'
      

      Defaults to:

      {
        "nominal": "nearest",
        "ordinal": "nearest",
        "binary": "nearest",
        "continuous": "nearest",
        "discrete": "nearest"
      }
      

__init__(layout=None, connection=None, tz='UTC', **config)[source]#

Methods

__init__([layout, connection, tz])

lookup(*reference)

Lookup the metadata of a referenced data layer.

retrieve(*reference, extent)

Retrieve a data layer from the EO data cube.

Attributes

config

Configuration settings for data retrieval.

connection

Opendatacube interface object allowing to read from the data cube.

layout

The layout file of the EO data cube.

tz

Timezone of the temporal coordinates in the EO data cube.