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

Chris Malone chris.m.malone at gmail.com
Wed Sep 3 10:05:25 PDT 2014


Hi Antoine,

As you hinted, the field_parameters dictionary is mainly used for derived
fields and defaults to the center of the domain.  For a SlicePlot (and
others), the keyword variable 'center' is actually what determines where in
the domain the slice should be taken - it is completely independent of the
field_parameters['center'] value.

Hope that helps.

Chris


On Wed, Sep 3, 2014 at 10:45 AM, Antoine Strugarek <
strugarek at astro.umontreal.ca> wrote:

> 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
>
> _______________________________________________
> 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/20140903/52fbfaf5/attachment.html>


More information about the yt-users mailing list