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 flatOBS_INFOcards written by the raw formatter), that is returned as is. Otherwise as much as possible is reconstructed from theVisitInfo, anexposuredimension record, and the camera geometry.- Parameters:
visit_info (
TypeAliasType) – The legacy visit info struct.exposure_record (
TypeAliasType|None) – TheexposureDimensionRecord, orNoneto convert without one. Without a record, fields it would authoritatively supply are set toNoneand 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 FITSTELESCOPcard, if available from the legacy metadata.VisitInfocarries 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 (thephysicalLabelof the legacy exposure’sFilterLabel), if available. Only used when there is noexposure_record.header (
MutableMapping[str,Any] |None, default:None) – The legacy exposure’s metadata (its primary FITS header as anastropy.io.fits.Headerorlsst.daf.base.PropertyList), if available. When it holds an embeddedObservationInfotheOBS_INFOcards are removed from it in place, so they do not leak into other metadata, and the other parameters are only used to check that theexposure_recorddescribes the same exposure.
- Returns:
obs_info – The recovered observation metadata.
- Return type:
- Raises:
ValueError – Raised if
exposure_recordis given and does not describe the same instrument and exposure as the embeddedObservationInfoor thevisit_info.