spacepy.pybats.qotree.QTree¶
- class spacepy.pybats.qotree.QTree(grid, blocksize=8)[source]¶
Base class for Quad/Oct tree objects assuming cell-centered grid points in a rectangular non-regular layout. QTree works for square blocks only (e.g., blocks who have the same number of points in each dimension).
The
blocksize
kwarg sets the size of the blocks. As BATS-R-US typically uses a block size of 8 (i.e., blocks are 8x8x8 points), the default value ofblocksize
is 8.- __init__(grid, blocksize=8)[source]¶
Build QO Tree for input grid. Grid should be a NxM numpy array where N is the number of dimensions and M is the number of points.
Methods
find_leaf
(x, y[, i])Recursively search for and return the index of the leaf that contains the input point x, y.
keys
()ld
(k)leftdaughter
(k)mom
(k)plot_res
(ax[, do_label, do_fill, tag_leafs, ...])rd
(k)- find_leaf(x, y, i=1)[source]¶
Recursively search for and return the index of the leaf that contains the input point x, y.
- ld(k)¶
- rd(k)¶