[yt-users] Annotate_contour

Matthew Turk matthewturk at gmail.com
Tue Sep 10 06:03:19 PDT 2013


Hi Seyit,

As you note, right now what the contours do is essentially take the
underlying data source, query the field to be contoured, and then
perform an interpolation on that field.  This means if you have a
weighted projection, because queries will also have the same weight,
the result will be weighted.

I've issued a pull request to enable the behavior you describe:

https://bitbucket.org/yt_analysis/yt/pull-request/595/adding-alternate-data-source-for/diff

You can test this by pulling from my repo:

cd $YT_DEST/src/yt-hg/
hg pull -r 0b52b74
hg up -r 0b52b74
python2.7 setup.py build_ext -i

Now when you call annotate_contours, you can specify data_source as an
option.  You can specify a projection you have created by hand, or a
slice, or whatever is most appropriate.

The repository is in a bit of a state at the moment and we're waiting
on bitbucket support, so there may be a holdup on accepting the pull
request, but let us know if this accomplishes what you're looking for.

-Matt

On Tue, Sep 10, 2013 at 5:13 AM, Seyit Hocuk <seyit at astro.rug.nl> wrote:
> Dear all,
>
> I don't know if this is a simple question or not, but is it possible to
> annotate_contours independent of the conditions of the main plot?
>
> For example, I'm doing a projection plot "prj = ProjectionPlot(pf, "z",
> "Velocitydispersion",center=cent,width=wide,weight_field='volinv')" and my
> contour callback is
> "prj.annotate_contour("T_{gas}",clim=(1.0e0,2.8e1),ncont=ncont)". My problem
> is that the contours are also weighted by the chosen weight_field, which I
> do not want.
>
> Is there a workaround?
>
> Kind regards,
> Seyit
>
> --
> With kind regards,
> Seyit
>
>
> S. Hocuk
> Postdoctoral Researcher
> Kapteyn Astronomical Institute
> P.O. box 800
> 9700AV Groningen, the Netherlands
>
> _______________________________________________
> 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