23__all__ = [
'HealpixSkyMapConfig',
'HealpixSkyMap']
32from .cachingSkyMap
import CachingSkyMap
33from .tractInfo
import TractInfo
37 """Convert hpgeom ang to an lsst.geom.SpherePoint
39 The angle is provided
as a single object, thetaphi, so the output
40 of hpgeom functions can be directed to this function without
41 additional translation.
43 return geom.SpherePoint(float(thetaphi[1]), float(thetaphi[0] - 0.5*numpy.pi), geom.radians)
47 """Convert an lsst.geom.SpherePoint to a hpgeom ang (theta, phi)
49 The Healpix convention is that 0 <= theta <= pi, 0 <= phi < 2pi.
51 return (coord.getLatitude().asRadians() + 0.5*numpy.pi, coord.getLongitude().asRadians())
55 """Tract for the HealpixSkyMap"""
57 def __init__(self, nSide, ident, nest, tractBuilder, ctrCoord, tractOverlap, wcs):
58 """Set vertices from nside, ident, nest"""
59 theta, phi = hpgeom.boundaries(nSide, ident, nest=nest, lonlat=
False)
60 vertexList = [
angToCoord(thetaphi)
for thetaphi
in zip(theta, phi)]
61 super(HealpixTractInfo, self).
__init__(ident, tractBuilder, ctrCoord,
62 vertexList, tractOverlap, wcs)
66 """Configuration for the HealpixSkyMap"""
67 log2NSide = Field(dtype=int, default=0, doc=
"Number of sides, expressed in powers of 2")
68 nest = Field(dtype=bool, default=
False, doc=
"Use NEST ordering instead of RING?")
75 """HEALPix-based sky map pixelization.
77 We put a Tract at the position of each HEALPixel.
83 The configuration for this SkyMap.
84 version : `int`
or `tuple` of `int` (optional)
85 Software version of this
class, to retain compatibility
with old
88 ConfigClass = HealpixSkyMapConfig
94 numTracts = hpgeom.nside_to_npixel(self.
_nside)
95 super(HealpixSkyMap, self).
__init__(numTracts, config, version)
98 """Find the tract whose inner region includes the coord.
103 ICRS sky coordinate to search for.
107 tractInfo : `TractInfo`
108 Info
for tract whose inner region includes the coord.
111 index = hpgeom.angle_to_pixel(self._nside, theta, phi, nest=self.configconfig.nest, lonlat=False)
115 """Generate TractInfo for the specified tract index."""
123 """Add subclass-specific state or configuration options to the SHA1."""
__init__(self, config, version=0)
generateTract(self, index)
__init__(self, nSide, ident, nest, tractBuilder, ctrCoord, tractOverlap, wcs)