lsst.skymap ga8c6da7877+598e58846e
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
lsst.skymap.tractInfo.TractInfo Class Reference
Inheritance diagram for lsst.skymap.tractInfo.TractInfo:
lsst.skymap.healpixSkyMap.HealpixTractInfo lsst.skymap.tractInfo.ExplicitTractInfo

Public Member Functions

 __init__ (self, id, tractBuilder, ctrCoord, vertexCoordList, tractOverlap, wcs)
 
 getSequentialPatchIndex (self, patchInfo)
 
 getSequentialPatchIndexFromPair (self, index)
 
 getPatchIndexPair (self, sequentialIndex)
 
 findPatch (self, coord)
 
 findPatchList (self, coordList)
 
 getBBox (self)
 
 getCtrCoord (self)
 
 getId (self)
 
 getNumPatches (self)
 
 getPatchBorder (self)
 
 getPatchInfo (self, index)
 
 getPatchInnerDimensions (self)
 
 getTractOverlap (self)
 
 getVertexList (self)
 
 getInnerSkyPolygon (self)
 
 getOuterSkyPolygon (self)
 
 getWcs (self)
 
 __str__ (self)
 
 __repr__ (self)
 
 __iter__ (self)
 
 __len__ (self)
 
 __getitem__ (self, index)
 
 contains (self, coord)
 

Protected Member Functions

 _minimumBoundingBox (self, wcs)
 
 _finalOrientation (self, bbox, wcs)
 

Protected Attributes

 _id
 
 _ctrCoord
 
 _vertexCoordList
 
 _tractOverlap
 
 _tractBuilder
 
 _numPatches
 
 _bbox
 
 _wcs
 

Properties

 bbox = property(getBBox)
 
 ctr_coord = property(getCtrCoord)
 
 tract_id = property(getId)
 
 num_patches = property(getNumPatches)
 
 patch_border = property(getPatchBorder)
 
 patch_inner_dimensions = property(getPatchInnerDimensions)
 
 tract_overlap = property(getTractOverlap)
 
 vertex_list = property(getVertexList)
 
 inner_sky_polygon = property(getInnerSkyPolygon)
 
 outer_sky_polygon = property(getOuterSkyPolygon)
 
 wcs = property(getWcs)
 

Detailed Description

Information about a tract in a SkyMap sky pixelization

Parameters
----------
id : `int`
    tract ID
tractBuilder : Subclass 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` of `lsst.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.

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.

Definition at line 34 of file tractInfo.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.skymap.tractInfo.TractInfo.__init__ ( self,
id,
tractBuilder,
ctrCoord,
vertexCoordList,
tractOverlap,
wcs )

Member Function Documentation

◆ __getitem__()

lsst.skymap.tractInfo.TractInfo.__getitem__ ( self,
index )

Definition at line 394 of file tractInfo.py.

◆ __iter__()

lsst.skymap.tractInfo.TractInfo.__iter__ ( self)

Definition at line 384 of file tractInfo.py.

◆ __len__()

lsst.skymap.tractInfo.TractInfo.__len__ ( self)

Definition at line 390 of file tractInfo.py.

◆ __repr__()

lsst.skymap.tractInfo.TractInfo.__repr__ ( self)

Definition at line 381 of file tractInfo.py.

◆ __str__()

lsst.skymap.tractInfo.TractInfo.__str__ ( self)

Definition at line 378 of file tractInfo.py.

◆ _finalOrientation()

lsst.skymap.tractInfo.TractInfo._finalOrientation ( self,
bbox,
wcs )
protected
Determine the final orientation

We offset everything so the lower-left corner is at 0,0
and compute the final Wcs.

Parameters
----------
bbox : `lsst.geom.Box2I`
    Current bounding box.
wcs : `lsst.afw.geom.SkyWcs
    Current Wcs.

Returns
-------
finalBBox : `lsst.geom.Box2I`
    Revised bounding box.
wcs : `lsst.afw.geom.SkyWcs`
    Revised Wcs.

Definition at line 117 of file tractInfo.py.

◆ _minimumBoundingBox()

lsst.skymap.tractInfo.TractInfo._minimumBoundingBox ( self,
wcs )
protected
Calculate the minimum bounding box for the tract, given the WCS.

The bounding box is created in the frame of the supplied WCS,
so that it's OK if the coordinates are negative.

We compute the bounding box that holds all the vertices and the
desired overlap.

Reimplemented in lsst.skymap.tractInfo.ExplicitTractInfo.

Definition at line 93 of file tractInfo.py.

◆ contains()

lsst.skymap.tractInfo.TractInfo.contains ( self,
coord )
Does this tract contain the coordinate?

Definition at line 397 of file tractInfo.py.

◆ findPatch()

lsst.skymap.tractInfo.TractInfo.findPatch ( self,
coord )
Find the patch containing the specified coord.

Parameters
----------
coord : `lsst.geom.SpherePoint`
    ICRS sky coordinate to search for.

Returns
-------
result : `lsst.skymap.PatchInfo`
    PatchInfo of patch whose inner bbox contains the specified coord

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).

Definition at line 186 of file tractInfo.py.

◆ findPatchList()

lsst.skymap.tractInfo.TractInfo.findPatchList ( self,
coordList )
Find patches containing the specified list of coords.

Parameters
----------
coordList : `list` of `lsst.geom.SpherePoint`
    ICRS sky coordinates to search for.

Returns
-------
result : `list` of `lsst.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.

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).

Definition at line 218 of file tractInfo.py.

◆ getBBox()

lsst.skymap.tractInfo.TractInfo.getBBox ( self)
Get bounding box of tract (as an geom.Box2I)

Definition at line 264 of file tractInfo.py.

◆ getCtrCoord()

lsst.skymap.tractInfo.TractInfo.getCtrCoord ( self)
Get ICRS sky coordinate of center of tract
(as an lsst.geom.SpherePoint)

Definition at line 271 of file tractInfo.py.

◆ getId()

lsst.skymap.tractInfo.TractInfo.getId ( self)
Get ID of tract

Definition at line 279 of file tractInfo.py.

◆ getInnerSkyPolygon()

lsst.skymap.tractInfo.TractInfo.getInnerSkyPolygon ( self)
Get inner on-sky region as a sphgeom.ConvexPolygon.

Definition at line 351 of file tractInfo.py.

◆ getNumPatches()

lsst.skymap.tractInfo.TractInfo.getNumPatches ( self)
Get the number of patches in x, y.

Returns
-------
result : `lsst.skymap.Index2D`
    The number of patches in x, y

Definition at line 286 of file tractInfo.py.

◆ getOuterSkyPolygon()

lsst.skymap.tractInfo.TractInfo.getOuterSkyPolygon ( self)
Get outer on-sky region as a sphgeom.ConvexPolygon

Definition at line 359 of file tractInfo.py.

◆ getPatchBorder()

lsst.skymap.tractInfo.TractInfo.getPatchBorder ( self)

Definition at line 298 of file tractInfo.py.

◆ getPatchIndexPair()

lsst.skymap.tractInfo.TractInfo.getPatchIndexPair ( self,
sequentialIndex )
Convert sequential index into patch index (x,y) pair.

Parameters
----------
sequentialIndex : `int`

Returns
-------
x, y : `lsst.skymap.Index2D`

Definition at line 173 of file tractInfo.py.

◆ getPatchInfo()

lsst.skymap.tractInfo.TractInfo.getPatchInfo ( self,
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.

Returns
-------
result : `lsst.skymap.PatchInfo`
    The patch info for that index.

Raises
------
IndexError
    Raised if index is out of range.

Definition at line 303 of file tractInfo.py.

◆ getPatchInnerDimensions()

lsst.skymap.tractInfo.TractInfo.getPatchInnerDimensions ( self)
Get dimensions of inner region of the patches (all are the same)

Definition at line 325 of file tractInfo.py.

◆ getSequentialPatchIndex()

lsst.skymap.tractInfo.TractInfo.getSequentialPatchIndex ( self,
patchInfo )
Return a single integer that uniquely identifies
the given patch within this tract.

Parameters
----------
patchInfo : `lsst.skymap.PatchInfo`

Returns
-------
sequentialIndex : `int`

Definition at line 145 of file tractInfo.py.

◆ getSequentialPatchIndexFromPair()

lsst.skymap.tractInfo.TractInfo.getSequentialPatchIndexFromPair ( self,
index )
Return a single integer that uniquely identifies
the patch index within the tract.

Parameters
----------
index : `lsst.skymap.Index2D`

Returns
-------
sequentialIndex : `int`

Definition at line 159 of file tractInfo.py.

◆ getTractOverlap()

lsst.skymap.tractInfo.TractInfo.getTractOverlap ( self)
Get minimum overlap of adjacent sky tracts.

Definition at line 332 of file tractInfo.py.

◆ getVertexList()

lsst.skymap.tractInfo.TractInfo.getVertexList ( self)
Get list of ICRS sky coordinates of vertices that define the
boundary of the inner region.

Notes
-----
**warning:** this is not a deep copy.

Definition at line 339 of file tractInfo.py.

◆ getWcs()

lsst.skymap.tractInfo.TractInfo.getWcs ( self)
Get WCS of tract.

Returns
-------
wcs : `lsst.afw.geom.SkyWcs`
    The WCS of this tract

Definition at line 366 of file tractInfo.py.

Member Data Documentation

◆ _bbox

lsst.skymap.tractInfo.TractInfo._bbox
protected

Definition at line 91 of file tractInfo.py.

◆ _ctrCoord

lsst.skymap.tractInfo.TractInfo._ctrCoord
protected

Definition at line 84 of file tractInfo.py.

◆ _id

lsst.skymap.tractInfo.TractInfo._id
protected

Definition at line 83 of file tractInfo.py.

◆ _numPatches

lsst.skymap.tractInfo.TractInfo._numPatches
protected

Definition at line 90 of file tractInfo.py.

◆ _tractBuilder

lsst.skymap.tractInfo.TractInfo._tractBuilder
protected

Definition at line 87 of file tractInfo.py.

◆ _tractOverlap

lsst.skymap.tractInfo.TractInfo._tractOverlap
protected

Definition at line 86 of file tractInfo.py.

◆ _vertexCoordList

lsst.skymap.tractInfo.TractInfo._vertexCoordList
protected

Definition at line 85 of file tractInfo.py.

◆ _wcs

lsst.skymap.tractInfo.TractInfo._wcs
protected

Definition at line 91 of file tractInfo.py.

Property Documentation

◆ bbox

lsst.skymap.tractInfo.TractInfo.bbox = property(getBBox)
static

Definition at line 269 of file tractInfo.py.

◆ ctr_coord

lsst.skymap.tractInfo.TractInfo.ctr_coord = property(getCtrCoord)
static

Definition at line 277 of file tractInfo.py.

◆ inner_sky_polygon

lsst.skymap.tractInfo.TractInfo.inner_sky_polygon = property(getInnerSkyPolygon)
static

Definition at line 357 of file tractInfo.py.

◆ num_patches

lsst.skymap.tractInfo.TractInfo.num_patches = property(getNumPatches)
static

Definition at line 296 of file tractInfo.py.

◆ outer_sky_polygon

lsst.skymap.tractInfo.TractInfo.outer_sky_polygon = property(getOuterSkyPolygon)
static

Definition at line 364 of file tractInfo.py.

◆ patch_border

lsst.skymap.tractInfo.TractInfo.patch_border = property(getPatchBorder)
static

Definition at line 301 of file tractInfo.py.

◆ patch_inner_dimensions

lsst.skymap.tractInfo.TractInfo.patch_inner_dimensions = property(getPatchInnerDimensions)
static

Definition at line 330 of file tractInfo.py.

◆ tract_id

lsst.skymap.tractInfo.TractInfo.tract_id = property(getId)
static

Definition at line 284 of file tractInfo.py.

◆ tract_overlap

lsst.skymap.tractInfo.TractInfo.tract_overlap = property(getTractOverlap)
static

Definition at line 337 of file tractInfo.py.

◆ vertex_list

lsst.skymap.tractInfo.TractInfo.vertex_list = property(getVertexList)
static

Definition at line 349 of file tractInfo.py.

◆ wcs

lsst.skymap.tractInfo.TractInfo.wcs = property(getWcs)
static

Definition at line 376 of file tractInfo.py.


The documentation for this class was generated from the following file: