1322 def exposureFromImage(image, dataId=None, mapper=None, logger=None, setVisitInfo=True):
1323 """Generate an Exposure from an image-like object 1325 If the image is a DecoratedImage then also set its WCS and metadata 1326 (Image and MaskedImage are missing the necessary metadata 1327 and Exposure already has those set) 1331 image : Image-like object 1332 Can be one of lsst.afw.image.DecoratedImage, Image, MaskedImage or 1337 `lsst.afw.image.Exposure` 1338 Exposure containing input image. 1345 metadata = image.getMetadata()
1348 exposure.setWcs(wcs)
1352 logger = lsstLog.Log.getLogger(
"CameraMapper")
1353 logger.debug(
"wcs set to None; insufficient information found in metadata to create a valid wcs:" 1356 exposure.setMetadata(metadata)
1360 metadata = exposure.getMetadata()
1367 if setVisitInfo
and exposure.getInfo().getVisitInfo()
is None:
1368 if metadata
is not None:
1371 logger = lsstLog.Log.getLogger(
"CameraMapper")
1372 logger.warn(
"I can only set the VisitInfo if you provide a mapper")
1374 exposureId = mapper._computeCcdExposureId(dataId)
1375 visitInfo = mapper.makeRawVisitInfo(md=metadata, exposureId=exposureId)
1377 exposure.getInfo().setVisitInfo(visitInfo)
A class to contain the data, WCS, and other information needed to describe an image of the sky...
MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > * makeMaskedImage(typename std::shared_ptr< Image< ImagePixelT >> image, typename std::shared_ptr< Mask< MaskPixelT >> mask=Mask< MaskPixelT >(), typename std::shared_ptr< Image< VariancePixelT >> variance=Image< VariancePixelT >())
A function to return a MaskedImage of the correct type (cf.
std::shared_ptr< Exposure< ImagePixelT, MaskPixelT, VariancePixelT > > makeExposure(MaskedImage< ImagePixelT, MaskPixelT, VariancePixelT > &mimage, std::shared_ptr< geom::SkyWcs const > wcs=std::shared_ptr< geom::SkyWcs const >())
A function to return an Exposure of the correct type (cf.
A class to manipulate images, masks, and variance as a single object.
std::shared_ptr< SkyWcs > makeSkyWcs(TransformPoint2ToPoint2 const &pixelsToFieldAngle, lsst::geom::Angle const &orientation, bool flipX, lsst::geom::SpherePoint const &boresight, std::string const &projection="TAN")
Construct a FITS SkyWcs from camera geometry.
Reports errors from accepting an object of an unexpected or inappropriate type.
def exposureFromImage(image, dataId=None, mapper=None, logger=None, setVisitInfo=True)
A container for an Image and its associated metadata.