[yt-users] Inverted image

Massimo Gaspari gaspmax at hotmail.com
Wed May 16 10:09:11 PDT 2012


OK.na.flipud restores the correct image.
If I understand correctly, this is a problem of write_image only, right?
If I am manipulating frb["Temperature"] to compute, say, a 2D radial profile, I don't have to flip the array, right?
Essentially, FixedResolutionBuffer gives me the correct array and write_image flips it... ?
One last question. This problem happens whenever I call any write_**** in yt?



_______________________________________>Hi Massimo,

>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:


>import matplotlib.pylab as pl
>pl.imshow(na.log10(frb1["Temperature"]), origin='lower')


>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.


>Hope that helps,
>Sam 		 	   		   		 	   		   		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20120516/efcaeb42/attachment.html>


More information about the yt-users mailing list