LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Private Attributes | List of all members
lsst.skymap.detail.wcsFactory.WcsFactory Class Reference
Inheritance diagram for lsst.skymap.detail.wcsFactory.WcsFactory:

Public Member Functions

def __init__
 
def makeWcs
 

Private Attributes

 _pixelScaleDeg
 
 _projection
 
 _rotation
 
 _cdMatrix
 
 _ctypes
 

Detailed Description

A factory for creating Wcs objects for the sky tiles.

Definition at line 29 of file wcsFactory.py.

Constructor & Destructor Documentation

def lsst.skymap.detail.wcsFactory.WcsFactory.__init__ (   self,
  pixelScale,
  projection,
  rotation = 0*afwGeom.radians 
)
Make a WcsFactory

@param[in] pixelScale: desired scale, as sky/pixel, an afwGeom.Angle
@param[in] projection: FITS-standard 3-letter name of projection, e.g.:
    TAN (tangent), STG (stereographic), MOL (Mollweide's), AIT (Hammer-Aitoff)
    see Representations of celestial coordinates in FITS (Calabretta and Greisen, 2002)
@param[in] rotation:   Rotation relative to cardinal, as an lsst.afw.geom.Angle

Definition at line 32 of file wcsFactory.py.

32 
33  def __init__(self, pixelScale, projection, rotation=0*afwGeom.radians):
34  """Make a WcsFactory
35 
36  @param[in] pixelScale: desired scale, as sky/pixel, an afwGeom.Angle
37  @param[in] projection: FITS-standard 3-letter name of projection, e.g.:
38  TAN (tangent), STG (stereographic), MOL (Mollweide's), AIT (Hammer-Aitoff)
39  see Representations of celestial coordinates in FITS (Calabretta and Greisen, 2002)
40  @param[in] rotation: Rotation relative to cardinal, as an lsst.afw.geom.Angle
41  """
42  if len(projection) != 3:
43  raise RuntimeError("projection=%r; must have length 3" % (projection,))
44  self._pixelScaleDeg = pixelScale.asDegrees()
45  self._projection = str(projection)
46  self._rotation = rotation
47  cosTerm = self._pixelScaleDeg * math.cos(rotation.asRadians())
48  sinTerm = self._pixelScaleDeg * math.sin(rotation.asRadians())
49  self._cdMatrix = {"CD1_1": -cosTerm,
50  "CD2_1": sinTerm,
51  "CD1_2": sinTerm,
52  "CD2_2": cosTerm,
53  }
54  self._ctypes = [("%-5s%3s" % (("RA", "DEC")[i], self._projection)).replace(" ", "-")
55  for i in range(2)]

Member Function Documentation

def lsst.skymap.detail.wcsFactory.WcsFactory.makeWcs (   self,
  crPixPos,
  crValCoord,
  kargs 
)
Make a Wcs

@param[in] crPixPos: crPix for WCS, using the LSST standard; an afwGeom.Point2D or pair of floats
@param[in] crValCoord: crVal for WCS (afwCoord.Coord)
**kargs: FITS keyword arguments for WCS

Definition at line 56 of file wcsFactory.py.

56 
57  def makeWcs(self, crPixPos, crValCoord, **kargs):
58  """Make a Wcs
59 
60  @param[in] crPixPos: crPix for WCS, using the LSST standard; an afwGeom.Point2D or pair of floats
61  @param[in] crValCoord: crVal for WCS (afwCoord.Coord)
62  **kargs: FITS keyword arguments for WCS
63  """
64  ps = dafBase.PropertySet()
65  crPixFits = [ind + 1.0 for ind in crPixPos] # convert pix position to FITS standard
66  crValDeg = crValCoord.getPosition(afwGeom.degrees)
67  for i in range(2):
68  ip1 = i + 1
69  ps.add("CTYPE%1d" % (ip1,), self._ctypes[i])
70  ps.add("CRPIX%1d" % (ip1,), crPixFits[i])
71  ps.add("CRVAL%1d" % (ip1,), crValDeg[i])
72  ps.add("RADECSYS", "ICRS")
73  ps.add("EQUINOX", 2000)
74  for k,v in self._cdMatrix.items() + kargs.items():
75  ps.add(k, v)
76  return afwImage.makeWcs(ps)
Wcs::Ptr makeWcs(coord::Coord const &crval, geom::Point2D const &crpix, double CD11, double CD12, double CD21, double CD22)
Create a Wcs object from crval, crpix, CD, using CD elements (useful from python) ...
Definition: makeWcs.cc:141
Class for storing generic metadata.
Definition: PropertySet.h:82

Member Data Documentation

lsst.skymap.detail.wcsFactory.WcsFactory._cdMatrix
private

Definition at line 48 of file wcsFactory.py.

lsst.skymap.detail.wcsFactory.WcsFactory._ctypes
private

Definition at line 53 of file wcsFactory.py.

lsst.skymap.detail.wcsFactory.WcsFactory._pixelScaleDeg
private

Definition at line 43 of file wcsFactory.py.

lsst.skymap.detail.wcsFactory.WcsFactory._projection
private

Definition at line 44 of file wcsFactory.py.

lsst.skymap.detail.wcsFactory.WcsFactory._rotation
private

Definition at line 45 of file wcsFactory.py.


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