[yt-users] Inverted image

Sam Skillman samskillman at gmail.com
Wed May 16 10:15:56 PDT 2012


Hi,

On Wed, May 16, 2012 at 11:09 AM, Massimo Gaspari <gaspmax at hotmail.com>wrote:

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


Correct.

>
> Essentially, FixedResolutionBuffer gives me the correct array and write_image flips it... ?
>
>
Yep, due to the way images are written to a bitmap.

>
> One last question. This problem happens whenever I call any write_**** in yt?
>
>
> 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.

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.

Sorry for the confusion,
Sam

>
>
>
> _______________________________________
>
> >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
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20120516/b7751975/attachment.htm>


More information about the yt-users mailing list