[yt-users] Potential problem with the field_parameters dictionary in SlicePlot (and certainly others)

Antoine Strugarek strugarek at ASTRO.UMontreal.CA
Wed Sep 3 09:45:30 PDT 2014


Hi Matthew,

Thank you for the quick answer. I’m on 3.0 (obtained with yt.__version__).

I’m not completely sure how to fix this since I’m discovering the code, but I’m suspecting something strange there. To my understanding, the field_parameters dictionary given in argument to SlicePlot should be used for derived fields only, and the center keyword to specify the location where the Slice should be taken, right?
Also, if I specify in advance the center (doing ad = ds.all_data() ; ad.set_field_parameter("center", custom_center)), this new center does not seem to be used in the SlicePlot to compute, e.g., the cylindrical radius (in this latter case I try to do a SlicePlot without giving a field_parameters dictionary in argument).

Antoine


Le 2014-09-03 à 12:27 , Matthew Turk <matthewturk at gmail.com> a écrit :

> Hi Antoine,
> 
> Thanks for reporting this!  Which version of the code are you on?  "yt
> instinfo" should be able to tell you this.
> 
> -Matt
> 
> On Wed, Sep 3, 2014 at 11:08 AM, Antoine Strugarek
> <strugarek at astro.umontreal.ca> wrote:
>> Hi,
>> 
>> I’ve been trying to specify by hand the ‘center’ entry of the dictionary field_parameters to a SlicePlot so that the derived field can make use of another center to compute, e.g., cylindrical coordinates. After tracking why my specified center had no effect, I noticed that the function _set_center is called when a SlicePlot is created, and this function erases any ‘center’ entry in the field_parameters dictionary, putting there the ‘center’ keyword specified as an argument to SlicePlot. It appears to me this should not be the normal behaviour, but I may be misunderstanding something. I would naively suggest not to update the ‘field_parameters’ dictionary in the _set_center function, though I’m not completely sure?
>> 
>> Thanks in advance for your help and suggestion about this issue!
>> 
>> Antoine
>> _______________________________________________
>> yt-users mailing list
>> 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