Dataset#

class datacube.model.Dataset(product, metadata_doc, uris=None, uri=None, sources=None, indexed_by=None, indexed_time=None, archived_time=None, source_tree=None, derived_tree=None)[source]#

A Dataset. A container of metadata, and refers typically to a multi-band raster on disk.

Most important parts are the metadata_doc and uri.

Dataset objects should be constructed by an index driver, or with the datacube.index.hl.Doc2Dataset

Parameters
  • metadata_doc (Dict[str, Any]) – the document (typically a parsed json/yaml)

  • uris (Optional[List[str]]) – All active uris for the dataset

Members

Attributes:

bounds

Optional[BoundingBox] :returns: bounding box of the dataset in the native crs

center_time

mid-point of time range

crs

Return CRS if available

extent

valid extent of the dataset or None

id

UUID of a dataset

indexed_by

The User who indexed this dataset

is_active

Is this dataset active?

is_archived

Is this dataset archived?

key_time

datetime.datetime

local_path

A path to this dataset on the local filesystem (if available).

local_uri

Return the uri if it is local, or None.

metadata_doc

The document describing the dataset as a dictionary.

sources

The datasets that this dataset is derived from (if requested on load).

uris

List of active locations, newest to oldest.

Methods:

legacy_uri([schema])

This is a 1.9-2.0 transitional method and will be removed in 2.0.

metadata_doc_without_lineage()

Return metadata document without nested lineage datasets

property bounds: Optional[odc.geo.geom.BoundingBox]#

Optional[BoundingBox] :returns: bounding box of the dataset in the native crs

Type

rtype

center_time#

mid-point of time range

property crs: Optional[odc.geo.crs.CRS]#

Return CRS if available

Return type

Optional[CRS]

extent#

valid extent of the dataset or None

Type

returns

property id: uuid.UUID#

UUID of a dataset

Return type

UUID

indexed_by#

The User who indexed this dataset

property is_active: bool#

Is this dataset active?

(ie. dataset hasn’t been archived)

Return type

bool

property is_archived: bool#

Is this dataset archived?

(an archived dataset is one that is not intended to be used by users anymore: eg. it has been replaced by another dataset. It will not show up in search results, but still exists in the system via provenance chains or through id lookup.)

Return type

bool

key_time#

datetime.datetime

Type

rtype

legacy_uri(schema=None)[source]#

This is a 1.9-2.0 transitional method and will be removed in 2.0.

If the dataset has only one location, it returns that uri, but if the dataset has multiple locations, it calls various deprecated methods to achieve the legacy behaviour. It is intended for internal core use only.

Parameters

schema (Optional[str]) –

Returns

property local_path: Optional[pathlib.Path]#

A path to this dataset on the local filesystem (if available).

Return type

Optional[Path]

property local_uri: Optional[str]#

Return the uri if it is local, or None.

Legacy behaviour: The latest local file uri, if any.

Return type

Optional[str]

metadata_doc#

The document describing the dataset as a dictionary. It is often serialised as YAML on disk or inside a NetCDF file, and as JSON-B inside the database index.

metadata_doc_without_lineage()[source]#

Return metadata document without nested lineage datasets

Return type

Dict[str, Any]

sources#

The datasets that this dataset is derived from (if requested on load).

property uris: Sequence[str]#

List of active locations, newest to oldest.

Multiple locations are deprecated, please use ‘uri’.

Return type

Sequence[str]