lsst.afw  13.0-98-g5a654715e+2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
lsst::afw::geom::detail Namespace Reference

Functions

std::shared_ptr< ast::SkyFrame > getSkyFrame (ast::FrameSet const &frameSet, int index, bool copy)
 Get the specified frame of a FrameSet as a SkyFrame. More...
 
std::shared_ptr
< daf::base::PropertyList > 
makeTanWcsMetadata (Point2D const &crpix, coord::IcrsCoord const &crval, Eigen::Matrix2d const &cdMatrix)
 Make FITS metadata for a pure tangent WCS. More...
 
std::shared_ptr< ast::FrameSet > readFitsWcs (daf::base::PropertyList &metadata, bool strip=true)
 Read a FITS convention WCS FrameSet from FITS metadata. More...
 
std::shared_ptr< ast::FrameSet > readLsstSkyWcs (daf::base::PropertyList &metadata, bool strip=true)
 Read an LSST sky WCS FrameSet from a FITS header: 0,0 is the lower left corner of the parent image. More...
 
template<class Transform >
Transform readStream (std::istream &is)
 Deserialize a Transform from an input stream. More...
 
template<class Transform >
void writeStream (Transform const &transform, std::ostream &os)
 Serialize a Transform to an output stream. More...
 
template<int N>
double computeExtentNorm (Extent< double, N > const &s)
 
template<int N>
int computeExtentNorm (Extent< int, N > const &s)
 

Variables

constexpr int serializationVersion = 1
 version of serialization used when writing (older versions may also be supported when reading) More...
 

Function Documentation

template<int N>
double lsst::afw::geom::detail::computeExtentNorm ( Extent< double, N > const &  s)

Definition at line 45 of file Extent.h.

template<int N>
int lsst::afw::geom::detail::computeExtentNorm ( Extent< int, N > const &  s)

Definition at line 50 of file Extent.h.

std::shared_ptr<ast::SkyFrame> lsst::afw::geom::detail::getSkyFrame ( ast::FrameSet const &  frameSet,
int  index,
bool  copy 
)

Get the specified frame of a FrameSet as a SkyFrame.

Parameters
[in]frameSetFrameSet from which to get the SkyFrame
[in]indexIndex of SkyFrame. This value should lie in the range 1 to the number of frames in the FrameSet (as given by getNFrame). A value of FrameSet::Base or FrameSet::CURRENT may be given to specify the base Frame or the current Frame, respectively.
[in]copyIf true return a deep copy of the SkyFrame, else a shallow copy
std::shared_ptr<daf::base::PropertyList> lsst::afw::geom::detail::makeTanWcsMetadata ( Point2D const &  crpix,
coord::IcrsCoord const &  crval,
Eigen::Matrix2d const &  cdMatrix 
)

Make FITS metadata for a pure tangent WCS.

Parameters
[in]crpixCenter of projection on the CCD using the LSST convention: 0, 0 is the lower left pixel of the image
[in]crvalCenter of projection on the sky
[in]cdMatrixCD matrix where element (i-1, j-1) corresponds to FITS keyword CDi_j and i, j have range [1, 2]
std::shared_ptr<ast::FrameSet> lsst::afw::geom::detail::readFitsWcs ( daf::base::PropertyList &  metadata,
bool  strip = true 
)

Read a FITS convention WCS FrameSet from FITS metadata.

The resulting FrameSet may be any kind of WCS supported by FITS; if it is a celestial WCS then 1,1 will be the lower left corner of the image (the FITS convention, not the LSST convention).

Parameters
[in,out]metadataFITS header cards
[in]stripIf true strip items from metadata that are used to create the WCS
std::shared_ptr<ast::FrameSet> lsst::afw::geom::detail::readLsstSkyWcs ( daf::base::PropertyList &  metadata,
bool  strip = true 
)

Read an LSST sky WCS FrameSet from a FITS header: 0,0 is the lower left corner of the parent image.

Read standard FITS WCS header cards including IRAF standard "LTV1" and "LTV2" cards, which, if found, specify the position of the subimage in the parent image.

Set the output SkyFrame's SkyRef to CRVAL and SkyRefIs="Ignore" so the SkyRef is ignored instead of being treated as an offset.

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).

The frames of the returned WCS will be as follows:

  • base: an ast::Frame with domain "PIXELS0": pixels with 0,0 the lower left corner of the parent image
  • current: an ast::SkyFrame: ICRS RA, Dec
Parameters
[in,out]metadataFITS header cards
[in]stripIf true strip items from metadata that are used to create the WCS, excluding LTV1 and LTV2, which are always retained.
template<class Transform >
Transform lsst::afw::geom::detail::readStream ( std::istream &  is)

Deserialize a Transform from an input stream.

Template Parameters
Transformthe Transform class; can be Transform<FromEndpoint, ToEndpoint>, SkyWcs, or any other compatible class, i.e. it must support the following (see Transform.h for details):
  • a constructor that takes an ast::FrameSet
  • static method getShortClassName
  • method getFrameSet
Parameters
[in]isinput stream from which to deserialize this Transform

Definition at line 80 of file transformUtils.h.

template<class Transform >
void lsst::afw::geom::detail::writeStream ( Transform const &  transform,
std::ostream &  os 
)

Serialize a Transform to an output stream.

Version 1 format is as follows:

  • The version number (an integer)
  • A space
  • The short class name, as obtained from getShortClassName
  • A space
  • The contained ast::FrameSet written using FrameSet.show(os, false)
Parameters
[out]osoutput stream to which to serialize this Transform
[in]transformTransform to serialize

Definition at line 108 of file transformUtils.h.

Variable Documentation

constexpr int lsst::afw::geom::detail::serializationVersion = 1

version of serialization used when writing (older versions may also be supported when reading)

Definition at line 43 of file transformUtils.h.