UniformGrid¶
- class lsst.cell_coadds.UniformGrid(cell_size: Extent2I, shape: Index2D, *, padding: int = 0, min: Point2I | None = None)¶
- Bases: - object- A 2-dimensional integer grid. - Parameters:
- cell_sizelsst.geom.Extent2I
- The size of each interior grid cell. 
- shapelsst.skymap.Index2D
- The number of cells in the grid in each dimension. 
- paddingint, optional
- The number of pixels to pad the grid in each dimension. 
- minlsst.geom.Point2Ior None, optional
- The minimum (lower left) corner of the interior grid, excluding - padding. If- None, the minimum corner is set to be (0, 0).
 
- cell_size
 - Attributes Summary - Methods Summary - bbox_of(index)- Bounding box of the cell at the given index. - from_bbox_cell_size(bbox, cell_size[, padding])- Generate a UniformGrid instance from a bounding box and a cell size. - from_bbox_shape(bbox, shape[, padding])- Generate a UniformGrid instance from a bounding box and a shape. - get_bbox()- index(position)- Index of the cell that contains the given point. - min_of(index)- Minimum point of a single cell's bounding box. - Attributes Documentation - bbox¶
 - bbox_with_padding¶
 - cell_size¶
 - padding¶
 - shape¶
 - Methods Documentation - bbox_of(index: Index2D) Box2I¶
- Bounding box of the cell at the given index. - Parameters:
- indexIndex2D
- A 2D index of the cell. 
 
- index
- Returns:
- bboxlsst.geom.Box2I
- The bounding box of the cell. 
 
- bbox
 
 - classmethod from_bbox_cell_size(bbox: Box2I, cell_size: Extent2I, padding: int = 0) UniformGrid¶
- Generate a UniformGrid instance from a bounding box and a cell size. - Parameters:
- bboxlsst.geom.Box2I
- Bounding box of the full grid (without including - padding).
- cell_sizelsst.geom.Extent2I
- Size of each interior grid cell. Must divide the - bboxwidth and height evenly.
- paddingint, optional
- The number of pixels to pad the grid in each dimension. 
 
- bbox
- Returns:
- gridUniformGrid
- A new UniformGrid instance. 
 
- grid
- Raises:
- IndexError
- Raised if - cell_sizedimensions do not divide the- bboxdimensions evenly.
 
 
 - classmethod from_bbox_shape(bbox: Box2I, shape: Index2D, padding: int = 0) UniformGrid¶
- Generate a UniformGrid instance from a bounding box and a shape. - Parameters:
- bboxlsst.geom.Box2I
- Bounding box of the full grid (without including - padding).
- shapelsst.skymap.Index2D
- Number of cells in the grid in each dimension. Must divide the - bboxwidth and height evenly.
- paddingint, optional
- The number of pixels to pad the grid in each dimension. 
 
- bbox
- Returns:
- gridUniformGrid
- A new UniformGrid instance. 
 
- grid
- Raises:
- LengthError
- Raised if - shapedimensions do not divide the- bboxdimensions evenly.
 
 
 - index(position: Point2I) Index2D¶
- Index of the cell that contains the given point. - Parameters:
- positionlsst.geom.Point2I
- A point in the grid. 
 
- position
- Returns:
- indexlsst.skymap.Index2D
- A 2D index of the cell containing - position.
 
- index
- Raises:
- ValueError
- Raised if - positionis not within the grid’s bounding box including the padding.
 
 
 - min_of(index: Index2D) Point2I¶
- Minimum point of a single cell’s bounding box. - Parameters:
- indexIndex2D
- A 2D index of the cell. 
 
- index
- Returns:
- pointlsst.geom.Point2I
- The minimum point of the cell’s bounding box. 
 
- point