<div dir="ltr"><div><div></div></div><div class="gmail_extra">
<br><div class="gmail_quote">On Fri, Apr 1, 2016 at 11:23 AM, 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"><span>On Fri, Apr 1, 2016 at 11:21 AM, Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com" target="_blank">nathan12343@gmail.com</a>> wrote:<br>
><br>
><br>
> On Fri, Apr 1, 2016 at 11:11 AM, Matthew Turk <<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>> wrote:<br>
>><br>
>> Hi Yi-Hao,<br>
>><br>
>> The actual usage of _MPL.c shouldn't be user-facing.  So I think as<br>
>> long as the things that are public APIs (such as the data returned<br>
>> from a FixedResolutionBuffer object) remain the same, I am a strong +1<br>
>> on this.<br>
><br>
><br>
> The trouble is, if we want to make the user interface match what people<br>
> expect, i.e. buff_size is (nx, ny), where nx it the number of pixels along x<br>
> and ny is the number of pixels along y, we'll need to change the behavior<br>
> here.<br>
<br>
</span>Hmmm .. but we transpose in most places, like<br>
yt/geometry/coordinates/cartesian_coordinate_handler.py .<br></blockquote><div> </div><div>I think the transpose of the image array is to fit the behavior of imshow(), which needs an array with the shape (ny, nx) to display nx pixels along x axis and ny pixels along y axis. <br><br></div><div>I assumed generally people expect buff_size is (nx, ny). But if they really use non-square buff_size, they probably should have figured it out by trial and error and used (ny, nx) instead. The proposed fix will change this behavior.<br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div><br>
><br>
>><br>
>><br>
>> -Matt<br>
>><br>
>> On Fri, Apr 1, 2016 at 10:19 AM, Yi-Hao Chen <<a href="mailto:ychen@astro.wisc.edu" target="_blank">ychen@astro.wisc.edu</a>> wrote:<br>
>> > Hi all,<br>
>> ><br>
>> > Running this test script<br>
>> > <a href="http://paste.yt-project.org/show/6379/" rel="noreferrer" target="_blank">http://paste.yt-project.org/show/6379/</a><br>
>> > will result in this image<br>
>> > <a href="https://slack-files.com/T042F73QM-F0X0YJE3V-4a579d9431" rel="noreferrer" target="_blank">https://slack-files.com/T042F73QM-F0X0YJE3V-4a579d9431</a><br>
>> ><br>
>> > Apparently, the sequence of buff_size is switched so that<br>
>> ><br>
>> > set_buff_size((8,4))<br>
>> ><br>
>> > gives a 4 by 8 image.<br>
>> ><br>
>> > I have traced down the codes and found the following lines are the cause<br>
>> > of<br>
>> > the problem.<br>
>> ><br>
>> > <a href="https://bitbucket.org/yt_analysis/yt/src/d18f33211199f71e2fac4d927307b015d513a328/yt/utilities/lib/pixelization_routines.pyx?at=yt&fileviewer=file-view-default#pixelization_routines.pyx-61" rel="noreferrer" target="_blank">https://bitbucket.org/yt_analysis/yt/src/d18f33211199f71e2fac4d927307b015d513a328/yt/utilities/lib/pixelization_routines.pyx?at=yt&fileviewer=file-view-default#pixelization_routines.pyx-61</a><br>
>> ><br>
>> ><br>
>> > <a href="https://bitbucket.org/yt_analysis/yt/src/d18f33211199f71e2fac4d927307b015d513a328/yt/utilities/lib/pixelization_routines.pyx?at=yt&fileviewer=file-view-default#pixelization_routines.pyx-216" rel="noreferrer" target="_blank">https://bitbucket.org/yt_analysis/yt/src/d18f33211199f71e2fac4d927307b015d513a328/yt/utilities/lib/pixelization_routines.pyx?at=yt&fileviewer=file-view-default#pixelization_routines.pyx-216</a><br>
>> ><br>
>> > If rows=nx and cols=ny, the two functions (pixelize_cartesian and<br>
>> > pixelize_off_axis_cartesian) should take rows first and then cols.<br>
>> ><br>
>> > The same API has been around in _MPL.c since 2010 and thus changing it<br>
>> > will<br>
>> > be backward incompatible.<br>
>> ><br>
>> > However, to be consistent with other parts of the code (e.g. here, here,<br>
>> > here, and here), in which buff_size = (nx, ny) is assumed and used, I<br>
>> > propose to change the behavior of the above two functions.<br>
><br>
><br>
> I'm +0.5 on this, but am nervous that it will change the results of user<br>
> scripts. I'd like the API to match naive expectations though...<br>
><br>
>><br>
>> ><br>
>> > What do you think? Anyone has other suggestions?<br>
><br>
><br>
> The other alternative is to document the current (annoyingly backwards)<br>
> behavior.<br></div></div></blockquote><div>If we want to keep the current behavior and document it, many parts of the code will need to be changed as well.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
><br>
>><br>
>> ><br>
>> > Thanks!<br>
>> > Yi-Hao<br>
><br>
><br>
> Thank you for your detective work on this, Yi-Hao!<br>
><br>
>><br>
>> ><br>
>> > _______________________________________________<br>
>> > yt-dev mailing list<br>
>> > <a href="mailto:yt-dev@lists.spacepope.org" target="_blank">yt-dev@lists.spacepope.org</a><br>
>> > <a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
>> ><br>
>> _______________________________________________<br>
>> yt-dev mailing list<br>
>> <a href="mailto:yt-dev@lists.spacepope.org" target="_blank">yt-dev@lists.spacepope.org</a><br>
>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
><br>
><br>
><br>
> _______________________________________________<br>
> yt-dev mailing list<br>
> <a href="mailto:yt-dev@lists.spacepope.org" target="_blank">yt-dev@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
><br>
_______________________________________________<br>
yt-dev mailing list<br>
<a href="mailto:yt-dev@lists.spacepope.org" target="_blank">yt-dev@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org</a><br>
</div></div></blockquote></div><br></div></div>