[yt-users] Pressure/temperature gradient field

Suoqing Ji suoqing at physics.ucsb.edu
Mon Jul 20 15:03:28 PDT 2015


Hi Yuan,

Unfortunately I can not reproduce this error with either yt 2.6 or yt 3… If you did not mind, could you provide your script and dataset (or send me offline) so I can take a quick look at it?

Best wishes,
--
Suoqing JI
Ph.D Candidate
Department of Physics
University of California, Santa Barbara
http://web.physics.ucsb.edu/~suoqing

> On Jul 20, 2015, at 2:29 PM, Yuan Li <bear0980 at gmail.com> wrote:
> 
> Hi Suoqing,
> 
> I added validators=[ValidateSpatial(1, ["Pressure"])]
> 
> Now the error message is
> ValueError: could not broadcast input array from shape (64,64,66) into shape (64,64,64)
> 
> Yuan
> 
> On Sun, Jul 19, 2015 at 6:25 PM, Suoqing Ji <suoqing at physics.ucsb.edu <mailto:suoqing at physics.ucsb.edu>> wrote:
> Hi Yuan,
> 
> Just to check, have you included the “ValidateSpatial" object when adding the field? See the definition of DivV field: http://yt-project.org/docs/2.6/analyzing/creating_derived_fields.html#some-more-complicated-examples <http://yt-project.org/docs/2.6/analyzing/creating_derived_fields.html#some-more-complicated-examples>
> 
> Best wishes,
> --
> Suoqing JI
> Ph.D Candidate
> Department of Physics
> University of California, Santa Barbara
> http://web.physics.ucsb.edu/~suoqing <http://web.physics.ucsb.edu/~suoqing>
>> On Jul 19, 2015, at 2:52 PM, Yuan Li <yuan at astro.columbia.edu <mailto:yuan at astro.columbia.edu>> wrote:
>> 
>> Dear all,
>> 
>> I am using yt2.6. I was trying to define a field of the temperature gradient like gradPressureX, but I got an error message:
>> ...
>> new_field[1:-1,1:-1,1:-1]  = data["Temperature"][sl_right,1:-1,1:-1]/ds
>> ValueError: could not broadcast input array from shape (62,62,64) into shape (62,62,62)
>> 
>> I then tried to re-define gradPressureX by copying the original definition (http://yt-project.org/docs/2.6/reference/field_list.html#gradpressurex <http://yt-project.org/docs/2.6/reference/field_list.html#gradpressurex>) and giving it a different name, and I got the same error. The original gradPressureX works fine. 
>> 
>> Is it because I did not load some specific module or something?
>> 
>> 
>> Thank you!
>> Yuan
>> _______________________________________________
>> 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 <http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
> 
> 
> _______________________________________________
> 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 <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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20150720/d7ba70b3/attachment.htm>


More information about the yt-users mailing list