RectPartition.boundary_cell_fractions¶
-
property
RectPartition.
boundary_cell_fractions
¶ Return a tuple of contained fractions of boundary cells.
Since the outermost grid points can have any distance to the boundary of the partitioned set, the “natural” outermost cell around these points can either be cropped or extended. This property is a tuple of (float, float) tuples, one entry per dimension, where the fractions of the left- and rightmost cells inside the set are stored. If a grid point lies exactly on the boundary, the value is 1/2 since the cell is cut in half. Otherwise, any value larger than 1/2 is possible.
- Returns
- on_bdrytuple of 2-tuples of floats
Each 2-tuple contains the fraction of the leftmost (first entry) and rightmost (second entry) cell in the partitioned set in the corresponding dimension.
See also
Examples
We create a partition of the rectangle [0, 1.5] x [-2, 2] with the grid points [0, 1] x [-1, 0, 2]. The “natural” cells at the boundary would be:
[-0.5, 0.5] and [0.5, 1.5] in the first axis
[-1.5, -0.5] and [1, 3] in the second axis
Thus, in the first axis, the fractions contained in [0, 1.5] are 0.5 and 1, and in the second axis, [-2, 2] contains the fractions 1.5 and 0.5.
>>> rect = odl.IntervalProd([0, -2], [1.5, 2]) >>> grid = odl.RectGrid([0, 1], [-1, 0, 2]) >>> part = odl.RectPartition(rect, grid) >>> part.boundary_cell_fractions ((0.5, 1.0), (1.5, 0.5))