yt.testing.
amrspace
(extent, levels=7, cells=8)[source]¶Creates two numpy arrays representing the left and right bounds of an AMR grid as well as an array for the AMR level of each cell.
Parameters: | extent : array-like
levels : int or sequence of ints, optional
cells : int, optional
|
---|---|
Returns: | left : float ndarray, shape=(npoints, ndims)
right : float ndarray, shape=(npoints, ndims)
level : int ndarray, shape=(npoints,)
|
Examples
>>> l, r, lvl = amrspace([0.0, 2.0, 1.0, 2.0, 0.0, 3.14], levels=(3,3,0), cells=2)
>>> print l
[[ 0. 1. 0. ]
[ 0.25 1. 0. ]
[ 0. 1.125 0. ]
[ 0.25 1.125 0. ]
[ 0.5 1. 0. ]
[ 0. 1.25 0. ]
[ 0.5 1.25 0. ]
[ 1. 1. 0. ]
[ 0. 1.5 0. ]
[ 1. 1.5 0. ]]