Using NDTAMR and retrieving a grid
Hello,
I followed along with the example and generated and refined a tree object over a 2d function. Once this is done, how can I get the grid object? The data that includes the points and values?
I tried accessing vis.convert_to_uniform(tree) but this gives me a TypeError
TypeError Traceback (most recent call last)
~\miniconda3\lib\site-packages\ndtamr\Vis.py in convert_to_uniform(tree, dims, slice_, q, func, mask, alpha_func, pad) 258 a = alpha_func(n) 259 if lvl == lmax: --> 260 result[i,j] = d 261 alpha[i,j] = a 262 mask_arr[i,j] = m
TypeError: float() argument must be a string or a number, not 'Node'
@mzajd I am having the same issue, did you ever resolve this?
No....I ended up using gnuplot and matplotlib for the visualizations I needed.
On Tue., Apr. 6, 2021, 11:39 p.m. Interfluo, @.***> wrote:
@mzajd https://github.com/mzajd I am having the same issue, did you ever resolve this?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/adamdempsey90/NDTAMR/issues/3#issuecomment-814576723, or unsubscribe https://github.com/notifications/unsubscribe-auth/AQBJX2FSAFITRCVUR7D7GQLTHPHV7ANCNFSM4PJGZNVA .
@mzajd I was able to extract the grid nodes and plot them, maybe this is helpful
`grid = vis.generate_grid(t) print("\ninitial grid points:", grid) coords = [] x = [] y = [] for i in range(len(grid)): for j in range(len(grid[i])): coords.append(grid[i][j]) x.append(grid[i][j][0]) y.append(grid[i][j][1]) print("coordinates:", coords) print("x:", x) print("y:", y)
plt.scatter(x, y, c='k', s=1) plt.show()`