MakeRawVisitInfoViaObsInfo

class lsst.obs.base.MakeRawVisitInfoViaObsInfo(log: Logger | None = None, doStripHeader: bool = False)

Bases: object

Base class functor to make a VisitInfo from the FITS header of a raw image using ObservationInfo translators.

Subclasses can be used if a specific MetadataTranslator translator should be used.

The design philosophy is to make a best effort and log warnings of problems, rather than raising exceptions, in order to extract as much VisitInfo information as possible from a messy FITS header without the user needing to add a lot of error handling.

Parameters:
loglogging.Logger or None

Logger to use for messages. (None to use Log.getLogger("lsst.obs.base.makeRawVisitInfoViaObsInfo")).

doStripHeaderbool, optional

Strip header keywords from the metadata as they are used?

Attributes Summary

metadataTranslator

Header translator to use to construct VisitInfo, defaulting to automatic determination.

Methods Summary

__call__(md)

Construct a VisitInfo and strip associated data from the metadata.

observationInfo2visitInfo(obsInfo[, log])

Construct a VisitInfo from an ObservationInfo.

Attributes Documentation

metadataTranslator: ClassVar[type[astro_metadata_translator.translator.MetadataTranslator] | None] = None

Header translator to use to construct VisitInfo, defaulting to automatic determination.

Methods Documentation

__call__(md: lsst.daf.base.PropertySet) lsst.afw.image.VisitInfo

Construct a VisitInfo and strip associated data from the metadata.

Parameters:
mdlsst.daf.base.PropertyList or lsst.daf.base.PropertySet

Metadata to pull from. May be modified if stripHeader is True.

Returns:
visitInfolsst.afw.image.VisitInfo

VisitInfo derived from the header using a MetadataTranslator.

static observationInfo2visitInfo(obsInfo: ObservationInfo, log: logging.Logger | None = None) lsst.afw.image.VisitInfo

Construct a VisitInfo from an ObservationInfo.

Parameters:
obsInfoastro_metadata_translator.ObservationInfo

Information gathered from the observation metadata.

loglogging.Logger or lsst.log.Log, optional

Logger to use for logging informational messages. If None logging will be disabled.

Returns:
visitInfolsst.afw.image.VisitInfo

VisitInfo derived from the supplied ObservationInfo.