DatasetAssociation

class lsst.daf.butler.DatasetAssociation(ref: DatasetRef, collection: str, timespan: Timespan | None)

Bases: object

Class representing the membership of a dataset in a single collection.

One dataset is associated with one collection, possibly including a timespan.

Attributes Summary

collection

Name of a collection (str).

ref

Resolved reference to a dataset (DatasetRef).

timespan

Validity range of the dataset if this is a CALIBRATION collection (Timespan or None).

Methods Summary

from_query_result(result, dataset_type[, ...])

Construct dataset associations from the result of general query.

Attributes Documentation

collection: str

Name of a collection (str).

ref: DatasetRef

Resolved reference to a dataset (DatasetRef).

timespan: Timespan | None

Validity range of the dataset if this is a CALIBRATION collection (Timespan or None).

Methods Documentation

classmethod from_query_result(result: GeneralQueryResults, dataset_type: DatasetType, collection_info: Mapping[str, CollectionInfo] | None = None) Iterator[DatasetAssociation]

Construct dataset associations from the result of general query.

Parameters:
resultGeneralQueryResults

General query result returned by Query.general method. The result has to include “dataset_id”, “run”, “collection”, and “timespan” dataset fields for dataset_type.

dataset_typeDatasetType

Dataset type, query has to include this dataset type.

collection_infoMapping [str, CollectionInfo], optional

Mapping from collection name to information about it for all collections that may appear in the query results. If not provided, timespans for RUN and TAGGED collections will be bounded, instead of None; this is actually more consistent with how those timespans are used elsewhere in the query system, but is a change from how DatasetAssocation has historically worked.