DataUnit¶
-
class
lsst.daf.butler.DataUnit(name, requiredDependencies, optionalDependencies, link=(), table=None, spatial=False)¶ Bases:
objectA discrete abstract unit of data that can be associated with metadata and used to label datasets.
DataUnitinstances represent concrete units such as e.g.Camera,Sensor,VisitandSkyMap.Parameters: - name :
str Name of this
DataUnit. Also assumed to be the name of the primary table (if present).- requiredDependencies :
frozenset Related
DataUnitinstances on which existence thisDataUnitinstance depends.- optionalDependencies :
frozenset Related
DataUnitinstances that may also be provided (and when they are, they must be kept in sync).- link :
tuple Names of columns that form the
DataUnitspecific part of the primary-key in thisDataUnittable and are also the names of the link column in the Datasets table.- table :
sqlalchemy.core.Table, optional When not
Nonethe primary table entry corresponding to thisDataUnit.- spatial :
bool, optional Is this a spatial
DataUnit? If so then it either has aregioncolumn, or some other way to get a region (e.g.SkyPix).
Attributes Summary
dependenciesThe union of requiredDependenciesandoptionalDependencies(frozenset, read-only).linkNames of columns that form the DataUnitspecific part of the primary-key in thisDataUnittable and are also the names of the link column in the Datasets table (tuple).linkColumnsDictionary keyed on linknames withsqlalchemy.Columnentries into thisDataUnitprimary table as values (dict).nameName of this DataUnit(str, read-only).optionalDependenciesRelated DataUnitinstances that may also be provided (and when they are, they must be kept in sync) (frozenset, read-only).primaryKeyFull primary-key column name tuple. primaryKeyColumnsDictionary keyed on primaryKeynames withsqlalchemy.Columnentries into thisDataUnitprimary table as values (dict).regionColumnTable column ( sqlalchemy.Column) with encoded region data,Noneif table has no region column.requiredDependenciesRelated DataUnitinstances on which existence thisDataUnitinstance depends (frozenset, read-only).spatialIs this a spatial DataUnitJoin?tableWhen not Nonethe primary table entry corresponding to thisDataUnit(sqlalchemy.core.Table, optional).Methods Summary
validateId(dataId)Check if given dataId is valid. Attributes Documentation
-
dependencies¶ The union of
requiredDependenciesandoptionalDependencies(frozenset, read-only).
-
link¶ Names of columns that form the
DataUnitspecific part of the primary-key in thisDataUnittable and are also the names of the link column in the Datasets table (tuple).
-
linkColumns¶ Dictionary keyed on
linknames withsqlalchemy.Columnentries into thisDataUnitprimary table as values (dict).
-
name¶ Name of this
DataUnit(str, read-only).Also assumed to be the name of the primary table (if present).
-
optionalDependencies¶ Related
DataUnitinstances that may also be provided (and when they are, they must be kept in sync) (frozenset, read-only).
-
primaryKey¶ Full primary-key column name tuple. Consists of the
linkof thisDataUnitand that of all itsrequiredDependencies(set).
-
primaryKeyColumns¶ Dictionary keyed on
primaryKeynames withsqlalchemy.Columnentries into thisDataUnitprimary table as values (dict).
-
regionColumn¶ Table column (
sqlalchemy.Column) with encoded region data,Noneif table has no region column.
-
requiredDependencies¶ Related
DataUnitinstances on which existence thisDataUnitinstance depends (frozenset, read-only).
-
spatial¶ Is this a spatial
DataUnitJoin?
-
table¶ When not
Nonethe primary table entry corresponding to thisDataUnit(sqlalchemy.core.Table, optional).
Methods Documentation
-
validateId(dataId)¶ Check if given dataId is valid.
Parameters: - dataId :
dict A
dictofDataUnitlink name, value pairs that label theDatasetRefwithin a Collection.
Raises: - ValueError
If a value for a required dependency is missing.
- dataId :
- name :