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
35 withTractsOnPoles = pexConfig.Field(
36 doc=
"if True center a tract on each pole, else put a vertex on each pole",
50 """Dodecahedron-based sky map pixelization.
52 DodecaSkyMap divides the sky into 12 overlapping Tracts arranged as the faces of a dodecahedron.
54 ConfigClass = DodecaSkyMapConfig
58 """Construct a DodecaSkyMap
60 @param[in] config: an instance of self.ConfigClass; if None the default config is used
62 BaseSkyMap.__init__(self, config)
63 self.
_dodecahedron = detail.Dodecahedron(withFacesOnPoles=self.config.withTractsOnPoles)
65 tractOverlap = afwGeom.Angle(self.config.tractOverlap, afwGeom.degrees)
68 tractVec = self._dodecahedron.getFaceCtr(id)
69 tractCoord = detail.coordFromVec(tractVec, defRA=afwGeom.Angle(0))
70 tractRA = tractCoord.getLongitude()
71 vertexVecList = self._dodecahedron.getVertices(id)
74 wcs = self._wcsFactory.makeWcs(crPixPos=afwGeom.Point2D(0, 0), crValCoord=tractCoord)
76 self._tractInfoList.append(
79 patchInnerDimensions=self.config.patchInnerDimensions,
80 patchBorder=self.config.patchBorder,
82 vertexCoordList=[detail.coordFromVec(vec, defRA=tractRA)
for vec
in vertexVecList],
83 tractOverlap=tractOverlap,
91 @return a dict containing:
92 - version: a pair of ints
103 @param[in] stateDict: a dict containing:
104 - version: a pair of ints
107 version = stateDict[
"version"]
108 if version >= (2, 0):
109 raise runtimeError(
"Version = %s >= (2,0); cannot unpickle" % (version,))
113 """Find the tract whose inner region includes the coord.
115 @param[in] coord: sky coordinate (afwCoord.Coord)
116 @return TractInfo for tract whose inner region includes the coord.
118 @note This routine will be more efficient if coord is ICRS.
120 return self[self._dodecahedron.getFaceInd(coord.toIcrs().getVector())]
123 """Return version (e.g. for pickle)
125 @return version as a pair of integers
130 """Return withTractsOnPoles parameter
132 @return withTractsOnPoles as a bool
134 return self._dodecahedron.getWithFacesOnPoles()