[yt-users] add_ray problem

Britton Smith brittonsmith at gmail.com
Wed Oct 20 19:40:09 PDT 2010


Hi Dave,

I believe the problem is that the ray travels right down cell boundaries
with ever entering any cells.  The ray tool expects the ray to go into cells
and will not interpolate between cells if it's right on the boundary.  The
divide by zero is coming from trying to calculate exactly where the ray
intersects cell boundaries in each direction.  If you move the start or end
positions just a hair in both the x and y, it should be fine.

Britton

On Wed, Oct 20, 2010 at 8:13 PM, david collins <antpuncher at gmail.com> wrote:

> Hi, all--
>
> I'm having trouble with add_ray.  I'm trying to do the following, but
> I get the error that follows the following.  I saw that Dr. Tasker
> recently did a nearly identical thing with more success.  I've tried
> it both on Triton, with the projects install at
> /projects/lca-group/bla and a trunk install on Kraken.  Any thoughts?
> It works if I use [0.0]*3 and [1.0]*3 as my endpoints.
>
> >>> this_ray = pf.h.ray([0.5]*3,[0.5,0.5,1.0],'Density')
> >>> f='x-velocity'
> >>> L = plt.plot(this_ray['x'],this_ray[f])
>
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "tmp.py", line 5, in <module>
>    L = plt.plot(this_ray['x'],this_ray[f])
>  File
> "/projects/lca-group/local-dev/lib/python2.6/site-packages/yt-2.0dev-py2.6-linux-x86_64.egg/yt/lagos/BaseDataTypes.py",
> line 249, in __getitem__
>    self.get_data(key)
>  File
> "/projects/lca-group/local-dev/lib/python2.6/site-packages/yt-2.0dev-py2.6-linux-x86_64.egg/yt/lagos/BaseDataTypes.py",
> line 424, in get_data
>    for grid in self._grids])
>  File
> "/projects/lca-group/local-dev/lib/python2.6/site-packages/yt-2.0dev-py2.6-linux-x86_64.egg/yt/lagos/BaseDataTypes.py",
> line 529, in _get_data_from_grid
>    mask = na.logical_and(self._get_cut_mask(grid),
>  File
> "/projects/lca-group/local-dev/lib/python2.6/site-packages/yt-2.0dev-py2.6-linux-x86_64.egg/yt/lagos/BaseDataTypes.py",
> line 58, in check_cache
>    cm = func(self, grid)
>  File
> "/projects/lca-group/local-dev/lib/python2.6/site-packages/yt-2.0dev-py2.6-linux-x86_64.egg/yt/lagos/BaseDataTypes.py",
> line 542, in _get_cut_mask
>    grid.dds, self.center, self.vec)
>  File "RayIntegrators.pyx", line 156, in yt.amr_utils.VoxelTraversal
> (yt/amr_utils.c:9986)
> ZeroDivisionError: float division
> >>> lagos
> <module 'yt.lagos' from
>
> '/projects/lca-group/local-dev/lib/python2.6/site-packages/yt-2.0dev-py2.6-linux-x86_64.egg/yt/lagos/__init__.pyc'>
>
> --
> Sent from my Stone Tablet and carried by my Pterodactyl.
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20101020/f77729da/attachment.htm>


More information about the yt-users mailing list