26 from .cachingSkyMap
import CachingSkyMap
27 from .tractInfo
import ExplicitTractInfo
29 __all__ = [
"DiscreteSkyMap"]
32 """Configuration for the DiscreteSkyMap"""
33 raList = ListField(dtype=float, default=[], doc=
"Right Ascensions of tracts (ICRS, degrees)")
34 decList = ListField(dtype=float, default=[], doc=
"Declinations of tracts (ICRS, degrees)")
35 radiusList = ListField(dtype=float, default=[], doc=
"Radii of tracts (degrees)")
38 super(DiscreteSkyMapConfig, self).
validate()
40 raise ValueError(
"Number of radii (%d) and RAs (%d) do not match" %
43 raise ValueError(
"Number of radii (%d) and Decs (%d) do not match" %
48 """Discrete sky map pixelization.
50 We put a square Tract at each of the nominated coordinates.
52 ConfigClass = DiscreteSkyMapConfig
58 @param[in] config: an instance of self.ConfigClass; if None the default config is used
59 @param[in] version: software version of this class, to retain compatibility with old instances
61 numTracts = len(config.radiusList)
62 super(DiscreteSkyMap, self).
__init__(numTracts, config, version)
65 """Generate the TractInfo for a particular index"""
66 center =
IcrsCoord(self.config.raList[index] * afwGeom.degrees,
67 self.config.decList[index] * afwGeom.degrees)
68 radius = self.config.radiusList[index]
69 wcs = self._wcsFactory.makeWcs(crPixPos=
afwGeom.Point2D(0,0), crValCoord=center)
70 return ExplicitTractInfo(index, self.config.patchInnerDimensions, self.config.patchBorder, center,
71 radius * afwGeom.degrees, self.config.tractOverlap * afwGeom.degrees, wcs)
A class to handle Icrs coordinates (inherits from Coord)