Thanks for your answer John
I have to define sl_right, sl_center :global name 'sl_right' is not defined

I'm not really sure how to do it. I want to do something like these:

vx = data["gas", "velocity_x"][sl_right,sl_center,sl_center]
vx+= data["gas", "velocity_x"][sl_center,sl_right,sl_center]

add the x velocity of 6 neighbour cells.


2014-12-19 13:31 GMT-03:00 John ZuHone <>:

Presuming that you have sl_right and sl_center defined in your field already, you should be able to just substitute “gas” for ftype, since the velocity fields are “gas" fields.



> On Dec 19, 2014, at 11:04 AM, José Utreras <> wrote:
> Hi everyone,
> I want to write a new field based on the neighbour cells like this:
> vx = data[ftype, "velocity_x"][sl_right,sl_center,sl_center]
> but I got " global name 'ftype' is not defined". I suppose that I have the same problem with sl_left, sl_right , sl_center.
> Thanks,
> Jose
> _______________________________________________
> yt-users mailing list

yt-users mailing list