image orientation on the screen

Michael Newberry mnewberry at axres.com
Thu Jan 16 04:19:01 EST 1997


On 14 Jan 1997 18:36:09 GMT, seaman at noao.edu (Rob Seaman) wrote:

>Mike Newberry <mnewberry at axres.com> writes:
>
>> Since there is no hardwired spec and no keywords for this, I wonder if
>> there is a commonly adopted "standard":
>> 
>> Where should pixel (0,0) of a FITS file be displayed on the screen-- in
>> the upper left or lower left corner?
>
>Well, IRAF/Ximtool/SAOimage (and others) put the origin at the lower left.
>A FITS file is usually considered to be in fortran storage order, so the
>lines fill left to right before they fill bottom to top.  Data cubes and
>higher dimensional images provide further complications.
>
>The computer graphics "standard" is to have the origin at the upper left.
>Many systems both in and out of astronomy allow the origin to be placed
>in any corner (either overtly, or via syntax that flips axes).  Ximtool,
>for instance, provides buttons that flip the display along either axis.
>Transposing about diagonals requires outside operations.
>
>> And for which ever is correct, should the screen image match the
>> orientation (i.e., no mirror reversal) of what the CCD saw?
>
>Depends.
>
>It isn't entirely clear how to interpret the orientation of what a
>detector array (not limited to CCDs, or physical detectors in general
>for that matter) "sees".  An orientation may only be defined at the
>point that the image is actually displayed to the user.
>
>To be less pedantic, note that a scientist and an engineer may want
>to view different orientations of the same field.  An engineer (or
>a paranoid scientist, for that matter) will want to view an array
>in "readout order" - the first pixel/line read out should be the
>first pixel/line displayed.  This allows unambiguous interpretation
>of any imaging defects - for just one example:  do defects precede
>or follow known bad pixels?
>
>A CCD, of course, may be mounted any which way on the telescope, and
>may be read out through any one of the corners.  Multiple readout CCDs
>complicate this further (half the pixels are shifted each way - or
>perhaps four different ways).  Mosaic detectors may have 8 or 16 readouts...
>
>On the other hand, an astronomer will often prefer to see the image
>"correct on the sky".  Note that "correct on the sky" is itself a rather
>fuzzy concept - only in one hemisphere might north be at the top and
>east to the left.  To get more pedantic again, note that the computer
>monitor is rarely placed in any correct orientation relative to the sky.
>
>Note that FITS WCS provides a (potentially) more rigorous mechanism to
>address these issues.  (FITS might also conceivably benefit from the
>experiences of the remote sensing/GIS communities.)
>
>Rob Seaman

Rob,

This confirms what I thought was the state of things. I have been
pretty close to FITS for some years in astronomy, but I was starting
to wonder if ther had been some improvement or convention that I
hadn't yet heard of.

First we would need to agree that pixel (0,0) or (1,1) goes in the
lower left corner. Then we need to find a way to avoid mirror
reversals of the image with respect to the sky, or the literal view
outside of astronomical imaging.  In TIFF and other pictorial
formats,there is header information that allows the reading software
to show the correct orientation even if there is no world coordinate
system attached to the image.  It is unfortunate that there is no
adopted protocol in the FITS world without going all the way to WCS
calibration.

It would be really useful if there were two keywords that would go
into an image header at the point of origin that could later be used
to give the correct display in the "mirror" sense. This would leave
only rotation as ambiguous but, since CCD's are usually mounted on
telescopes with North or South up, images could be displayed nearly
with East left and North up (or left left and up up).  Along the lines
of the keywords XOVRSCAN and YOVRSCAN, or X-ORIGIN, or X-BIN, etc., we
might use X-FLIP and Y-FLIP, X-MIRROR and Y-MIRROR, XREVERSE and
YREVERSE, or X-INVERT and Y-INVERT,  as logical (T/F) keywords. The
case of no reversals would be keywords not present or  XREVERSE = F
and YREVERSE = F.  We don't need to emend the FITS standard to do
this; some of us in the camera control software and image processing
software world just need to agree on the implementation of the
additional keywords.

Personally, I like XREVERSE and YREVERSE.

Mike Newberry




More information about the fitsbits mailing list