CoaddProvenanceSerializationModel#

pydantic model lsst.images.cells.CoaddProvenanceSerializationModel#

A Pydantic model used to represent a serialized CoaddProvenance.

Notes

We can’t rewrite the Astropy tables directly into the archive (e.g. as FITS binary tables for a FITS archive), because:

  • str columns are a huge pain in both Numpy and FITS;

  • the polygon columns need to be rewritten as array-valued columns.

To deal with the string columns (instrument and physical_filter) we do dictionary compression: we map each distinct value of those columns to an integer, and then we save that mapping to the model while saving an integer version of that column in the table. But if there is actually only one value in that column (the most common case by far) we just drop the column and store that value directly in the model.

Parameters:

data (Any)

Fields:
Validators:
  • _check_and_normalize_schema_version » all fields

field butler_info: ButlerInfo | None = None#

Information about the butler dataset backed by this file.

Validated by:
  • _check_and_normalize_schema_version

field contributions: TableModel [Required]#

Table of per-cell contributions to the coadd.

Validated by:
  • _check_and_normalize_schema_version

field indirect: list[Any] [Optional]#

Serialized nested objects that may be saved or read more than once.

Validated by:
  • _check_and_normalize_schema_version

field inputs: TableModel [Required]#

Table of all inputs to the coadd.

Validated by:
  • _check_and_normalize_schema_version

field instrument: str | dict[str, int] [Required]#

Instrument name for all inputs to this coadd, or a mapping from instrument name to the integer used in its place in the tables.

Validated by:
  • _check_and_normalize_schema_version

field metadata: dict[str, MetadataValue] [Optional]#

Additional unstructured metadata.

Validated by:
  • _check_and_normalize_schema_version

field min_read_version: int = 1#

Smallest reader major that can interpret this tree.

Validated by:
  • _check_and_normalize_schema_version

field physical_filter: str | dict[str, int] [Required]#

Physical filter name for all inputs to this coadd.

Validated by:
  • _check_and_normalize_schema_version

field schema_version: str = '1.0.0'#

Data-model schema version of this tree (major.minor.patch).

Validated by:
  • _check_and_normalize_schema_version

PUBLIC_TYPE#

alias of CoaddProvenance

deserialize(archive, **kwargs)#

Deserialize a provenance from an input archive.

Parameters:
Return type:

CoaddProvenance

Notes

While CoaddProvenance.subset can be used to filter provenance information down to just certain cells, there is no advantage to be had from doing this during deserialization (the table data is not ordered by cell, and hence there’s read-slicing we can do).

deserialize_component(component, archive, **kwargs)#

Return a component in-memory object that was serialized to this tree.

Parameters:
  • component (str) – Name of the component to read.

  • archive (InputArchive[Any]) – The input archive to read from.

  • **kwargs (Any) – Additional keyword arguments specific to this type.

Raises:
Return type:

Any

Notes

The default implementation for this method tries to get an attribute with the component’s name from self, and then:

If there is no such attribute, it raises InvalidComponentError.

**kwargs are forwarded to component deserialize methods, but are otherwise not checked. Subclasses are generally expected to implement this method to do that checking and handle any components for which the other will not work, and then delegate to super at the end.

MIN_READ_VERSION: ClassVar[int] = 1#
SCHEMA_NAME: ClassVar[str] = 'coadd_provenance'#
SCHEMA_URL_BASE: ClassVar[str] = 'https://images.lsst.io/schemas'#

Base for this schema’s URL, as {SCHEMA_URL_BASE}/{name}-{version}.

External packages providing their own schemas should override this (once, on a shared intermediate base class) so their schema URLs are minted under a documentation site they control rather than images.lsst.io.

SCHEMA_VERSION: ClassVar[str] = '1.0.0'#
property schema_url: str#

Return the schema URL of this tree’s class.

Computed from SCHEMA_NAME and SCHEMA_VERSION ClassVars.

This page was last modified on .