Thursday, May 2, 2024

Flipping Hell...

 As a newcomer to astrophotography, the question of which is the right way up for images arises. A moment's thought provides the answer that there's no 'right way up' in space. Indeed an observer in the northern hemisphere - say at latitude 45 degrees North - looking South and imaging an object at declination 0 degrees on the meridian will have the positive declination direction towards the 'top' of the image. Conversely, an observer in the southern hemisphere - say at latitude 45 degrees South - looking North and imaging the same object at declination 0 degrees on the meridian will have the positive declination direction towards the 'bottom' of the image. At first it might be thought that swapping over top and bottom by a 'flip' would make the view the same - but instead a rotation is needed. This involves a 'mirror' in addition to the 'flip'.

Warning: It's best not to use the entirely logical term 'mirror' as it risks descending into a useless discussion about terminology. Instead use 'flip horizontal' and 'flip vertical' - or better still 'flip left-right' and 'flip top-bottom' respectively.

One could avoid the mention of 'flip' completely, as the only relevant transformation is 'rotation' - except for the observation that viewing the same FITS file in different applications reveals that some applications appear to not 'rotate' the image, but perform a single 'flip'. This led to considerable confusion on my part.

The problem is that this error can go unnoticed in an image where there are no clues as to the correct view 'on the sky'.  An example of this lack of clues would be star fields. Going up the range where details in the image give an increasing level of 'clues', the easiest objects in which to identify orientation are spiral galaxies. In the representation of a spiral galaxy directly below (actually a Catherine wheel fireworks), the direction of spin is easily seen as anti-clockwise.  Rotating this image naturally retains the direction of spin.

Catherine Wheel - Anti-clockwise Spin
However, if the image is 'flipped' instead (in this case left and right are swapped) as shown below, the spin direction is now clock-wise. That is, a view which would be seen from behind the Catherine wheel.

Catherine Wheel - Flipped Horizontal - Clockwise Spin
In writing my own applications to analyse and/or process Seestar S50 FITS files, the order of reading the data from the file determines whether the image is 'flipped' or not. This was checked empirically by doing a test run and comparing the image with an image from a professional source. It was found that the order of the data in one dimension needed to be reversed. Of course, once the correct order is determined via one FITS image file from the Seestar S50, the same holds true for any Seestar S50 FITS file. The correct order for FITS files from other sources (e.g., Dwarf Lab II) needs to be determined separately. And it's worth repeating - care needs to be taken when using other applications.