CellGrid#

pydantic model lsst.images.cells.CellGrid#

A grid of rectangular cells with no overlaps or space between cells.

Notes

A cell grid usually corresponds to a full patch, but we do not explicitly encode this in the type to permit full-tract grids, which would have to drop the cells in patch overlap regions and re-label all cells.

Subsets of grids are usually represented via CellGridBounds.

Parameters:

data (Any)

Fields:
field bbox: Box [Required]#

Bounding box of the grid of cells (snapped to cell boundaries. The cell with index (i=0, j=0) always has a corner at (y=bbox.y.min, x=bbox.x.min) but there is no expectation that (y=bbox.y.min, x=bbox.x.min) be (y=0, x=0).

field cell_shape: SerializableYX[int] [Required]#

Shape of each cell in pixels.

Constraints:
  • get_pydantic_core_schema = <bound method YX.__get_pydantic_core_schema__ of <class ‘lsst.images._geom.YX’>>

bbox_of(cell)#

Return the bounding box of the given cell.

Parameters:

cell (CellIJ) – Index of the cell whose bounding box is returned.

Return type:

Box

static from_legacy(legacy)#

Construct from a legacy lsst.cell_coadds.UniformGrid object.

Parameters:

legacy (TypeAliasType) – Legacy grid to convert.

Return type:

CellGrid

index_of(*, y, x)#

Return the 2-d index of the cell that contains the given pixel.

Parameters:
  • y (int) – Y cell index.

  • x (int) – X cell index.

Return type:

CellIJ

to_legacy()#

Convert to a legacy lsst.cell_coadds.UniformGrid object.

Return type:

TypeAliasType

property grid_size: CellIJ#

The number of cells in each dimension (CellIJ).

This page was last modified on .