TractInfo¶
- class lsst.skymap.TractInfo(id, tractBuilder, ctrCoord, vertexCoordList, tractOverlap, wcs, innerBoxCorners=None)¶
Bases:
object
Information about a tract in a SkyMap sky pixelization
- Parameters:
- id
int
tract ID
- tractBuilderSubclass of
lsst.skymap.BaseTractBuilder
Object used to compute patch geometry.
- ctrCoord
lsst.geom.SpherePoint
ICRS sky coordinate of center of inner region of tract; also used as the CRVAL for the WCS.
- vertexCoordList
list
oflsst.geom.SpherePoint
Vertices that define the boundaries of the inner region.
- tractOverlap
lsst.geom.Angle
Minimum overlap between adjacent sky tracts; this defines the minimum distance the tract extends beyond the inner region in all directions.
- wcs
lsst.afw.image.SkyWcs
WCS for tract. The reference pixel will be shifted as required so that the lower left-hand pixel (index 0,0) has pixel position 0.0, 0.0.
- innerBoxCorners
list
[lsst.sphgeom.LonLat
], optional If set then the
inner_sky_region
will be alsst.sphgeom.Box
with these corners as opposed to alsst.sphgeom.ConvexPolygon
built from thevertex_list
.
- id
Notes
The tract is subdivided into rectangular patches. Each patch has the following properties:
An inner region defined by an inner bounding box. The inner regions of the patches exactly tile the tract, and all inner regions have the same dimensions. The tract is made larger as required to make this work.
An outer region defined by an outer bounding box. The outer region extends beyond the inner region by patchBorder pixels in all directions, except there is no border at the edges of the tract. Thus patches overlap each other but never extend off the tract. If you do not want any overlap between adjacent patches then set patchBorder to 0.
An index that consists of a pair of integers:
0 <= x index < numPatches[0]
0 <= y index < numPatches[1]
Patch 0,0 is at the minimum corner of the tract bounding box.
It is not enforced that ctrCoord is the center of vertexCoordList, but SkyMap relies on it.
Attributes Summary
Get bounding box of tract (as an geom.Box2I)
Get ICRS sky coordinate of center of tract (as an lsst.geom.SpherePoint)
Get inner on-sky region as a sphgeom.ConvexPolygon.
Get inner on-sky region.
Get the number of patches in x, y.
Get outer on-sky region as a sphgeom.ConvexPolygon
Get dimensions of inner region of the patches (all are the same)
Get ID of tract
Get minimum overlap of adjacent sky tracts.
Get list of ICRS sky coordinates of vertices that define the boundary of the inner region.
Get WCS of tract.
Methods Summary
contains
(coord)Does this tract contain the coordinate?
findPatch
(coord)Find the patch containing the specified coord.
findPatchList
(coordList)Find patches containing the specified list of coords.
getBBox
()Get bounding box of tract (as an geom.Box2I)
Get ICRS sky coordinate of center of tract (as an lsst.geom.SpherePoint)
getId
()Get ID of tract
Get inner on-sky region as a sphgeom.ConvexPolygon.
Get inner on-sky region.
Get the number of patches in x, y.
Get outer on-sky region as a sphgeom.ConvexPolygon
getPatchIndexPair
(sequentialIndex)Convert sequential index into patch index (x,y) pair.
getPatchInfo
(index)Return information for the specified patch.
Get dimensions of inner region of the patches (all are the same)
getSequentialPatchIndex
(patchInfo)Return a single integer that uniquely identifies the given patch within this tract.
Return a single integer that uniquely identifies the patch index within the tract.
Get minimum overlap of adjacent sky tracts.
Get list of ICRS sky coordinates of vertices that define the boundary of the inner region.
getWcs
()Get WCS of tract.
Attributes Documentation
- bbox¶
Get bounding box of tract (as an geom.Box2I)
- ctr_coord¶
Get ICRS sky coordinate of center of tract (as an lsst.geom.SpherePoint)
- inner_sky_polygon¶
Get inner on-sky region as a sphgeom.ConvexPolygon.
Deprecated since version 28: getInnerSkyPolygon()/inner_sky_polygon has been deprecated in favor of inner_sky_region, and will be removed after v28.
- inner_sky_region¶
Get inner on-sky region.
- num_patches¶
Get the number of patches in x, y.
- Returns:
- result
lsst.skymap.Index2D
The number of patches in x, y
- result
- outer_sky_polygon¶
Get outer on-sky region as a sphgeom.ConvexPolygon
- patch_border¶
- patch_inner_dimensions¶
Get dimensions of inner region of the patches (all are the same)
- tract_id¶
Get ID of tract
- tract_overlap¶
Get minimum overlap of adjacent sky tracts.
- vertex_list¶
Get list of ICRS sky coordinates of vertices that define the boundary of the inner region.
Notes
warning: this is not a deep copy.
- wcs¶
Get WCS of tract.
- Returns:
- wcs
lsst.afw.geom.SkyWcs
The WCS of this tract
- wcs
Methods Documentation
- contains(coord)¶
Does this tract contain the coordinate?
- findPatch(coord)¶
Find the patch containing the specified coord.
- Parameters:
- coord
lsst.geom.SpherePoint
ICRS sky coordinate to search for.
- coord
- Returns:
- result
lsst.skymap.PatchInfo
PatchInfo of patch whose inner bbox contains the specified coord
- result
- Raises:
- LookupError
Raised if coord is not in tract or we cannot determine the pixel coordinate (which likely means the coord is off the tract).
- findPatchList(coordList)¶
Find patches containing the specified list of coords.
- Parameters:
- coordList
list
oflsst.geom.SpherePoint
ICRS sky coordinates to search for.
- coordList
- Returns:
- result
list
oflsst.skymap.PatchInfo
List of PatchInfo for patches that contain, or may contain, the specified region. The list will be empty if there is no overlap.
- result
Notes
Warning:
This may give incorrect answers on regions that are larger than a tract.
This uses a naive algorithm that may find some patches that do not overlap the region (especially if the region is not a rectangle aligned along patch x,y).
- getBBox()¶
Get bounding box of tract (as an geom.Box2I)
- getCtrCoord()¶
Get ICRS sky coordinate of center of tract (as an lsst.geom.SpherePoint)
- getId()¶
Get ID of tract
- getInnerSkyPolygon()¶
Get inner on-sky region as a sphgeom.ConvexPolygon.
Deprecated since version 28: getInnerSkyPolygon()/inner_sky_polygon has been deprecated in favor of inner_sky_region, and will be removed after v28.
- getInnerSkyRegion()¶
Get inner on-sky region.
- getNumPatches()¶
Get the number of patches in x, y.
- Returns:
- result
lsst.skymap.Index2D
The number of patches in x, y
- result
- getOuterSkyPolygon()¶
Get outer on-sky region as a sphgeom.ConvexPolygon
- getPatchBorder()¶
- getPatchIndexPair(sequentialIndex)¶
Convert sequential index into patch index (x,y) pair.
- Parameters:
- sequentialIndex
int
- sequentialIndex
- Returns:
- getPatchInfo(index)¶
Return information for the specified patch.
- Parameters:
- index
typing.NamedTuple
[‘x’:int
, ‘y’:int
] Index of patch, as a pair of ints; or a sequential index as returned by getSequentialPatchIndex; negative values are not supported.
- index
- Returns:
- result
lsst.skymap.PatchInfo
The patch info for that index.
- result
- Raises:
- IndexError
Raised if index is out of range.
- getPatchInnerDimensions()¶
Get dimensions of inner region of the patches (all are the same)
- getSequentialPatchIndex(patchInfo)¶
Return a single integer that uniquely identifies the given patch within this tract.
- Parameters:
- patchInfo
lsst.skymap.PatchInfo
- patchInfo
- Returns:
- sequentialIndex
int
- sequentialIndex
- getSequentialPatchIndexFromPair(index)¶
Return a single integer that uniquely identifies the patch index within the tract.
- Parameters:
- index
lsst.skymap.Index2D
- index
- Returns:
- sequentialIndex
int
- sequentialIndex
- getTractOverlap()¶
Get minimum overlap of adjacent sky tracts.
- getVertexList()¶
Get list of ICRS sky coordinates of vertices that define the boundary of the inner region.
Notes
warning: this is not a deep copy.
- getWcs()¶
Get WCS of tract.
- Returns:
- wcs
lsst.afw.geom.SkyWcs
The WCS of this tract
- wcs