LSSTApplications  17.0+11,17.0+34,17.0+56,17.0+57,17.0+59,17.0+7,17.0-1-g377950a+33,17.0.1-1-g114240f+2,17.0.1-1-g4d4fbc4+28,17.0.1-1-g55520dc+49,17.0.1-1-g5f4ed7e+52,17.0.1-1-g6dd7d69+17,17.0.1-1-g8de6c91+11,17.0.1-1-gb9095d2+7,17.0.1-1-ge9fec5e+5,17.0.1-1-gf4e0155+55,17.0.1-1-gfc65f5f+50,17.0.1-1-gfc6fb1f+20,17.0.1-10-g87f9f3f+1,17.0.1-11-ge9de802+16,17.0.1-16-ga14f7d5c+4,17.0.1-17-gc79d625+1,17.0.1-17-gdae4c4a+8,17.0.1-2-g26618f5+29,17.0.1-2-g54f2ebc+9,17.0.1-2-gf403422+1,17.0.1-20-g2ca2f74+6,17.0.1-23-gf3eadeb7+1,17.0.1-3-g7e86b59+39,17.0.1-3-gb5ca14a,17.0.1-3-gd08d533+40,17.0.1-30-g596af8797,17.0.1-4-g59d126d+4,17.0.1-4-gc69c472+5,17.0.1-6-g5afd9b9+4,17.0.1-7-g35889ee+1,17.0.1-7-gc7c8782+18,17.0.1-9-gc4bbfb2+3,w.2019.22
LSSTDataManagementBasePackage
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Related Functions | List of all members
lsst::afw::geom::SkyWcs Class Referencefinal

A 2-dimensional celestial WCS that transform pixels to ICRS RA/Dec, using the LSST standard for pixels. More...

#include <SkyWcs.h>

Inheritance diagram for lsst::afw::geom::SkyWcs:
lsst::afw::table::io::PersistableFacade< SkyWcs > lsst::afw::typehandling::Storable lsst::afw::table::io::Persistable

Public Member Functions

 SkyWcs (SkyWcs const &)=default
 
 SkyWcs (SkyWcs &&)=default
 
SkyWcsoperator= (SkyWcs const &)=delete
 
SkyWcsoperator= (SkyWcs &&)=delete
 
 ~SkyWcs () override=default
 
bool operator== (SkyWcs const &other) const
 Equality is based on the string representations being equal. More...
 
bool operator!= (SkyWcs const &other) const
 
 SkyWcs (daf::base::PropertySet &metadata, bool strip=false)
 Construct a SkyWcs from FITS keywords. More...
 
 SkyWcs (ast::FrameDict const &frameDict)
 Construct a SkyWcs from an ast::FrameDict. More...
 
std::shared_ptr< SkyWcscopyAtShiftedPixelOrigin (lsst::geom::Extent2D const &shift) const
 Return a copy of this SkyWcs with the pixel origin shifted by the specified amount. More...
 
std::shared_ptr< daf::base::PropertyListgetFitsMetadata (bool precise=false) const
 Return the WCS as FITS WCS metadata. More...
 
lsst::geom::Angle getPixelScale (lsst::geom::Point2D const &pixel) const
 Get the pixel scale at the specified pixel position. More...
 
lsst::geom::Angle getPixelScale () const
 Get the pixel scale at the pixel origin. More...
 
lsst::geom::Point2D getPixelOrigin () const
 Get the pixel origin, in pixels, using the LSST convention. More...
 
lsst::geom::SpherePoint getSkyOrigin () const
 Get the sky origin, the celestial fiducial point. More...
 
Eigen::Matrix2d getCdMatrix (lsst::geom::Point2D const &pixel) const
 Get the 2x2 CD matrix at the specified pixel position. More...
 
Eigen::Matrix2d getCdMatrix () const
 Get the 2x2 CD matrix at the pixel origin. More...
 
std::shared_ptr< SkyWcsgetTanWcs (lsst::geom::Point2D const &pixel) const
 Get a local TAN WCS approximation to this WCS at the specified pixel position. More...
 
std::shared_ptr< const ast::FrameDictgetFrameDict () const
 Get the contained FrameDict. More...
 
std::shared_ptr< const TransformPoint2ToSpherePointgetTransform () const
 Get a TransformPoint2ToSpherePoint that transforms pixels to sky in the forward direction and sky to pixels in the inverse direction. More...
 
bool isFlipped () const
 Does the WCS follow the convention of North=Up, East=Left? More...
 
bool isPersistable () const noexcept override
 Return true if this particular object can be persisted using afw::table::io. More...
 
lsst::geom::AffineTransform linearizePixelToSky (lsst::geom::SpherePoint const &coord, lsst::geom::AngleUnit const &skyUnit) const
 Return the local linear approximation to pixelToSky at a point given in sky coordinates. More...
 
lsst::geom::AffineTransform linearizePixelToSky (lsst::geom::Point2D const &pixel, lsst::geom::AngleUnit const &skyUnit) const
 Return the local linear approximation to pixelToSky at a point given in pixel coordinates. More...
 
lsst::geom::AffineTransform linearizeSkyToPixel (lsst::geom::SpherePoint const &coord, lsst::geom::AngleUnit const &skyUnit) const
 Return the local linear approximation to skyToPixel at a point given in sky coordinates. More...
 
lsst::geom::AffineTransform linearizeSkyToPixel (lsst::geom::Point2D const &pixel, lsst::geom::AngleUnit const &skyUnit) const
 Return the local linear approximation to skyToPixel at a point given in pixel coordinates. More...
 
bool hasFitsApproximation () const
 Does this SkyWcs have an approximate SkyWcs that can be represented as standard FITS WCS? More...
 
bool isFits () const
 Return true getFitsMetadata(true) will succeed, false if not. More...
 
void writeStream (std::ostream &os) const
 Serialize this SkyWcs to an output stream. More...
 
std::string writeString () const
 Serialize this SkyWcs to a string, using the same format as writeStream. More...
 
std::shared_ptr< typehandling::StorablecloneStorable () const override
 Create a new SkyWcs that is a copy of this one. More...
 
std::string toString () const override
 Create a string representation of this object. More...
 
bool equals (typehandling::Storable const &other) const noexcept override
 Compare this object to another Storable. More...
 
virtual std::size_t hash_value () const
 Return a hash of this object (optional operation). More...
 
void writeFits (std::string const &fileName, std::string const &mode="w") const
 Write the object to a regular FITS file. More...
 
void writeFits (fits::MemFileManager &manager, std::string const &mode="w") const
 Write the object to a FITS image in memory. More...
 
void writeFits (fits::Fits &fitsfile) const
 Write the object to an already-open FITS object. More...
 
lsst::geom::SpherePoint pixelToSky (lsst::geom::Point2D const &pixel) const
 Compute sky position(s) from pixel position(s) More...
 
lsst::geom::SpherePoint pixelToSky (double x, double y) const
 Compute sky position(s) from pixel position(s) More...
 
std::vector< lsst::geom::SpherePointpixelToSky (std::vector< lsst::geom::Point2D > const &pixels) const
 Compute sky position(s) from pixel position(s) More...
 
lsst::geom::Point2D skyToPixel (lsst::geom::SpherePoint const &sky) const
 Compute pixel position(s) from sky position(s) More...
 
std::vector< lsst::geom::Point2DskyToPixel (std::vector< lsst::geom::SpherePoint > const &sky) const
 Compute pixel position(s) from sky position(s) More...
 

Static Public Member Functions

static std::string getShortClassName ()
 
static std::shared_ptr< SkyWcsreadStream (std::istream &is)
 Deserialize a SkyWcs from an input stream. More...
 
static std::shared_ptr< SkyWcsreadString (std::string &str)
 Deserialize a SkyWcs from a string, using the same format as readStream. More...
 
static std::shared_ptr< SkyWcsreadFits (fits::Fits &fitsfile)
 Read an object from an already open FITS object. More...
 
static std::shared_ptr< SkyWcsreadFits (std::string const &fileName, int hdu=fits::DEFAULT_HDU)
 Read an object from a regular FITS file. More...
 
static std::shared_ptr< SkyWcsreadFits (fits::MemFileManager &manager, int hdu=fits::DEFAULT_HDU)
 Read an object from a FITS file in memory. More...
 
static std::shared_ptr< SkyWcsdynamicCast (std::shared_ptr< Persistable > const &ptr)
 Dynamically cast a shared_ptr. More...
 

Protected Types

typedef io::OutputArchiveHandle OutputArchiveHandle
 

Protected Member Functions

std::string getPersistenceName () const override
 Return the unique name used to persist this object and look up its factory. More...
 
std::string getPythonModule () const override
 Return the fully-qualified Python module that should be imported to guarantee that its factory is registered. More...
 
void write (OutputArchiveHandle &handle) const override
 Write the object to one or more catalogs. More...
 

Static Protected Member Functions

template<class T >
static bool singleClassEquals (T const &lhs, Storable const &rhs)
 Test if a Storable is of a particular class and equal to another object. More...
 

Related Functions

(Note that these are not member functions.)

std::ostreamoperator<< (std::ostream &os, Storable const &storable)
 Output operator for Storable. More...
 

Detailed Description

A 2-dimensional celestial WCS that transform pixels to ICRS RA/Dec, using the LSST standard for pixels.

SkyWcs is an immutable object that can not only represent any standard FITS WCS, but can also contain arbitrary Transforms, e.g. to model optical distortion or pixel imperfections.

In order to make a SkyWcs that models optical distortion, say, it is usually simplest to start with a standard FITS WCS (such as a TAN WCS) as an approximation, then insert a transform that models optical distortion by calling makeModifiedWcs. However, it is also possible to build a SkyWcs entirely from transforms, if you prefer, by building an ast::FrameDict and constructing the SkyWcs from that.

Frames of reference

SkyWcs internally keeps track of the following frames of reference:

Pixel position standards

The LSST standard for pixel position is: 0,0 is the center of the lower left image pixel. The FITS standard for pixel position is: 1,1 is the center of the lower left image pixel.

LSST and FITS also use a different origin for subimages:

Internal details: the contained ast::FrameDict

SkyWcs contains an ast::FrameDict which transforms from pixels to sky (in radians) in the forward direction.

This FrameDict contains the named frames described in frames of reference, e.g. "SKY", "IWC", cameraGeom::PIXELS and possibly cameraGeom::ACTUAL_PIXELS. "SKY" is the current frame. If cameraGeom::ACTUAL_PIXELS is present then it is the base frame, otherwise cameraGeom::PIXELS is the base frame.

The "SKY" frame is of type ast::SkyFrame and has the following attributes:

The other frames are of type ast::Frame and have 2 axes.

Definition at line 117 of file SkyWcs.h.

Member Typedef Documentation

◆ OutputArchiveHandle

typedef io::OutputArchiveHandle lsst::afw::table::io::Persistable::OutputArchiveHandle
protectedinherited

Definition at line 108 of file Persistable.h.

Constructor & Destructor Documentation

◆ SkyWcs() [1/4]

lsst::afw::geom::SkyWcs::SkyWcs ( SkyWcs const &  )
default

◆ SkyWcs() [2/4]

lsst::afw::geom::SkyWcs::SkyWcs ( SkyWcs &&  )
default

◆ ~SkyWcs()

lsst::afw::geom::SkyWcs::~SkyWcs ( )
overridedefault

◆ SkyWcs() [3/4]

lsst::afw::geom::SkyWcs::SkyWcs ( daf::base::PropertySet metadata,
bool  strip = false 
)
explicit

Construct a SkyWcs from FITS keywords.

Parameters
[in]metadataFITS header metadata
[in]stripIf 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::TypeErrorif the metadata does not describe a celestial WCS.

Definition at line 157 of file SkyWcs.cc.

158  : SkyWcs(detail::readLsstSkyWcs(metadata, strip)) {}
std::shared_ptr< ast::FrameDict > readLsstSkyWcs(daf::base::PropertySet &metadata, bool strip=true)
Read an LSST celestial WCS FrameDict from a FITS header.
SkyWcs(SkyWcs const &)=default
bool strip
Definition: fits.cc:883

◆ SkyWcs() [4/4]

lsst::afw::geom::SkyWcs::SkyWcs ( ast::FrameDict const &  frameDict)
explicit

Construct a SkyWcs from an ast::FrameDict.

This is the most general constructor; it can be used to define any celestial WCS. Note that in many cases the result will not be exactly representable as a FITS WCS.

Parameters
[in]frameDictAn ast::FrameDict that describes the transformation from pixels to sky. It must meet the requirements outlined in the contained ast::FrameDict.
Exceptions
lsst::pex::exceptions::TypeErrorif frameDict is missing any of the required frames of reference.

Definition at line 160 of file SkyWcs.cc.

160 : SkyWcs(_checkFrameDict(frameDict)) {}
SkyWcs(SkyWcs const &)=default

Member Function Documentation

◆ cloneStorable()

std::shared_ptr< typehandling::Storable > lsst::afw::geom::SkyWcs::cloneStorable ( ) const
overridevirtual

Create a new SkyWcs that is a copy of this one.

Reimplemented from lsst::afw::typehandling::Storable.

Definition at line 332 of file SkyWcs.cc.

332  {
333  return std::make_unique<SkyWcs>(*this);
334 }

◆ copyAtShiftedPixelOrigin()

std::shared_ptr< SkyWcs > lsst::afw::geom::SkyWcs::copyAtShiftedPixelOrigin ( lsst::geom::Extent2D const &  shift) const

Return a copy of this SkyWcs with the pixel origin shifted by the specified amount.

new pixel origin = the old pixel origin + shift

Parameters
[in]shiftThe amount by which to shift the pixel origin (pixels)

Definition at line 212 of file SkyWcs.cc.

212  {
213  auto newToOldPixel = TransformPoint2ToPoint2(ast::ShiftMap({-shift[0], -shift[1]}));
214  return makeModifiedWcs(newToOldPixel, *this, true);
215 }
std::shared_ptr< SkyWcs > makeModifiedWcs(TransformPoint2ToPoint2 const &pixelTransform, SkyWcs const &wcs, bool modifyActualPixels)
Create a new SkyWcs whose pixels are transformed by pixelTransform, as described below.
Definition: SkyWcs.cc:451
Transform< Point2Endpoint, Point2Endpoint > TransformPoint2ToPoint2
Definition: Transform.h:300
ShiftMap is a linear Mapping which shifts each axis by a specified constant value.
Definition: ShiftMap.h:40

◆ dynamicCast()

Dynamically cast a shared_ptr.

Dynamically cast a shared pointer and raise on failure.

You must provide an explicit template instantiation in the .cc file for each class that inherits from PersistableFacade. Designed to work around RTTI issues on macOS with hidden symbols;

Exceptions
lsst::pex::exceptions::LogicErrorif the cast fails

param[in] ptr The pointer to be cast.

Returns
The cast pointer.
Exceptions
lsst::pex::exceptions::TypeErrorIf the dynamic cast fails.

Definition at line 18 of file Persistable.cc.

18  {
20  if (!result) {
21  throw LSST_EXCEPT(pex::exceptions::TypeError, "Dynamic pointer cast failed");
22  }
23  return result;
24 }
uint64_t * ptr
Definition: RangeSet.cc:88
py::object result
Definition: schema.cc:418
T dynamic_pointer_cast(T... args)
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48

◆ equals()

bool lsst::afw::geom::SkyWcs::equals ( typehandling::Storable const &  other) const
overridevirtualnoexcept

Compare this object to another Storable.

Returns
*this == other if other is a SkyWcs; otherwise false.

Reimplemented from lsst::afw::typehandling::Storable.

Definition at line 338 of file SkyWcs.cc.

338  {
339  return singleClassEquals(*this, other);
340 }
ItemVariant const * other
Definition: Schema.cc:56
static bool singleClassEquals(T const &lhs, Storable const &rhs)
Test if a Storable is of a particular class and equal to another object.
Definition: Storable.h:136

◆ getCdMatrix() [1/2]

Eigen::Matrix2d lsst::afw::geom::SkyWcs::getCdMatrix ( lsst::geom::Point2D const &  pixel) const

Get the 2x2 CD matrix at the specified pixel position.

The elements are in degrees

Definition at line 197 of file SkyWcs.cc.

197  {
198  auto const pixelToIwc = getFrameDict()->getMapping(ast::FrameSet::BASE, "IWC");
199  auto const pixelToIwcTransform = TransformPoint2ToPoint2(*pixelToIwc);
200  return pixelToIwcTransform.getJacobian(pixel);
201 }
std::shared_ptr< const ast::FrameDict > getFrameDict() const
Get the contained FrameDict.
Definition: SkyWcs.cc:246
Transform< Point2Endpoint, Point2Endpoint > TransformPoint2ToPoint2
Definition: Transform.h:300
table::PointKey< int > pixel
static int constexpr BASE
index of base frame
Definition: FrameSet.h:104

◆ getCdMatrix() [2/2]

Eigen::Matrix2d lsst::afw::geom::SkyWcs::getCdMatrix ( ) const

Get the 2x2 CD matrix at the pixel origin.

The elements are in degrees

Definition at line 203 of file SkyWcs.cc.

203 { return getCdMatrix(getPixelOrigin()); }
Eigen::Matrix2d getCdMatrix() const
Get the 2x2 CD matrix at the pixel origin.
Definition: SkyWcs.cc:203
lsst::geom::Point2D getPixelOrigin() const
Get the pixel origin, in pixels, using the LSST convention.
Definition: SkyWcs.h:215

◆ getFitsMetadata()

std::shared_ptr< daf::base::PropertyList > lsst::afw::geom::SkyWcs::getFitsMetadata ( bool  precise = false) const

Return the WCS as FITS WCS metadata.

Parameters
[in]preciseFail if the WCS cannot be accurately represented as FITS metadata? If False then return an approximation. For now that approximation is pure TAN but as of DM-13170 it will be a fit TAN-SIP. The required precision is set by constant TIGHT_FITS_TOL in SkyWcs.cc

FITS representations of WCS are described in "Representations of World Coordinates in FITS" by Greisen and Calabretta and several related papers.

The required precision is hard-coded as constant TIGHT_FITS_TOL in SkyWcs.cc

Exceptions
lsst::pex::exceptions::RuntimeErrorif precise is true and AST cannot represent this WCS as a FITS WCS to sufficient precision.

Definition at line 217 of file SkyWcs.cc.

217  {
218  // Make a FrameSet that maps from GRID to SKY; GRID = the base frame (PIXELS or ACTUAL_PIXELS) + 1
219  auto const gridToPixel = ast::ShiftMap({-1.0, -1.0});
220  auto thisDict = getFrameDict();
221  auto const pixelToIwc = thisDict->getMapping(ast::FrameSet::BASE, "IWC");
222  auto const iwcToSky = thisDict->getMapping("IWC", "SKY");
223  auto const gridToSky = gridToPixel.then(*pixelToIwc).then(*iwcToSky);
224  ast::FrameSet frameSet(ast::Frame(2, "Domain=GRID"), gridToSky, *thisDict->getFrame("SKY", false));
225 
226  // Write frameSet to a FitsChan and extract the metadata
228  os << "Encoding=FITS-WCS, CDMatrix=1, FitsAxisOrder=<copy>, FitsTol=" << TIGHT_FITS_TOL;
229  ast::StringStream strStream;
230  ast::FitsChan fitsChan(strStream, os.str());
231  int const nObjectsWritten = fitsChan.write(frameSet);
232  if (nObjectsWritten == 0) {
233  if (precise) {
235  "Could not represent this SkyWcs using FITS-WCS metadata");
236  } else {
237  // An exact representation could not be written, so try to write a local TAN approximation;
238  // set precise true to avoid an infinite loop, should something go wrong
239  auto tanWcs = getTanWcs(getPixelOrigin());
240  return tanWcs->getFitsMetadata(true);
241  }
242  }
244 }
table::Key< table::Array< std::uint8_t > > frameSet
std::shared_ptr< SkyWcs > getTanWcs(lsst::geom::Point2D const &pixel) const
Get a local TAN WCS approximation to this WCS at the specified pixel position.
Definition: SkyWcs.cc:205
SeriesMap then(Mapping const &next) const
Return a series compound mapping this(first(input)) containing shallow copies of the original...
Definition: Mapping.cc:37
std::shared_ptr< const ast::FrameDict > getFrameDict() const
Get the contained FrameDict.
Definition: SkyWcs.cc:246
A specialized form of Channel which reads and writes FITS header cards.
Definition: FitsChan.h:201
Frame is used to represent a coordinate system.
Definition: Frame.h:157
std::shared_ptr< daf::base::PropertyList > getPropertyListFromFitsChan(ast::FitsChan &fitsChan)
Copy values from an AST FitsChan into a PropertyList.
ShiftMap is a linear Mapping which shifts each axis by a specified constant value.
Definition: ShiftMap.h:40
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
lsst::geom::Point2D getPixelOrigin() const
Get the pixel origin, in pixels, using the LSST convention.
Definition: SkyWcs.h:215
String-based source and sink for channels.
Definition: Stream.h:180
static int constexpr BASE
index of base frame
Definition: FrameSet.h:104
A FrameSet consists of a set of one or more Frames (which describe coordinate systems), connected together by Mappings (which describe how the coordinate systems are inter-related).
Definition: FrameSet.h:99
std::ostream * os
Definition: Schema.cc:746
Reports errors that are due to events beyond the control of the program.
Definition: Runtime.h:104

◆ getFrameDict()

std::shared_ptr< const ast::FrameDict > lsst::afw::geom::SkyWcs::getFrameDict ( ) const

Get the contained FrameDict.

The base frame will be cameraGeom::PIXELS or cameraGeom::ACTUAL_PIXELS and the current frame will be SKY, so the forward transform goes from pixels (using the LSST zero convention) to sky ICRS RA, Dec (in radians). For more details see the contained ast::FrameDict

Definition at line 246 of file SkyWcs.cc.

246 { return _frameDict; }

◆ getPersistenceName()

std::string lsst::afw::geom::SkyWcs::getPersistenceName ( ) const
overrideprotectedvirtual

Return the unique name used to persist this object and look up its factory.

Must be less than ArchiveIndexSchema::MAX_NAME_LENGTH characters.

Reimplemented from lsst::afw::table::io::Persistable.

Definition at line 342 of file SkyWcs.cc.

342 { return getSkyWcsPersistenceName(); }

◆ getPixelOrigin()

lsst::geom::Point2D lsst::afw::geom::SkyWcs::getPixelOrigin ( ) const
inline

Get the pixel origin, in pixels, using the LSST convention.

This is CRPIX1 - 1, CRPIX2 -1 in FITS terminology

Definition at line 215 of file SkyWcs.h.

215 { return _pixelOrigin; };

◆ getPixelScale() [1/2]

lsst::geom::Angle lsst::afw::geom::SkyWcs::getPixelScale ( lsst::geom::Point2D const &  pixel) const

Get the pixel scale at the specified pixel position.

The scale is the square root of the area of the specified pixel on the sky.

Warning
Unlike getPixelScale() the value is not cached, even if pixel = pixel origin.

Definition at line 164 of file SkyWcs.cc.

164  {
165  // Compute pixVec containing the pixel position and two nearby points
166  // (use a vector so all three points can be converted to sky in a single call)
167  double const side = 1.0;
170  };
171 
172  auto skyVec = pixelToSky(pixVec);
173 
174  // Work in 3-space to avoid RA wrapping and pole issues
175  auto skyLL = skyVec[0].getVector();
176  auto skyDx = skyVec[1].getVector() - skyLL;
177  auto skyDy = skyVec[2].getVector() - skyLL;
178 
179  // Compute pixel scale in radians = sqrt(pixel area in radians^2)
180  // pixel area in radians^2 = area of parallelogram with sides skyDx, skyDy = |skyDx cross skyDy|
181  // Use squared norm to avoid two square roots
182  double skyAreaSq = skyDx.cross(skyDy).getSquaredNorm();
183  return (std::pow(skyAreaSq, 0.25) / side) * lsst::geom::radians;
184 }
lsst::geom::SpherePoint pixelToSky(lsst::geom::Point2D const &pixel) const
Compute sky position(s) from pixel position(s)
Definition: SkyWcs.h:334
AngleUnit constexpr radians
constant with units of radians
Definition: Angle.h:108
STL class.
T pow(T... args)
table::PointKey< int > pixel
Extent< double, 2 > Extent2D
Definition: Extent.h:400

◆ getPixelScale() [2/2]

lsst::geom::Angle lsst::afw::geom::SkyWcs::getPixelScale ( ) const
inline

Get the pixel scale at the pixel origin.

The scale is the square root of the area of the specified pixel on the sky.

The value is cached, so this is a cheap call.

Definition at line 208 of file SkyWcs.h.

208 { return _pixelScaleAtOrigin; };

◆ getPythonModule()

std::string lsst::afw::geom::SkyWcs::getPythonModule ( ) const
overrideprotectedvirtual

Return the fully-qualified Python module that should be imported to guarantee that its factory is registered.

Must be less than ArchiveIndexSchema::MAX_MODULE_LENGTH characters.

Will be ignored if empty.

Reimplemented from lsst::afw::table::io::Persistable.

Definition at line 344 of file SkyWcs.cc.

344 { return "lsst.afw.geom"; }

◆ getShortClassName()

std::string lsst::afw::geom::SkyWcs::getShortClassName ( )
static

Definition at line 278 of file SkyWcs.cc.

278 { return "SkyWcs"; };

◆ getSkyOrigin()

lsst::geom::SpherePoint lsst::afw::geom::SkyWcs::getSkyOrigin ( ) const

Get the sky origin, the celestial fiducial point.

This is CRVAL1, CRVAL2 in FITS terminology

Definition at line 186 of file SkyWcs.cc.

186  {
187  // CRVAL is stored as the SkyRef property of the sky frame (the current frame of the SkyWcs)
189  getFrameDict()->getFrame(ast::FrameDict::CURRENT, false)); // false: do not copy
190  if (!skyFrame) {
191  throw LSST_EXCEPT(pex::exceptions::LogicError, "Current frame is not a SkyFrame");
192  }
193  auto const crvalRad = skyFrame->getSkyRef();
194  return lsst::geom::SpherePoint(crvalRad[0] * lsst::geom::radians, crvalRad[1] * lsst::geom::radians);
195 }
static int constexpr CURRENT
index of current frame
Definition: FrameSet.h:105
std::shared_ptr< const ast::FrameDict > getFrameDict() const
Get the contained FrameDict.
Definition: SkyWcs.cc:246
AngleUnit constexpr radians
constant with units of radians
Definition: Angle.h:108
SkyFrame is a specialised form of Frame which describes celestial longitude/latitude coordinate syste...
Definition: SkyFrame.h:66
T dynamic_pointer_cast(T... args)
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
lsst::geom::SpherePoint SpherePoint
Definition: misc.h:35

◆ getTanWcs()

std::shared_ptr< SkyWcs > lsst::afw::geom::SkyWcs::getTanWcs ( lsst::geom::Point2D const &  pixel) const

Get a local TAN WCS approximation to this WCS at the specified pixel position.

Definition at line 205 of file SkyWcs.cc.

205  {
206  auto const crval = pixelToSky(pixel);
207  auto const cdMatrix = getCdMatrix(pixel);
208  auto metadata = makeSimpleWcsMetadata(pixel, crval, cdMatrix);
209  return std::make_shared<SkyWcs>(*metadata);
210 }
lsst::geom::SpherePoint pixelToSky(lsst::geom::Point2D const &pixel) const
Compute sky position(s) from pixel position(s)
Definition: SkyWcs.h:334
table::PointKey< double > crval
Definition: OldWcs.cc:130
Eigen::Matrix2d getCdMatrix() const
Get the 2x2 CD matrix at the pixel origin.
Definition: SkyWcs.cc:203
std::shared_ptr< daf::base::PropertyList > makeSimpleWcsMetadata(lsst::geom::Point2D const &crpix, lsst::geom::SpherePoint const &crval, Eigen::Matrix2d const &cdMatrix, std::string const &projection="TAN")
Make FITS metadata for a simple FITS WCS (one with no distortion).
Definition: wcsUtils.cc:172
table::PointKey< int > pixel

◆ getTransform()

std::shared_ptr<const TransformPoint2ToSpherePoint> lsst::afw::geom::SkyWcs::getTransform ( ) const
inline

Get a TransformPoint2ToSpherePoint that transforms pixels to sky in the forward direction and sky to pixels in the inverse direction.

Definition at line 257 of file SkyWcs.h.

257 { return _transform; };

◆ hasFitsApproximation()

bool lsst::afw::geom::SkyWcs::hasFitsApproximation ( ) const
inline

Does this SkyWcs have an approximate SkyWcs that can be represented as standard FITS WCS?

This feature is not yet implemented, so hasFitsApproximation is always false.

Definition at line 364 of file SkyWcs.h.

364 { return false; }

◆ hash_value()

std::size_t lsst::afw::typehandling::Storable::hash_value ( ) const
virtualinherited

Return a hash of this object (optional operation).

Exceptions
UnsupportedOperationExceptionThrown if this object is not hashable.
Note
Subclass authors are responsible for any associated specializations of std::hash.

Reimplemented in lsst::afw::image::Filter, lsst::afw::geom::polygon::Polygon, and lsst::afw::image::VisitInfo.

Definition at line 44 of file Storable.cc.

44  {
45  throw LSST_EXCEPT(UnsupportedOperationException, "Hashes are not supported.");
46 }
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48

◆ isFits()

bool lsst::afw::geom::SkyWcs::isFits ( ) const

Return true getFitsMetadata(true) will succeed, false if not.

In other words, true indicates that the WCS can be accurately represented using FITS WCS metadata.

Definition at line 248 of file SkyWcs.cc.

248  {
249  try {
250  getFitsMetadata(true);
251  } catch (const lsst::pex::exceptions::RuntimeError&) {
252  return false;
253  } catch (const std::runtime_error&) {
254  return false;
255  }
256  return true;
257 }
std::shared_ptr< daf::base::PropertyList > getFitsMetadata(bool precise=false) const
Return the WCS as FITS WCS metadata.
Definition: SkyWcs.cc:217
Reports errors that are due to events beyond the control of the program.
Definition: Runtime.h:104

◆ isFlipped()

bool lsst::afw::geom::SkyWcs::isFlipped ( ) const

Does the WCS follow the convention of North=Up, East=Left?

Returns
False/true if E is along -X/+X when the N/E axes are rotated so that N is along image +Y.
Exceptions
lsst::pex::exceptions::RuntimeErrorif the parity cannot be determined because the CD matrix is singular.

Definition at line 280 of file SkyWcs.cc.

280  {
281  double det = getCdMatrix().determinant();
282  if (det == 0) {
283  throw(LSST_EXCEPT(pex::exceptions::RuntimeError, "CD matrix is singular"));
284  }
285  return (det > 0);
286 }
Eigen::Matrix2d getCdMatrix() const
Get the 2x2 CD matrix at the pixel origin.
Definition: SkyWcs.cc:203
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48

◆ isPersistable()

bool lsst::afw::geom::SkyWcs::isPersistable ( ) const
inlineoverridevirtualnoexcept

Return true if this particular object can be persisted using afw::table::io.

Reimplemented from lsst::afw::table::io::Persistable.

Definition at line 268 of file SkyWcs.h.

268 { return true; }

◆ linearizePixelToSky() [1/2]

lsst::geom::AffineTransform lsst::afw::geom::SkyWcs::linearizePixelToSky ( lsst::geom::SpherePoint const &  coord,
lsst::geom::AngleUnit const &  skyUnit 
) const

Return the local linear approximation to pixelToSky at a point given in sky coordinates.

The local linear approximation is defined such the following is true (ignoring floating-point errors):

wcs.linearizePixelToSky(sky, skyUnit)(wcs.skyToPixel(sky)) == sky.getPosition(skyUnit);

(lsst::geom::AffineTransform::operator() applies the transform in the forward direction)

Parameters
[in]coordPosition in sky coordinates where transform is desired.
[in]skyUnitUnits to use for sky coordinates; units of matrix elements will be skyUnits/pixel.

Definition at line 259 of file SkyWcs.cc.

260  {
261  return _linearizePixelToSky(skyToPixel(coord), coord, skyUnit);
262 }
lsst::geom::Point2D skyToPixel(lsst::geom::SpherePoint const &sky) const
Compute pixel position(s) from sky position(s)
Definition: SkyWcs.h:349

◆ linearizePixelToSky() [2/2]

lsst::geom::AffineTransform lsst::afw::geom::SkyWcs::linearizePixelToSky ( lsst::geom::Point2D const &  pixel,
lsst::geom::AngleUnit const &  skyUnit 
) const

Return the local linear approximation to pixelToSky at a point given in pixel coordinates.

The local linear approximation is defined such the following is true (ignoring floating-point errors):

wcs.linearizePixelToSky(pixel, skyUnit)(pixel) == wcs.pixelToSky(pixel).getPosition(skyUnit)

(lsst::geom::AffineTransform::operator() applies the transform in the forward direction)

Parameters
[in]pixelPosition in pixel coordinates where transform is desired.
[in]skyUnitUnits to use for sky coordinates; units of matrix elements will be skyUnits/pixel.

Definition at line 263 of file SkyWcs.cc.

264  {
265  return _linearizePixelToSky(pix, pixelToSky(pix), skyUnit);
266 }
lsst::geom::SpherePoint pixelToSky(lsst::geom::Point2D const &pixel) const
Compute sky position(s) from pixel position(s)
Definition: SkyWcs.h:334

◆ linearizeSkyToPixel() [1/2]

lsst::geom::AffineTransform lsst::afw::geom::SkyWcs::linearizeSkyToPixel ( lsst::geom::SpherePoint const &  coord,
lsst::geom::AngleUnit const &  skyUnit 
) const

Return the local linear approximation to skyToPixel at a point given in sky coordinates.

The local linear approximation is defined such the following is true (ignoring floating-point errors):

wcs.linearizeSkyToPixel(sky, skyUnit)(sky.getPosition(skyUnit)) == wcs.skyToPixel(sky)

(lsst::geom::AffineTransform::operator() applies the transform in the forward direction)

Parameters
[in]coordPosition in sky coordinates where transform is desired.
[in]skyUnitUnits to use for sky coordinates; units of matrix elements will be pixels/skyUnit.

Definition at line 268 of file SkyWcs.cc.

269  {
270  return _linearizeSkyToPixel(skyToPixel(coord), coord, skyUnit);
271 }
lsst::geom::Point2D skyToPixel(lsst::geom::SpherePoint const &sky) const
Compute pixel position(s) from sky position(s)
Definition: SkyWcs.h:349

◆ linearizeSkyToPixel() [2/2]

lsst::geom::AffineTransform lsst::afw::geom::SkyWcs::linearizeSkyToPixel ( lsst::geom::Point2D const &  pixel,
lsst::geom::AngleUnit const &  skyUnit 
) const

Return the local linear approximation to skyToPixel at a point given in pixel coordinates.

The local linear approximation is defined such the following is true (ignoring floating-point errors):

wcs.linearizeSkyToPixel(pixel, skyUnit)(wcs.pixelToSky(pixel).getPosition(skyUnit)) == pixel

(lsst::geom::AffineTransform::operator() applies the transform in the forward direction)

Parameters
[in]pixelPosition in pixel coordinates where transform is desired.
[in]skyUnitUnits to use for sky coordinates; units of matrix elements will be pixels/skyUnit.

Definition at line 273 of file SkyWcs.cc.

274  {
275  return _linearizeSkyToPixel(pix, pixelToSky(pix), skyUnit);
276 }
lsst::geom::SpherePoint pixelToSky(lsst::geom::Point2D const &pixel) const
Compute sky position(s) from pixel position(s)
Definition: SkyWcs.h:334

◆ operator!=()

bool lsst::afw::geom::SkyWcs::operator!= ( SkyWcs const &  other) const
inline

Definition at line 136 of file SkyWcs.h.

136 { return !(*this == other); }
ItemVariant const * other
Definition: Schema.cc:56

◆ operator=() [1/2]

SkyWcs& lsst::afw::geom::SkyWcs::operator= ( SkyWcs const &  )
delete

◆ operator=() [2/2]

SkyWcs& lsst::afw::geom::SkyWcs::operator= ( SkyWcs &&  )
delete

◆ operator==()

bool lsst::afw::geom::SkyWcs::operator== ( SkyWcs const &  other) const

Equality is based on the string representations being equal.

Two SkyWcs constructed the same way will be equal, and a SkyWcs that has been saved and restored will be equal to the original. However, it is possible to construct two SkyWcs that behave identically as far as transforming points go, but will compare as unequal due to subtle internal differences, such as a contained ast::Mapping that has a different ID in one SkyWcs than another.

Thus equality is primarily useful for testing persistence.

Definition at line 162 of file SkyWcs.cc.

162 { return writeString() == other.writeString(); }
std::string writeString() const
Serialize this SkyWcs to a string, using the same format as writeStream.
Definition: SkyWcs.cc:326
ItemVariant const * other
Definition: Schema.cc:56

◆ pixelToSky() [1/3]

lsst::geom::SpherePoint lsst::afw::geom::SkyWcs::pixelToSky ( lsst::geom::Point2D const &  pixel) const
inline

Compute sky position(s) from pixel position(s)

Definition at line 334 of file SkyWcs.h.

334  {
335  return _transform->applyForward(pixel);
336  }
table::PointKey< int > pixel

◆ pixelToSky() [2/3]

lsst::geom::SpherePoint lsst::afw::geom::SkyWcs::pixelToSky ( double  x,
double  y 
) const
inline

Compute sky position(s) from pixel position(s)

Definition at line 337 of file SkyWcs.h.

337  {
338  return pixelToSky(lsst::geom::Point2D(x, y));
339  }
lsst::geom::SpherePoint pixelToSky(lsst::geom::Point2D const &pixel) const
Compute sky position(s) from pixel position(s)
Definition: SkyWcs.h:334
int y
Definition: SpanSet.cc:49
double x

◆ pixelToSky() [3/3]

std::vector<lsst::geom::SpherePoint> lsst::afw::geom::SkyWcs::pixelToSky ( std::vector< lsst::geom::Point2D > const &  pixels) const
inline

Compute sky position(s) from pixel position(s)

Definition at line 340 of file SkyWcs.h.

340  {
341  return _transform->applyForward(pixels);
342  }

◆ readFits() [1/3]

static std::shared_ptr<SkyWcs > lsst::afw::table::io::PersistableFacade< SkyWcs >::readFits ( fits::Fits fitsfile)
inlinestaticinherited

Read an object from an already open FITS object.

Parameters
[in]fitsfileFITS object to read from, already positioned at the desired HDU.

Definition at line 183 of file Persistable.h.

183  {
184  return dynamicCast(Persistable::_readFits(fitsfile));
185  }
static std::shared_ptr< SkyWcs > dynamicCast(std::shared_ptr< Persistable > const &ptr)
Dynamically cast a shared_ptr.
Definition: Persistable.cc:18

◆ readFits() [2/3]

static std::shared_ptr<SkyWcs > lsst::afw::table::io::PersistableFacade< SkyWcs >::readFits ( std::string const &  fileName,
int  hdu = fits::DEFAULT_HDU 
)
inlinestaticinherited

Read an object from a regular FITS file.

Parameters
[in]fileNameName of the file to read.
[in]hduHDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty.

Definition at line 194 of file Persistable.h.

194  {
195  return dynamicCast(Persistable::_readFits(fileName, hdu));
196  }
static std::shared_ptr< SkyWcs > dynamicCast(std::shared_ptr< Persistable > const &ptr)
Dynamically cast a shared_ptr.
Definition: Persistable.cc:18

◆ readFits() [3/3]

static std::shared_ptr<SkyWcs > lsst::afw::table::io::PersistableFacade< SkyWcs >::readFits ( fits::MemFileManager manager,
int  hdu = fits::DEFAULT_HDU 
)
inlinestaticinherited

Read an object from a FITS file in memory.

Parameters
[in]managerManager for the memory to read from.
[in]hduHDU to read, where 0 is the primary. The special value of afw::fits::DEFAULT_HDU skips the primary HDU if it is empty.

Definition at line 205 of file Persistable.h.

205  {
206  return dynamicCast(Persistable::_readFits(manager, hdu));
207  }
static std::shared_ptr< SkyWcs > dynamicCast(std::shared_ptr< Persistable > const &ptr)
Dynamically cast a shared_ptr.
Definition: Persistable.cc:18

◆ readStream()

std::shared_ptr< SkyWcs > lsst::afw::geom::SkyWcs::readStream ( std::istream is)
static

Deserialize a SkyWcs from an input stream.

Parameters
[in]isinput stream from which to deserialize this SkyWcs

Definition at line 288 of file SkyWcs.cc.

288  {
289  int version;
290  is >> version;
291  if (version != 1) {
292  throw LSST_EXCEPT(pex::exceptions::TypeError, "Unsupported version " + std::to_string(version));
293  }
294  std::string shortClassName;
295  is >> shortClassName;
296  if (shortClassName != SkyWcs::getShortClassName()) {
298  os << "Class name in stream " << shortClassName << " != " << SkyWcs::getShortClassName();
299  throw LSST_EXCEPT(pex::exceptions::TypeError, os.str());
300  }
302  is >> hasFitsApproximation;
303  auto astStream = ast::Stream(&is, nullptr);
304  auto astObjectPtr = ast::Channel(astStream).read();
305  auto frameSet = std::dynamic_pointer_cast<ast::FrameSet>(astObjectPtr);
306  if (!frameSet) {
308  os << "The AST serialization was read as a " << astObjectPtr->getClassName()
309  << " instead of a FrameSet";
310  throw LSST_EXCEPT(pex::exceptions::TypeError, os.str());
311  }
313  return std::make_shared<SkyWcs>(frameDict);
314 }
T to_string(T... args)
Channel provides input/output of AST objects.
Definition: Channel.h:60
STL class.
bool hasFitsApproximation() const
Does this SkyWcs have an approximate SkyWcs that can be represented as standard FITS WCS...
Definition: SkyWcs.h:364
T str(T... args)
T dynamic_pointer_cast(T... args)
static std::string getShortClassName()
Definition: SkyWcs.cc:278
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
table::Key< int > version
Definition: PhotoCalib.cc:402
A FrameSet whose frames can be referenced by domain name.
Definition: FrameDict.h:67
std::shared_ptr< Object > read()
Read an object from a channel.
Definition: Channel.cc:52
A stream for ast::Channel.
Definition: Stream.h:41
A FrameSet consists of a set of one or more Frames (which describe coordinate systems), connected together by Mappings (which describe how the coordinate systems are inter-related).
Definition: FrameSet.h:99
std::ostream * os
Definition: Schema.cc:746

◆ readString()

std::shared_ptr< SkyWcs > lsst::afw::geom::SkyWcs::readString ( std::string str)
static

Deserialize a SkyWcs from a string, using the same format as readStream.

Definition at line 316 of file SkyWcs.cc.

316  {
317  std::istringstream is(str);
318  return SkyWcs::readStream(is);
319 }
static std::shared_ptr< SkyWcs > readStream(std::istream &is)
Deserialize a SkyWcs from an input stream.
Definition: SkyWcs.cc:288

◆ singleClassEquals()

template<class T >
static bool lsst::afw::typehandling::Storable::singleClassEquals ( T const &  lhs,
Storable const &  rhs 
)
inlinestaticprotectedinherited

Test if a Storable is of a particular class and equal to another object.

This method template simplifies implementations of equals that delegate to operator== without supporting cross-class comparisons.

Template Parameters
TThe class expected of the two objects to be compared.
Parameters
lhs,rhsThe objects to compare. Note that rhs need not be a T, while lhs must be.
Returns
true if rhs is a T and lhs == rhs; false otherwise.
Exception Safety
Provides the same level of exception safety as operator==. Most implementations of operator== do not throw.
Note
This method template calls operator== with both arguments of compile-time type T const&. Its use is not recommended if there would be any ambiguity as to which operator== gets picked by overload resolution.

This method template is typically called from equals as:

bool MyType::equals(Storable const& other) const noexcept {
    return singleClassEquals(*this, other);
}

Definition at line 136 of file Storable.h.

136  {
137  auto typedRhs = dynamic_cast<T const*>(&rhs);
138  if (typedRhs != nullptr) {
139  return lhs == *typedRhs;
140  } else {
141  return false;
142  }
143  }

◆ skyToPixel() [1/2]

lsst::geom::Point2D lsst::afw::geom::SkyWcs::skyToPixel ( lsst::geom::SpherePoint const &  sky) const
inline

Compute pixel position(s) from sky position(s)

Definition at line 349 of file SkyWcs.h.

349  {
350  return _transform->applyInverse(sky);
351  }

◆ skyToPixel() [2/2]

std::vector<lsst::geom::Point2D> lsst::afw::geom::SkyWcs::skyToPixel ( std::vector< lsst::geom::SpherePoint > const &  sky) const
inline

Compute pixel position(s) from sky position(s)

Definition at line 352 of file SkyWcs.h.

352  {
353  return _transform->applyInverse(sky);
354  }

◆ toString()

std::string lsst::afw::geom::SkyWcs::toString ( ) const
overridevirtual

Create a string representation of this object.

Reimplemented from lsst::afw::typehandling::Storable.

Definition at line 336 of file SkyWcs.cc.

336 { return "SkyWcs"; }

◆ write()

void lsst::afw::geom::SkyWcs::write ( OutputArchiveHandle handle) const
overrideprotectedvirtual

Write the object to one or more catalogs.

The handle object passed to this function provides an interface for adding new catalogs and adding nested objects to the same archive (while checking for duplicates). See OutputArchiveHandle for more information.

Reimplemented from lsst::afw::table::io::Persistable.

Definition at line 346 of file SkyWcs.cc.

346  {
347  SkyWcsPersistenceHelper const& keys = SkyWcsPersistenceHelper::get();
348  table::BaseCatalog cat = handle.makeCatalog(keys.schema);
349  std::shared_ptr<table::BaseRecord> record = cat.addNew();
350  record->set(keys.wcs, formatters::stringToBytes(writeString()));
351  handle.saveCatalog(cat);
352 }
CatalogT< BaseRecord > BaseCatalog
Definition: fwd.h:71
std::string writeString() const
Serialize this SkyWcs to a string, using the same format as writeStream.
Definition: SkyWcs.cc:326
ndarray::Array< std::uint8_t, 1, 1 > stringToBytes(std::string const &str)
Encode a std::string as a vector of uint8.
Definition: Utils.cc:162

◆ writeFits() [1/3]

void lsst::afw::table::io::Persistable::writeFits ( std::string const &  fileName,
std::string const &  mode = "w" 
) const
inherited

Write the object to a regular FITS file.

Parameters
[in]fileNameName of the file to write to.
[in]modeIf "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file.

Definition at line 24 of file Persistable.cc.

24  {
25  fits::Fits fitsfile(fileName, mode, fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
26  writeFits(fitsfile);
27 }
void writeFits(std::string const &fileName, std::string const &mode="w") const
Write the object to a regular FITS file.
Definition: Persistable.cc:24

◆ writeFits() [2/3]

void lsst::afw::table::io::Persistable::writeFits ( fits::MemFileManager manager,
std::string const &  mode = "w" 
) const
inherited

Write the object to a FITS image in memory.

Parameters
[in]managerName of the file to write to.
[in]modeIf "w", any existing file with the given name will be overwritten. If "a", new HDUs will be appended to an existing file.

Definition at line 29 of file Persistable.cc.

29  {
30  fits::Fits fitsfile(manager, mode, fits::Fits::AUTO_CLOSE | fits::Fits::AUTO_CHECK);
31  writeFits(fitsfile);
32 }
void writeFits(std::string const &fileName, std::string const &mode="w") const
Write the object to a regular FITS file.
Definition: Persistable.cc:24

◆ writeFits() [3/3]

void lsst::afw::table::io::Persistable::writeFits ( fits::Fits fitsfile) const
inherited

Write the object to an already-open FITS object.

Parameters
[in]fitsfileOpen FITS object to write to.

Definition at line 18 of file Persistable.cc.

18  {
19  OutputArchive archive;
20  archive.put(this);
21  archive.writeFits(fitsfile);
22 }

◆ writeStream()

void lsst::afw::geom::SkyWcs::writeStream ( std::ostream os) const

Serialize this SkyWcs to an output stream.

Version 1 format is as follows:

If and when fits approximation is supported, the approximate WCS will be written as a second FrameDict immediately following the first.

Parameters
[out]osoutput stream to which to serialize this SkyWcs

Definition at line 321 of file SkyWcs.cc.

321  {
322  os << SERIALIZATION_VERSION << " " << SkyWcs::getShortClassName() << " " << hasFitsApproximation() << " ";
323  getFrameDict()->show(os, false); // false = do not write comments
324 }
std::shared_ptr< const ast::FrameDict > getFrameDict() const
Get the contained FrameDict.
Definition: SkyWcs.cc:246
bool hasFitsApproximation() const
Does this SkyWcs have an approximate SkyWcs that can be represented as standard FITS WCS...
Definition: SkyWcs.h:364
static std::string getShortClassName()
Definition: SkyWcs.cc:278

◆ writeString()

std::string lsst::afw::geom::SkyWcs::writeString ( ) const

Serialize this SkyWcs to a string, using the same format as writeStream.

Definition at line 326 of file SkyWcs.cc.

326  {
328  writeStream(os);
329  return os.str();
330 }
T str(T... args)
void writeStream(std::ostream &os) const
Serialize this SkyWcs to an output stream.
Definition: SkyWcs.cc:321
std::ostream * os
Definition: Schema.cc:746

Friends And Related Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream os,
Storable const &  storable 
)
related

Output operator for Storable.

Parameters
osthe desired output stream
storablethe object to print
Returns
a reference to os
Exceptions
UnsupportedOperationExceptionThrown if storable does not have an implementation of Storable::toString.

Definition at line 159 of file Storable.h.

159  {
160  return os << storable.toString();
161 }

The documentation for this class was generated from the following files: