A collection of overlapping Tracts that map part or all of the sky.
See TractInfo for more information.
Parameters
----------
config : `BaseSkyMapConfig` or None (optional)
The configuration for this SkyMap; if None use the default config.
Notes
-----
BaseSkyMap is an abstract base class. Subclasses must do the following:
define ``__init__`` and have it construct the TractInfo objects and put
them in ``__tractInfoList__`` define ``__getstate__`` and ``__setstate__``
to allow pickling (the butler saves sky maps using pickle);
see DodecaSkyMap for an example of how to do this. (Most of that code could
be moved into this base class, but that would make it harder to handle
older versions of pickle data.) define updateSha1 to add any
subclass-specific state to the hash.
All SkyMap subclasses must be conceptually immutable; they must always
refer to the same set of mathematical tracts and patches even if the in-
memory representation of those objects changes.
Definition at line 75 of file baseSkyMap.py.
def lsst.skymap.baseSkyMap.BaseSkyMap.findClosestTractPatchList |
( |
|
self, |
|
|
|
coordList |
|
) |
| |
Find closest tract and patches that overlap coordinates.
Parameters
----------
coordList : `lsst.geom.SpherePoint`
List of ICRS sky coordinates to search for.
Returns
-------
retList : `list`
list of (TractInfo, list of PatchInfo) for tracts and patches
that contain, or may contain, the specified region.
The list will be empty if there is no overlap.
Definition at line 177 of file baseSkyMap.py.
177 def findClosestTractPatchList(self, coordList):
178 """Find closest tract and patches that overlap coordinates. 182 coordList : `lsst.geom.SpherePoint` 183 List of ICRS sky coordinates to search for. 188 list of (TractInfo, list of PatchInfo) for tracts and patches 189 that contain, or may contain, the specified region. 190 The list will be empty if there is no overlap. 193 for coord
in coordList:
194 tractInfo = self.findTract(coord)
195 patchList = tractInfo.findPatchList(coordList)
196 if patchList
and not (tractInfo, patchList)
in retList:
197 retList.append((tractInfo, patchList))
def lsst.skymap.baseSkyMap.BaseSkyMap.findTractPatchList |
( |
|
self, |
|
|
|
coordList |
|
) |
| |
Find tracts and patches that overlap a region.
Parameters
----------
coordList : `list` of `lsst.geom.SpherePoint`
List of ICRS sky coordinates to search for.
Returns
-------
reList : `list` of (`TractInfo`, `list` of `PatchInfo`)
For tracts and patches that contain, or may contain, the specified
region. The list will be empty if there is no overlap.
Notes
-----
**warning:**
This uses a naive algorithm that may find some tracts and patches
that do not overlap the region (especially if the region is not a
rectangle aligned along patch x, y).
Definition at line 149 of file baseSkyMap.py.
149 def findTractPatchList(self, coordList):
150 """Find tracts and patches that overlap a region. 154 coordList : `list` of `lsst.geom.SpherePoint` 155 List of ICRS sky coordinates to search for. 159 reList : `list` of (`TractInfo`, `list` of `PatchInfo`) 160 For tracts and patches that contain, or may contain, the specified 161 region. The list will be empty if there is no overlap. 166 This uses a naive algorithm that may find some tracts and patches 167 that do not overlap the region (especially if the region is not a 168 rectangle aligned along patch x, y). 171 for tractInfo
in self:
172 patchList = tractInfo.findPatchList(coordList)
174 retList.append((tractInfo, patchList))
def lsst.skymap.baseSkyMap.BaseSkyMap.register |
( |
|
self, |
|
|
|
name, |
|
|
|
registry |
|
) |
| |
Add SkyMap, Tract, and Patch Dimension entries to the given Gen3
Butler Registry.
Parameters
----------
name : `str`
The name of the skymap.
registry : `lsst.daf.butler.Registry`
The registry to add to.
Definition at line 293 of file baseSkyMap.py.
294 """Add SkyMap, Tract, and Patch Dimension entries to the given Gen3 300 The name of the skymap. 301 registry : `lsst.daf.butler.Registry` 302 The registry to add to. 306 for tractInfo
in self:
307 nx, ny = tractInfo.getNumPatches()
308 nxMax =
max(nxMax, nx)
309 nyMax =
max(nyMax, ny)
310 with registry.transaction():
311 registry.addDimensionEntry(
314 "hash": self.getSha1(),
315 "tract_max": len(self),
316 "patch_nx_max": nxMax,
317 "patch_ny_max": nyMax}
319 for tractInfo
in self:
320 region = tractInfo.getOuterSkyPolygon()
323 {
"skymap": name,
"tract": tractInfo.getId(),
325 "ra": centroid.getRa().asDegrees(),
326 "dec": centroid.getDec().asDegrees()}
328 registry.addDimensionEntry(
"tract", entry)
330 for patchInfo
in tractInfo:
331 cellX, cellY = patchInfo.getIndex()
332 patchDataIdList.append(
333 {
"skymap": name,
"tract": tractInfo.getId(),
334 "patch": tractInfo.getSequentialPatchIndex(patchInfo),
335 "cell_x": cellX,
"cell_y": cellY,
336 "region": patchInfo.getOuterSkyPolygon(tractInfo.getWcs())}
338 registry.addDimensionEntryList(
"patch", patchDataIdList)
339
lsst::geom::SpherePoint SpherePoint
◆ updateSha1()
def lsst.skymap.baseSkyMap.BaseSkyMap.updateSha1 |
( |
|
self, |
|
|
|
sha1 |
|
) |
| |
Add subclass-specific state or configuration options to the SHA1.
Parameters
----------
sha1 : `hashlib.sha1`
A hashlib object on which `update` can be called to add
additional state to the hash.
Notes
-----
This method is conceptually "protected" : it should be reimplemented by
all subclasses, but called only by the base class implementation of
`getSha1` .
Definition at line 276 of file baseSkyMap.py.
276 def updateSha1(self, sha1):
277 """Add subclass-specific state or configuration options to the SHA1. 281 sha1 : `hashlib.sha1` 282 A hashlib object on which `update` can be called to add 283 additional state to the hash. 287 This method is conceptually "protected" : it should be reimplemented by 288 all subclasses, but called only by the base class implementation of 291 raise NotImplementedError()
◆ config
lsst.skymap.baseSkyMap.BaseSkyMap.config |
◆ ConfigClass
The documentation for this class was generated from the following file:
- /j/snowflake/release/lsstsw/stack/Linux64/skymap/18.1.0/python/lsst/skymap/baseSkyMap.py