Hi,<div><br><div class="gmail_quote">On Wed, May 16, 2012 at 11:09 AM, Massimo Gaspari <span dir="ltr"><<a href="mailto:gaspmax@hotmail.com" target="_blank">gaspmax@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div><div dir="ltr">
<span style="font-family:'Times New Roman';font-size:16px;white-space:pre-wrap">OK.</span><span style="font-size:12pt"><font face="'Times New Roman'"><pre style="white-space:pre-wrap"><font face="'Times New Roman'">na.flipud restores the correct image.</font></pre>

<pre style="white-space:pre-wrap"><font face="'Times New Roman'"><br></font></pre><pre style="white-space:pre-wrap"><font face="'Times New Roman'">If I understand correctly, this is a problem of write_image only, right?</font></pre>

</font></span><span style="font-family:'Times New Roman';font-size:16px;white-space:pre-wrap"><div><span style="font-family:'Times New Roman';font-size:16px;white-space:pre-wrap"><br></span></div>If I am manipulating frb["Temperature"] to compute, say, a 2D radial profile, I don't have to flip the array, right?</span></div>

</div></blockquote><div><br></div><div><br></div><div>Correct. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div dir="ltr"><span style="font-size:12pt"><font face="'Times New Roman'"><pre style="white-space:pre-wrap">

<font face="'Times New Roman'"><br></font></pre><pre style="white-space:pre-wrap"><font face="'Times New Roman'">Essentially, FixedResolutionBuffer gives me the correct array and write_image flips it... ?</font></pre>

</font></span></div></div></blockquote><div><br></div><div>Yep, due to the way images are written to a bitmap.  </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div>
<div dir="ltr"><span style="font-size:12pt"><font face="'Times New Roman'"><pre style="white-space:pre-wrap"><font face="'Times New Roman'"><br></font></pre><pre style="white-space:pre-wrap"><font face="'Times New Roman'">One last question. This problem happens whenever I call any write_**** in yt?</font></pre>

<pre style="white-space:pre-wrap"><font face="'Times New Roman'"><br></font></pre></font></span></div></div></blockquote><div>In the development branch, there have been recent attempts to change the behavior to flip the image for write_bitmap, but not for write_image.  Unfortunately this particular behavior is a bit unstable right now in that we are still figuring out what the best behavior should be.</div>

<div><br></div><div>If you are using the stable branch, then both write_image and write_bitmap put the data origin in the upper left origin of the image.  </div><div><br></div><div>Sorry for the confusion,</div><div>Sam</div>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div dir="ltr"><span style="font-size:12pt"><font face="'Times New Roman'"><pre style="white-space:pre-wrap">

<font face="'Times New Roman'"></font></pre><pre style="white-space:pre-wrap"><font face="'Times New Roman'"><br></font></pre><pre style="white-space:pre-wrap"><font face="'Times New Roman'"><br></font></pre>

<pre style="white-space:pre-wrap"><font face="'Times New Roman'"><br></font></pre><pre style="white-space:pre-wrap">_______________________________________</pre><div class="im"><pre style="white-space:pre-wrap">>Hi Massimo,</pre>

<pre style="white-space:pre-wrap"><br></pre><pre style="white-space:pre-wrap">>This is due to how bitmaps of an image are written.  Right now it makes the
>upper left corner of the image the (0,0) origin of the data.  There are two
>ways to deal with this.  You can either flip the image vertically, using
>something like na.flipud(na.log10(frb1["Temperature"])) or do your plotting
>directly through matplotlib.  Something like:
<br></pre><pre style="white-space:pre-wrap">>import matplotlib.pylab as pl
>pl.imshow(na.log10(frb1["Temperature"]), origin='lower')
<br></pre><pre style="white-space:pre-wrap">>I'm not completely sure, but I'm guessing the origin='lower' keyword does
>something similar to na.flipud.  As a side note, this behavior has come up
>in a few other places recently, and we're trying to determine a nice way to
>handle the behavior.
<br></pre><pre style="white-space:pre-wrap">>Hope that helps,
>Sam</pre></div></font></span><div><div dir="ltr"><div><div dir="ltr">                                     </div></div>                                        </div></div>                                        </div></div>
<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></blockquote></div><br></div>