find_point function with EnzoDataset
Hi yt-users, I am trying to use the find_point() function as described as a low-level data inspection example here http://yt-project.org/doc/examining/low_level_inspection.html#finding-data-a.... However, when I try the given example, I get this error:
gs,gi=ds.find_point((0.5, 0.5, 0.5)) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'EnzoDataset' object has no attribute 'find_point'
If this function doesn't work with an EnzoDataset, what does it work with? I am ultimately trying to find the highest AMR level at a given point. Cheers, Carla Bernhardt PhD Student ZAH Institut für Theoretische Astrophysik Universität Heidelberg
Hi Carla, First, apologies for the frustration. You've run across a place in the docs that is out of date and unfortunately contains incorrect information due to an API change a while ago. In the best of all possible worlds our docs would always be up-to-date. Unfortunately sometimes stuff slips through the cracks. Thanks so much for reporting the issue, which will ensure that it gets fixed for future users of the library. Here is a code snippet that does what you want: point = ds.point(coord) max_amr_level = point['grid_level'] Coord must be either a YTArray or a 3-element iterable. If it's not a YTArray then the point is assumed to be in code units. I've filed an issue here to mark that the documentation you ran into is out of date, it will be updated by the next release: https://github.com/yt-project/yt/issues/1455 -Nathan On Fri, Jun 16, 2017 at 3:37 AM, Carla Bernhardt < carla.j.bernhardt@gmail.com> wrote:
Hi yt-users,
I am trying to use the find_point() function as described as a low-level data inspection example here http://yt-project.org/doc/examining/low_level_inspection.html#finding-data-a.... However, when I try the given example, I get this error:
gs,gi=ds.find_point((0.5, 0.5, 0.5)) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'EnzoDataset' object has no attribute 'find_point'
If this function doesn't work with an EnzoDataset, what does it work with? I am ultimately trying to find the highest AMR level at a given point.
Cheers, Carla Bernhardt PhD Student ZAH Institut für Theoretische Astrophysik Universität Heidelberg
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi Nathan,
Thank you for the solution! That is just what I was looking for.
Cheers,
Carla
2017-06-16 14:59 GMT+02:00 Nathan Goldbaum
Hi Carla,
First, apologies for the frustration. You've run across a place in the docs that is out of date and unfortunately contains incorrect information due to an API change a while ago. In the best of all possible worlds our docs would always be up-to-date. Unfortunately sometimes stuff slips through the cracks. Thanks so much for reporting the issue, which will ensure that it gets fixed for future users of the library.
Here is a code snippet that does what you want:
point = ds.point(coord) max_amr_level = point['grid_level']
Coord must be either a YTArray or a 3-element iterable. If it's not a YTArray then the point is assumed to be in code units.
I've filed an issue here to mark that the documentation you ran into is out of date, it will be updated by the next release:
https://github.com/yt-project/yt/issues/1455
-Nathan
On Fri, Jun 16, 2017 at 3:37 AM, Carla Bernhardt < carla.j.bernhardt@gmail.com> wrote:
Hi yt-users,
I am trying to use the find_point() function as described as a low-level data inspection example here http://yt-project.org/doc/examining/low_level_inspection.html#finding-data-a.... However, when I try the given example, I get this error:
gs,gi=ds.find_point((0.5, 0.5, 0.5)) Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'EnzoDataset' object has no attribute 'find_point'
If this function doesn't work with an EnzoDataset, what does it work with? I am ultimately trying to find the highest AMR level at a given point.
Cheers, Carla Bernhardt PhD Student ZAH Institut für Theoretische Astrophysik Universität Heidelberg
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (2)
-
Carla Bernhardt
-
Nathan Goldbaum