obs_info_from_legacy#

lsst.images.obs_info_from_legacy(visit_info, exposure_record, detector, *, detector_exposure_id, telescope=None, physical_filter=None, header=None)#

Recover the observation info struct of a legacy lsst.afw.image.Exposure.

If the legacy metadata carries an embedded ObservationInfo (the flat OBS_INFO cards written by the raw formatter), that is returned as is. Otherwise as much as possible is reconstructed from the VisitInfo, an exposure dimension record, and the camera geometry.

Parameters:
  • visit_info (TypeAliasType) – The legacy visit info struct.

  • exposure_record (TypeAliasType | None) – The exposure DimensionRecord, or None to convert without one. Without a record, fields it would authoritatively supply are set to None and a warning is logged.

  • detector (TypeAliasType) – The legacy detector object; the source for detector identifiers.

  • detector_exposure_id (int) – The combination detector + exposure ID.

  • telescope (str | None, default: None) – Value of the FITS TELESCOP card, if available from the legacy metadata. VisitInfo carries no telescope information, so without this the telescope is reported as "Unknown".

  • physical_filter (str | None, default: None) – Full name of the physical bandpass filter (the physicalLabel of the legacy exposure’s FilterLabel), if available. Only used when there is no exposure_record.

  • header (MutableMapping[str, Any] | None, default: None) – The legacy exposure’s metadata (its primary FITS header as an astropy.io.fits.Header or lsst.daf.base.PropertyList), if available. When it holds an embedded ObservationInfo the OBS_INFO cards are removed from it in place, so they do not leak into other metadata, and the other parameters are only used to check that the exposure_record describes the same exposure.

Returns:

obs_info – The recovered observation metadata.

Return type:

ObservationInfo

Raises:

ValueError – Raised if exposure_record is given and does not describe the same instrument and exposure as the embedded ObservationInfo or the visit_info.

This page was last modified on .