<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><div dir="ltr">Thanks for your answer John<br>I have to define  sl_right, <span class="">sl_center</span> :global name 'sl_right' is not defined<br><span class=""></span><div><br></div><div>I'm not really sure how to do it. I want to do something like these:<br></div><div><br>vx = data["gas", "velocity_x"][sl_right,sl_center,sl_center]<br>vx+= data["gas", "velocity_x"][sl_center,sl_right,sl_center]<br>...<br><br></div><div>add the x velocity of 6 neighbour cells.<br><br></div><div>Thanks<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-12-19 13:31 GMT-03:00 John ZuHone <span dir="ltr"><<a href="mailto:jzuhone@gmail.com" target="_blank">jzuhone@gmail.com</a>></span>:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Jose,<br>
<br>
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.<br>
<br>
Best,<br>
<br>
John<br>
<div><div class="h5"><br>
> On Dec 19, 2014, at 11:04 AM, José Utreras <<a href="mailto:jutreras@das.uchile.cl">jutreras@das.uchile.cl</a>> wrote:<br>
><br>
> Hi everyone,<br>
><br>
> I want to write a new field based on the neighbour cells like this:<br>
><br>
> vx = data[ftype, "velocity_x"][sl_right,sl_center,sl_center]<br>
><br>
> but I got " global name 'ftype' is not defined". I suppose that I have the same problem with sl_left, sl_right , sl_center.<br>
><br>
> Thanks,<br>
><br>
> Jose<br>
</div></div>> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</blockquote></div></div>