RectPartition.cell_sizes_vecs¶
- property RectPartition.cell_sizes_vecs¶
Return the cell sizes as coordinate vectors.
- Returns:
- csizestuple of
numpy.ndarray
's The cell sizes per axis. The length of the vectors is the same as the corresponding
grid.coord_vectors
. For axes with 1 grid point, cell size is set to 0.0.
- csizestuple of
Examples
We create a partition of the rectangle [0, 1] x [-1, 2] into 2 x 3 cells with the grid points [0, 1] x [-1, 0, 2]. This implies that the cell boundaries are given as [0, 0.5, 1] x [-1, -0.5, 1, 2], hence the cell size vectors are [0.5, 0.5] x [0.5, 1.5, 1]:
>>> rect = odl.IntervalProd([0, -1], [1, 2]) >>> grid = odl.RectGrid([0, 1], [-1, 0, 2]) >>> part = odl.RectPartition(rect, grid) >>> part.cell_boundary_vecs (array([ 0. , 0.5, 1. ]), array([-1. , -0.5, 1. , 2. ])) >>> part.cell_sizes_vecs (array([ 0.5, 0.5]), array([ 0.5, 1.5, 1. ]))