Function lsst::afw::geom::detail::readLsstSkyWcs

Function Documentation

std::shared_ptr<ast::FrameDict> lsst::afw::geom::detail::readLsstSkyWcs(daf::base::PropertySet &metadata, bool strip = true)

Read an LSST celestial WCS FrameDict from a FITS header.

Calls getImageXY0FromMetadata to determine image XY0.

Saves CRVAL by setting the output SkyFrame’s SkyRef to CRVAL and SkyRefIs=”Ignore” (so SkyRef is not treated as an offset).

The frames of the returned WCS will be as follows:

  • ”PIXELS” (base frame): pixel frame with 0,0 the lower left corner of the image (LSST convention)

  • ”IWC”: FITS WCS intermediate world coordinate system

  • ”SKY” (current frame): an ast::SkyFrame with domain “SKY”: ICRS RA, Dec

Warning

Does not compensate for the offset between a subimage and its parent image; callers must do that manually, e.g. by calling SkyWcs::copyAtShiftedPosition.

Warning

the general SkyWcs generated by LSST software cannot be exactly represented using standard WCS FITS cards, and so this function cannot read those. This function is intended for two purposes:

  • Read the standard FITS WCS found in raw data and other images from non-LSST observatories and convert it to the LSST pixel convention.

  • Read the approximate FITS WCS that LSST writes to FITS images (for use by non-LSST code).

All frames are instances of ast::Frame except the SKY frame. All have 2 axes.

Parameters
  • [inout] metadata: FITS header cards

  • [in] strip: If true: strip items from metadata used to create the WCS, such as RADESYS, EQUINOX, CTYPE12, CRPIX12, CRVAL12, etc. Always keep keywords that might be wanted for other purpposes, including NAXIS12 and date-related keywords such as “DATE-OBS” and “TIMESYS” (but not “EQUINOX”).

Exceptions
  • lsst::pex::exceptions::TypeError: if the metadata does not describe a celestial WCS.