<div dir="ltr"><div><div>Hi all,<br><br></div>Running this test script<br><a href="http://paste.yt-project.org/show/6379/" target="_blank">http://paste.yt-project.org/show/6379/</a><br></div>will result in this image<br><a href="https://slack-files.com/T042F73QM-F0X0YJE3V-4a579d9431" target="_blank">https://slack-files.com/T042F73QM-F0X0YJE3V-4a579d9431</a><br><div><br></div><div>Apparently, the sequence of <font size="1"><span style="font-family:monospace,monospace">buff_size</span></font> is switched so that<br></div><div><pre style="margin:0px;padding:5px 0px;font-family:"Bitstream Vera Sans Mono",monospace;color:rgb(0,0,0);font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px"><font size="1"><span>set_buff_size</span><span>((</span><span style="color:rgb(64,160,112)">8</span><span>,</span><span style="color:rgb(64,160,112)">4</span><span>))</span></font></pre>gives a 4 by 8 image.<br></div><div><br></div><div>I have traced down the codes and found the following lines are the cause of the problem.<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" 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><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" 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></div><div>If rows=nx and cols=ny, the two functions (<font size="1"><span style="font-family:monospace,monospace">pixelize_cartesian</span></font> and <span style="font-family:monospace,monospace"><font size="1">pixelize_off_axis_cartesian</font></span>) should take rows first and then cols.<br></div><div><br></div><div>The same API has been around in _MPL.c since 2010 and thus changing it will be backward incompatible.<br><br>However, to be consistent with other parts of the code (e.g. <a href="https://bitbucket.org/yt_analysis/yt/src/d18f33211199f71e2fac4d927307b015d513a328/yt/visualization/fixed_resolution.py?at=yt&fileviewer=file-view-default#fixed_resolution.py-374" target="_blank">here</a>, <a href="https://bitbucket.org/yt_analysis/yt/src/d18f33211199f71e2fac4d927307b015d513a328/yt/visualization/fixed_resolution.py?at=yt&fileviewer=file-view-default#fixed_resolution.py-249" target="_blank">here</a>, <a href="https://bitbucket.org/yt_analysis/yt/src/d18f33211199f71e2fac4d927307b015d513a328/yt/data_objects/data_containers.py?at=yt&fileviewer=file-view-default#data_containers.py-1388" target="_blank">here</a>, and <a href="https://bitbucket.org/yt_analysis/yt/src/d18f33211199f71e2fac4d927307b015d513a328/yt/analysis_modules/sunyaev_zeldovich/projection.py?at=yt&fileviewer=file-view-default#projection.py-184" target="_blank">here</a>), in which <font size="1"><span style="font-family:monospace,monospace">buff_size = (nx, ny)</span></font> is assumed and used, I propose to change the behavior of the above two functions.<br></div><div><br></div><div>What do you think? Anyone has other suggestions?<br><br></div><div>Thanks!<span class=""><font color="#888888"><br></font></span></div><span class=""><font color="#888888"><div>Yi-Hao</div></font></span>
</div>