lsst.afw g47a37159df+45adbcf3d0
Loading...
Searching...
No Matches
lsst.afw.geom.testUtils.BoxGrid Class Reference

Public Member Functions

 __init__ (self, box, numColRow)
 
 numColRow (self)
 
 __getitem__ (self, indXY)
 
 __len__ (self)
 
 __iter__ (self)
 

Public Attributes

 boxClass = type(box)
 
 stopDelta = stopDelta
 
 pointClass = type(minPoint)
 

Protected Attributes

 _numColRow = tuple(int(val) for val in numColRow)
 
list _divList
 

Detailed Description

Divide a box into nx by ny sub-boxes that tile the region

The sub-boxes will be of the same type as `box` and will exactly tile `box`;
they will also all be the same size, to the extent possible (some variation
is inevitable for integer boxes that cannot be evenly divided.

Parameters
----------
box : `lsst.geom.Box2I` or `lsst.geom.Box2D`
    the box to subdivide; the boxes in the grid will be of the same type
numColRow : pair of `int`
    number of columns and rows

Definition at line 41 of file testUtils.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.afw.geom.testUtils.BoxGrid.__init__ ( self,
box,
numColRow )

Definition at line 56 of file testUtils.py.

Member Function Documentation

◆ __getitem__()

lsst.afw.geom.testUtils.BoxGrid.__getitem__ ( self,
indXY )
Return the box at the specified x,y index

Parameters
----------
indXY : pair of `ints`
    the x,y index to return

Returns
-------
subBox : `lsst.geom.Box2I` or `lsst.geom.Box2D`

Definition at line 84 of file testUtils.py.

◆ __iter__()

lsst.afw.geom.testUtils.BoxGrid.__iter__ ( self)
Return an iterator over all boxes, where column varies most quickly

Definition at line 104 of file testUtils.py.

◆ __len__()

lsst.afw.geom.testUtils.BoxGrid.__len__ ( self)

Definition at line 101 of file testUtils.py.

◆ numColRow()

lsst.afw.geom.testUtils.BoxGrid.numColRow ( self)

Definition at line 81 of file testUtils.py.

Member Data Documentation

◆ _divList

list lsst.afw.geom.testUtils.BoxGrid._divList
protected
Initial value:
= [np.linspace(start=box.getMin()[i],
stop=box.getMax()[i] + self.stopDelta,
num=self._numColRow[i] + 1,
endpoint=True,
dtype=dtype) for i in range(2)]

Definition at line 74 of file testUtils.py.

◆ _numColRow

lsst.afw.geom.testUtils.BoxGrid._numColRow = tuple(int(val) for val in numColRow)
protected

Definition at line 59 of file testUtils.py.

◆ boxClass

lsst.afw.geom.testUtils.BoxGrid.boxClass = type(box)

Definition at line 67 of file testUtils.py.

◆ pointClass

lsst.afw.geom.testUtils.BoxGrid.pointClass = type(minPoint)

Definition at line 71 of file testUtils.py.

◆ stopDelta

lsst.afw.geom.testUtils.BoxGrid.stopDelta = stopDelta

Definition at line 68 of file testUtils.py.


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