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 | Static Public Attributes | Private Attributes | Static Private Attributes | List of all members
lsst.skymap.ringsSkyMap.RingsSkyMap Class Reference
Inheritance diagram for lsst.skymap.ringsSkyMap.RingsSkyMap:

Public Member Functions

def __init__
 
def getRingIndices
 
def generateTract
 

Static Public Attributes

 ConfigClass = RingsSkyMapConfig
 

Private Attributes

 _ringSize
 
 _ringNums
 

Static Private Attributes

tuple _version = (1, 0)
 

Detailed Description

Rings sky map pixelization.

We divide the sphere into N rings of Declination, plus the two polar
caps, which sets the size of the individual tracts.  The rings are
divided in RA into an integral number of tracts of this size; this
division is made at the Declination closest to zero so as to ensure
full overlap.

Definition at line 40 of file ringsSkyMap.py.

Constructor & Destructor Documentation

def lsst.skymap.ringsSkyMap.RingsSkyMap.__init__ (   self,
  config,
  version = 0 
)
Constructor

@param[in] config: an instance of self.ConfigClass; if None the default config is used
@param[in] version: software version of this class, to retain compatibility with old instances

Definition at line 52 of file ringsSkyMap.py.

52 
53  def __init__(self, config, version=0):
54  """Constructor
55 
56  @param[in] config: an instance of self.ConfigClass; if None the default config is used
57  @param[in] version: software version of this class, to retain compatibility with old instances
58  """
59  # We count rings from south to north
60  # Note: pole caps together count for one additional ring
61  self._ringSize = math.pi / (config.numRings + 1) # Size of a ring in Declination (radians)
62  self._ringNums = [] # Number of tracts for each ring
63  for i in range(config.numRings):
64  startDec = self._ringSize*(i + 0.5) - 0.5*math.pi
65  stopDec = startDec + self._ringSize
66  dec = min(math.fabs(startDec), math.fabs(stopDec)) # Declination for determining division in RA
67  self._ringNums.append(int(2*math.pi*math.cos(dec)/self._ringSize) + 1)
68  numTracts = sum(self._ringNums) + 2
69  super(RingsSkyMap, self).__init__(numTracts, config, version)
boost::enable_if< typename ExpressionTraits< Scalar >::IsScalar, Scalar >::type sum(Scalar const &scalar)
Definition: operators.h:1250

Member Function Documentation

def lsst.skymap.ringsSkyMap.RingsSkyMap.generateTract (   self,
  index 
)
Generate the TractInfo for this index

Definition at line 91 of file ringsSkyMap.py.

91 
92  def generateTract(self, index):
93  """Generate the TractInfo for this index"""
94  ringNum, tractNum = self.getRingIndices(index)
95  if ringNum == -1: # South polar cap
96  ra, dec = 0, -0.5*math.pi
97  elif ringNum == self.config.numRings: # North polar cap
98  ra, dec = 0, 0.5*math.pi
99  else:
100  dec = self._ringSize*(ringNum + 1) - 0.5*math.pi
101  ra = math.fmod(self.config.raStart + 2*math.pi*tractNum/self._ringNums[ringNum], 2*math.pi)
102 
103  center = IcrsCoord(ra*afwGeom.radians, dec*afwGeom.radians)
104  wcs = self._wcsFactory.makeWcs(crPixPos=afwGeom.Point2D(0,0), crValCoord=center)
105  return ExplicitTractInfo(index, self.config.patchInnerDimensions, self.config.patchBorder, center,
106  0.5*self._ringSize*afwGeom.radians, self.config.tractOverlap*afwGeom.degrees,
107  wcs)
A class to handle Icrs coordinates (inherits from Coord)
Definition: Coord.h:157
def lsst.skymap.ringsSkyMap.RingsSkyMap.getRingIndices (   self,
  index 
)
Calculate ring indices given a numerical index of a tract

The ring indices are the ring number and the tract number within
the ring.

The ring number is -1 for the south polar cap and increases to the
north.  The north polar cap has ring number = numRings.  The tract
number is zero for either of the polar caps.

Definition at line 70 of file ringsSkyMap.py.

70 
71  def getRingIndices(self, index):
72  """Calculate ring indices given a numerical index of a tract
73 
74  The ring indices are the ring number and the tract number within
75  the ring.
76 
77  The ring number is -1 for the south polar cap and increases to the
78  north. The north polar cap has ring number = numRings. The tract
79  number is zero for either of the polar caps.
80  """
81  if index == 0: # South polar cap
82  return -1, 0
83  if index == self._numTracts - 1: # North polar cap
84  return self.config.numRings, 0
85  index -= 1
86  ring = 0
87  while ring < self.config.numRings and index > self._ringNums[ring]:
88  index -= self._ringNums[ring]
89  ring += 1
90  return ring, index

Member Data Documentation

lsst.skymap.ringsSkyMap.RingsSkyMap._ringNums
private

Definition at line 61 of file ringsSkyMap.py.

lsst.skymap.ringsSkyMap.RingsSkyMap._ringSize
private

Definition at line 60 of file ringsSkyMap.py.

tuple lsst.skymap.ringsSkyMap.RingsSkyMap._version = (1, 0)
staticprivate

Definition at line 50 of file ringsSkyMap.py.

lsst.skymap.ringsSkyMap.RingsSkyMap.ConfigClass = RingsSkyMapConfig
static

Definition at line 49 of file ringsSkyMap.py.


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