24 - Consider tweaking pixel scale so the average scale is as specified, rather than the scale at the center
26 from builtins
import range
27 import lsst.pex.config
as pexConfig
28 import lsst.afw.geom
as afwGeom
30 from .baseSkyMap
import BaseSkyMap
31 from .tractInfo
import TractInfo
33 __all__ = [
'DodecaSkyMapConfig',
'DodecaSkyMap']
36 withTractsOnPoles = pexConfig.Field(
37 doc=
"if True center a tract on each pole, else put a vertex on each pole",
51 """Dodecahedron-based sky map pixelization.
53 DodecaSkyMap divides the sky into 12 overlapping Tracts arranged as the faces of a dodecahedron.
55 ConfigClass = DodecaSkyMapConfig
59 """Construct a DodecaSkyMap
61 @param[in] config: an instance of self.ConfigClass; if None the default config is used
63 BaseSkyMap.__init__(self, config)
64 self.
_dodecahedron = detail.Dodecahedron(withFacesOnPoles=self.config.withTractsOnPoles)
66 tractOverlap = afwGeom.Angle(self.config.tractOverlap, afwGeom.degrees)
69 tractVec = self._dodecahedron.getFaceCtr(id)
70 tractCoord = detail.coordFromVec(tractVec, defRA=afwGeom.Angle(0))
71 tractRA = tractCoord.getLongitude()
72 vertexVecList = self._dodecahedron.getVertices(id)
75 wcs = self._wcsFactory.makeWcs(crPixPos=afwGeom.Point2D(0, 0), crValCoord=tractCoord)
77 self._tractInfoList.append(
80 patchInnerDimensions=self.config.patchInnerDimensions,
81 patchBorder=self.config.patchBorder,
83 vertexCoordList=[detail.coordFromVec(vec, defRA=tractRA)
for vec
in vertexVecList],
84 tractOverlap=tractOverlap,
92 @return a dict containing:
93 - version: a pair of ints
104 @param[in] stateDict: a dict containing:
105 - version: a pair of ints
108 version = stateDict[
"version"]
109 if version >= (2, 0):
110 raise runtimeError(
"Version = %s >= (2,0); cannot unpickle" % (version,))
114 """Find the tract whose inner region includes the coord.
116 @param[in] coord: sky coordinate (afwCoord.Coord)
117 @return TractInfo for tract whose inner region includes the coord.
119 @note This routine will be more efficient if coord is ICRS.
121 return self[self._dodecahedron.getFaceInd(coord.toIcrs().getVector())]
124 """Return version (e.g. for pickle)
126 @return version as a pair of integers
131 """Return withTractsOnPoles parameter
133 @return withTractsOnPoles as a bool
135 return self._dodecahedron.getWithFacesOnPoles()