<div dir="ltr">This commit puts together the plumbing necessary to get Matt's proposed fix to proceed without throwing AttributeErrors: <div><br></div><div><a href="https://bitbucket.org/ngoldbaum/yt/commits/3b5b687182b1a51fb2aa46d879dc338c76b46ac4">https://bitbucket.org/ngoldbaum/yt/commits/3b5b687182b1a51fb2aa46d879dc338c76b46ac4</a><div>

<div><br></div><div>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.</div></div></div><div><br></div><div>Cameron if those changes work for you can you bundle my and Matt's changes into a pull request?</div>

<div><br></div><div>-Nathan</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 1, 2014 at 4:20 PM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>></span> wrote:<br>

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