semantique.datacube.GeotiffArchive

semantique.datacube.GeotiffArchive#

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

EO data cube configuration for zipped GeoTIFF files.

This simple EO data cube configuration assumes each data layer is a GeoTIFF file, and that all layers together are bundled in a ZIP archive. It is meant for demonstration purposes.

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

  • src (str) – Path to the ZIP archive containing the data layers.

  • 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.

    • 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, src=None, tz='UTC', **config)[source]#

Methods

__init__([layout, src, 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.

layout

The layout file of the EO data cube.

src

Path to the ZIP archive containing the data layers.

tz

Timezone of the temporal coordinates in the EO data cube.