FullIdGenerator¶
- class lsst.meas.base.FullIdGenerator(dimension_packer: DimensionPacker, data_id: DataCoordinate, release_id: int = 0, n_releases: int = 1)¶
Bases:
IdGenerator
The subclass of
IdGenerator
that actually includes packed data IDs and release IDs in its generated IDs.- Parameters:
- dimension_packer
lsst.daf.butler.DimensionPacker
Object that packs data IDs into integers.
- data_id
lsst.daf.butler.DataCoordinate
Data ID to embed in all generated IDs and random seeds.
- release_id
int
, optional Release identifier to embed in generated IDs.
- n_releases
int
, optional Number of (contiguous, starting from zero)
release_id
values to reserve space for. One (not zero) is used to reserve no space.
- dimension_packer
Notes
Instances of this class should usually be constructed via configuration instead of by calling the constructor directly; see
IdGenerator
for details.Attributes Summary
The integer identifier for the full catalog with this data ID, not just one of its rows (
int
).The data ID that will be embedded in all generated IDs (
DataCoordinate
).The release ID that will embedded in all generated IDs (
int
).Methods Summary
arange
(*args, **kwargs)Generate an array of integer IDs for this catalog.
make_source_catalog
(schema)Construct a empty catalog object with an ID factory.
Construct a new
lsst.afw.table.IdFactory
for this catalog.unpacker_from_config
(config, fixed)Return a callable that unpacks the IDs generated by this class, from a config field.
unpacker_from_dimension_packer
(dimension_packer)Return a callable that unpacks the IDs generated by this class, from a
lsst.daf.butler.DimensionPacker
instance.Attributes Documentation
- catalog_id¶
- data_id¶
The data ID that will be embedded in all generated IDs (
DataCoordinate
).
Methods Documentation
- arange(*args, **kwargs) ndarray ¶
Generate an array of integer IDs for this catalog.
All parameters are forwarded to
numpy.arange
to generate an array of per-catalog counter integers. These are then combined with thecatalog_id`
to form the returned array.The IDs generated by
arange
will be equivalent to those generated bymake_table_id_factory
(and by extension,make_source_catalog
) only if the counter integers start with1
, not0
, because that’s whatIdFactory
does.
- make_source_catalog(schema: Schema) SourceCatalog ¶
Construct a empty catalog object with an ID factory.
This is a convenience function for the common pattern of calling
make_table_id_factory
, constructing aSourceTable
from that, and then constructing an (empty)SourceCatalog
from that.
- make_table_id_factory() IdFactory ¶
Construct a new
lsst.afw.table.IdFactory
for this catalog.
- classmethod unpacker_from_config(config: BaseIdGeneratorConfig, fixed: DataCoordinate) Callable[[int], tuple[lsst.daf.butler.core.dimensions._coordinate.DataCoordinate, int]] ¶
Return a callable that unpacks the IDs generated by this class, from a config field.
- Parameters:
- config
BaseIdGeneratorConfig
Configuration for an ID generator.
- fixed
DataCoordinate
Data ID identifying the dimensions that are considered fixed by the
IdGenerator
that produced the IDs: usually justinstrument
orskymap
, depending on the configuration. For most configurations this will need to be a fully-expanded data ID.
- config
- Returns:
- unpacker
Callable that takes a single
int
argument (an ID generated by an identically-configuredIdGenerator
) and returns a tuple of:
Notes
This method cannot be used on IDs generated without a data ID.
- classmethod unpacker_from_dimension_packer(dimension_packer: DimensionPacker, n_releases: int = 1) Callable[[int], tuple[int, lsst.daf.butler.core.dimensions._coordinate.DataCoordinate, int]] ¶
Return a callable that unpacks the IDs generated by this class, from a
lsst.daf.butler.DimensionPacker
instance.- Parameters:
- dimension_packer
lsst.daf.butler.DimensionPacker
Dimension packer used to construct the original
DimensionPackerIdGenerator
.- n_releases
int
, optional Number of (contiguous, starting from zero)
release_id
values to reserve space for. One (not zero) is used to reserve no space.
- dimension_packer
- Returns:
- unpacker
Callable that takes a single
int
argument (an ID generated by an identically-constructedDimensionPackerIdGenerator
) and returns a tuple of:
Notes
This method cannot be used on IDs generated with no data ID.