Dataset Type

class datacube.model.DatasetType(metadata_type, definition, id_=None)[source]

Product definition

Parameters

Methods:

canonical_measurement(measurement)

resolve measurement alias into canonical name

load_hints()

Returns dictionary with keys compatible with dc.load(..) named arguments:

lookup_measurements([measurements])

Find measurements by name

to_dict()

Convert to a dictionary representation of the available fields

validate_extra_dims()

Validate 3D metadata in the product definition.

Attributes:

definition

product definition document

dimensions

List of dimension labels for data in this product

extra_dimensions

Dictionary of metadata for the third dimension.

grid_spec

Grid specification for this product

measurements

Dictionary of measurements in this product

canonical_measurement(measurement)[source]

resolve measurement alias into canonical name

Return type

str

definition

product definition document

property dimensions: Tuple[str, str, str]

List of dimension labels for data in this product

Return type

Tuple[str, str, str]

property extra_dimensions: Mapping[str, datacube.model.Measurement]

Dictionary of metadata for the third dimension.

Return type

Mapping[str, Measurement]

grid_spec

Grid specification for this product

load_hints()[source]

Returns dictionary with keys compatible with dc.load(..) named arguments:

output_crs - CRS resolution - Tuple[float, float] align - Tuple[float, float] (if defined)

Returns {} if load hints are not defined on this product, or defined with errors.

Return type

Dict[str, Any]

lookup_measurements(measurements=None)[source]

Find measurements by name

Parameters

measurements (Union[Iterable[str], str, None]) – list of measurement names or a single measurement name, or None to get all

Return type

Mapping[str, Measurement]

property measurements: Mapping[str, datacube.model.Measurement]

Dictionary of measurements in this product

Return type

Mapping[str, Measurement]

to_dict()[source]

Convert to a dictionary representation of the available fields

Return type

Mapping[str, Any]

validate_extra_dims()[source]

Validate 3D metadata in the product definition.

Perform some basic checks for validity of the 3D dataset product definition:
  • Checks extra_dimensions section exists

  • For each 3D measurement, check if the required dimension is defined

  • If the 3D spectral_definition is defined: - Check there’s one entry per coordinate. - Check that wavelength and response are the same length.

Parameters

definition (dict) – Dimension definition dict, typically retrieved from the product definition’s extra_dimensions field.