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

Matthew Turk matthewturk at gmail.com
Tue Apr 1 13:51:20 PDT 2014


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?

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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20140401/6773da81/attachment.htm>


More information about the yt-users mailing list