Hi Massimo,<div><br></div><div>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(<span style>na.log10(frb1["</span><span style>Temperature"])) or do your plotting directly through matplotlib.  Something like:</span></div>

<div><span style><br></span></div><div><font color="#222222" face="arial, sans-serif">import matplotlib.pylab as pl</font></div><div><font color="#222222" face="arial, sans-serif">pl.imshow(</font><span style>na.log10(frb1["</span><span style>Temperature"]), origin='lower')</span></div>

<div><br></div><div>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.  </div>

<div><br></div><div>Hope that helps,</div><div>Sam</div><br><div class="gmail_quote">On Wed, May 16, 2012 at 10:40 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">
<div>Here it is:</div><div><br></div><div><br></div><div><div>from yt.mods import *</div><div><br></div><div><br></div><div>axis = 0  </div><div><br></div><div>xCenter = 0.55548e24 </div><div><br></div><div>yCenter = 0.55548e24 </div>

<div><br></div><div>zCenter = 0.</div><div><br></div><div><br></div><div>res   = [2048, 4096]</div><div><br></div><div><br></div><div>fn = "chk_0000"</div><div><br></div><div>pf = load(fn)</div><div class="im">
<div>
<br></div><div>proj = pf.h.proj(axis, "Temperature", None)</div><div><br></div></div><div>frb1 = FixedResolutionBuffer(proj, (0., xCenter*2., 0., xCenter), res) </div><div class="im"><div><br></div><div>write_image(na.log10(frb1["Temperature"]), "output.png")</div>

</div></div><div><br></div><div><br></div><div><br></div><div>I am in the stable branch:</div><div><br></div><div><br></div><div><div>c23cb264f04c+ (stable)</div></div><div><br></div><div><br></div><div><br></div><div>Thanks,</div>

<div><br></div><div><br></div><div><br></div><div>   Max</div><div><br></div><div class="hm HOEnZb"><div><br></div><div><br></div><br><br></div><div><div class="hm HOEnZb"><div></div><hr>From: <a href="mailto:gaspmax@hotmail.com" target="_blank">gaspmax@hotmail.com</a><br>

To: <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>Subject: Inverted image<br>Date: Wed, 16 May 2012 18:13:39 +0200</div><div><div class="h5"><br><br>


<div dir="ltr">
Hi guys,<div><br></div><div><br></div><div>After a projection and a FixedResolutionBuffer like this:</div><div><br></div><div><br></div><div><div>proj  = pf.h.proj(axis, "Temperature", None)</div><div><span>frb1  = FixedResolutionBuffer(proj, (</span>xmin,xmax,ymin,ymax<span>), res)</span></div>

<div>write_image(na.log10(frb1["Temperature"]), "output.png")</div></div><div><br></div><div><br></div><div>I see an inverted image (my computational box is half a cube, z>0 only):</div><div><a href="http://i.imgur.com/AqWKD.png" target="_blank">http://i.imgur.com/AqWKD.png</a></div>

<div><br></div><div><br></div><div>Is the problem in write_image? Or inside the projection/FRB?</div><div>How to fix this (without transpose)?</div><div><br></div><div><br></div><div>Thanks,</div><div><br></div><div><br>
</div>
<div>  Max</div>                                      </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>