[yt-users] add_ray problem

David Collins dcollins at physics.ucsd.edu
Wed Oct 20 20:11:16 PDT 2010


Alas, I tried:

dx=pf.h.get_smallest_dx()
this_ray = pf.h.ray([0.5*dx]*3,[0.5*dx, 0.5*dx, 1],'Density')

and got the same result.

d.

On Wed, Oct 20, 2010 at 7:40 PM, Britton Smith <brittonsmith at gmail.com> wrote:
> 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
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>



-- 
Sent from my Stone Tablet and carried by my Pterodactyl.



More information about the yt-users mailing list