[yt-users] slice: quick question
Britton Smith
brittonsmith at gmail.com
Fri Aug 5 09:07:59 PDT 2011
Hi Elizabeth,
I'm not sure this is a part of your confusion, but slice in this context is
a Python native datatype taking a subset of an array. To see what's going
on, you can do something like this:
import numpy as na
q = na.arange(10)
sl_left = slice(None, -2, None)
sl_right = slice(1, -1, None)
print q[sl_left]
print q[sl_right]
The differences in sl_right for the two hydro methods is correcting for
cell/face-centered issue.
Britton
On Fri, Aug 5, 2011 at 9:52 AM, Elizabeth Tasker <taskere at mcmaster.ca>wrote:
> Hi,
>
> Simple question, I think. In the definition of divV:
>
> http://yt.enzotools.org/doc/**reference/field_list.html#divv<http://yt.enzotools.org/doc/reference/field_list.html#divv>
>
> How is the call for slice working:
>
> sl_left = slice(None,-2,None)
> sl_right = slice(2,None,None)
>
>
> and for Zeus:
>
> sl_left = slice(None,-2,None)
> sl_right = slice(1,-1,None)
>
>
> The documentation says the arguments should be axis & co-ordinate and then
> some options.
>
> I have failed to work out the syntax based on what I know the result must
> be!
>
> Thank you~
>
> Elizabeth
> ______________________________**_________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/**listinfo.cgi/yt-users-**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/20110805/4ad74d73/attachment.html>
More information about the yt-users
mailing list