[yt-users] Problem with annotate_contour() callback on OffAxisProjectionPlots

Cameron Hummels chummels at gmail.com
Wed Apr 2 09:58:18 PDT 2014


I'll test it out today.  Thanks for all of the hard work on this Nathan and
Matt!  I really appreciate it.


On Tue, Apr 1, 2014 at 6:50 PM, Nathan Goldbaum <nathan12343 at gmail.com>wrote:

> This commit puts together the plumbing necessary to get Matt's proposed
> fix to proceed without throwing AttributeErrors:
>
>
> https://bitbucket.org/ngoldbaum/yt/commits/3b5b687182b1a51fb2aa46d879dc338c76b46ac4
>
> No guarantees of correctness - in particular I think you'll need to take
> care to make sure the orientations are what you expect by specifying a
> north vector.
>
> Cameron if those changes work for you can you bundle my and Matt's changes
> into a pull request?
>
> -Nathan
>
>
> On Tue, Apr 1, 2014 at 4:20 PM, Matthew Turk <matthewturk at gmail.com>wrote:
>
>> Hi Cameron,
>>
>> On Tue, Apr 1, 2014 at 4:51 PM, Matthew Turk <matthewturk at gmail.com>
>> wrote:
>> >
>> > On Apr 1, 2014 4:42 PM, "Cameron Hummels" <chummels at gmail.com> wrote:
>> >>
>> >> Sorry about that--I wasn't totally clear in what I wanted to get out of
>> >> this.
>> >>
>> >> I wanted the contours in test4 to be identical to the contours in
>> test3,
>> >> since they're both created using annotate_contour() with the same
>> >> data_source.  Yes, there are contours in test4.png, but they are
>> >> significantly different from those in test3.  Does this make sense?
>> >>
>> >> If you look at the contours for test1 and test2, they match, despite
>> the
>> >> fact the underlying data being plotted change.
>> >>
>> >
>> > Ah, I understand now.
>> >
>> > So, two things. I have used real data (much easier than random) and the
>> > contours do not match as well as I would like. However, they cannot
>> match
>> > exactly - you can see this in the random pf by looking at how the off
>> axis
>> > projections are covered with what look like stencil outlines of cells.
>> These
>> > won't go away, regardless of what we do with the off six projection,
>> because
>> > of how the data is created. The on-axis is produced by pixelizing a
>> sparse
>> > grid of points, which is then fed into a Delaunay triangulation before
>> > contouring the result. The off axis is already densely packed, which
>> means
>> > the interpolation process becomes nearest neighbor.
>> >
>> > As for the other issue, I believe there is a transposition error
>> combined
>> > with the fact that linearly interpolating inside a cell produces
>> different
>> > results during the projecting process. I think you had proposed an
>> > adjustment to the axis order for OAP objects; did it make it in?
>>
>> Ah!  I think I found it.  I was doing something wrong in my script; by
>> setting north_vector and so on, I got identical results for the
>> different images, *except* that one was clearly weighted when it
>> shouldn't be.  I tracked this down and have pushed a partial fix here:
>>
>>
>> https://bitbucket.org/MatthewTurk/yt/commits/1e4ca6c3f7da6a6a7857660690c2207dab934652
>>
>> Unfortunately, I was unable to finish it because I don't know how the
>> CallbackWrapper works completely, and it is necessary.  Here we need
>> to regenerate the FRB from a different data_source, whereas by default
>> the contours will use the extant FRB.  Nathan, do you know how we
>> might fix this?  Can we just retain a reference to the window_plot in
>> the wrapper?
>>
>> -Matt
>>
>> >
>> > Matt
>> >
>> >>
>> >> On Tue, Apr 1, 2014 at 1:32 PM, Matthew Turk <matthewturk at gmail.com>
>> >> wrote:
>> >>>
>> >>> Hi Cameron,
>> >>>
>> >>> On Tue, Apr 1, 2014 at 4:11 PM, Cameron Hummels <chummels at gmail.com>
>> >>> wrote:
>> >>> > Hey everyone,
>> >>> >
>> >>> > I have an unusual problem that I cannot seem to work out.  I'm
>> trying
>> >>> > to
>> >>> > generate a set of contours on an OffAxisProjectionPlot using the
>> >>> > underlying
>> >>> > data from another OffAxisProjectionPlot (i.e. a different
>> data_source).
>> >>> > I
>> >>> > can get this working A-OK when I just use the ProjectionPlot class,
>> but
>> >>> > when
>> >>> > I attempt to use the OffAxisProjectionPlot, I encounter problems.
>> >>> >
>> >>> > I made a small script demonstrating this problem, as well as the
>> >>> > success
>> >>> > when this method is applied to a ProjectionPlot object.  Any
>> >>> > suggestions?
>> >>> >
>> >>> > Note, this is yt 2.x dev.  Here is the script:
>> >>> >
>> >>> > http://paste.yt-project.org/show/4459/
>> >>> >
>> >>> > Cameron
>> >>>
>> >>> My reading of your script is that you want "test4.png" to have
>> >>> contours on it, right?  I just ran this script on 61e6b84f875c, which
>> >>> is near tip of 2.x, and I got this image for test4.png:
>> >>>
>> >>> http://i.imgur.com/hfycSN9.png
>> >>>
>> >>> Is this not what you wanted?
>> >>>
>> >>> -Matt
>> >>>
>> >>> >
>> >>> > --
>> >>> > Cameron Hummels
>> >>> > Postdoctoral Researcher
>> >>> > Steward Observatory
>> >>> > University of Arizona
>> >>> > http://chummels.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
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> Cameron Hummels
>> >> Postdoctoral Researcher
>> >> Steward Observatory
>> >> University of Arizona
>> >> http://chummels.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
>>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>


-- 
Cameron Hummels
Postdoctoral Researcher
Steward Observatory
University of Arizona
http://chummels.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20140402/6b5449a2/attachment.htm>


More information about the yt-users mailing list