[yt-users] slice: quick question
Elizabeth Tasker
taskere at mcmaster.ca
Fri Aug 5 09:12:12 PDT 2011
Hi Britton,
Ah, right -- I was thinking it was a call of AMRSliceBase. That helps a
lot, thanks.
Elizabeth
Britton Smith wrote:
> 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
> <mailto: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
>
> 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 <mailto: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
>
More information about the yt-users
mailing list