UWMRO/evora-server

Images flipped N/S

Opened this issue · 3 comments

ojf commented

E/W is correct. Images display the same between JS9 (in client) and in DS9: flipped N/S

Quoting discord discussion below

The reason is the way data is stored vs the data is read. DS9/JS9 always reads and writes data in bottom up fashion, ie. image origin is the bottom left, aka the mathematic way. Evora and most camera drivers nowadays write data in the top down fashion, aka the screen space way where the origin is the top left corner. That means if you open an evora image with ds9, the image is flipped vertically.

there is a fairly recent solution to deal with this incompatibility proposed by some opensource astro photo processing software devs. They advocate the use of a FITS header keywords "ROWORDER" to specify how data was written, so that when openning the image, the software can know it. Above you can see the original evora image on the left, and the image with "top-down" keyword on the top right, and "bottom-up" on the lower right.

ROWORDER is a nice to have but DS9/JS9 doesn't read it. Either we fix the direction when saving or we can incorporate plate solving to add wcs header.

We can add a very simple WCS if we just want to get the orientation roughly right. Just setting the CD matrix to

1 0
0 -1

should make DS9 show the N arrow pointing down.

We can add ROWORDER and incorporate plate solving implemented in #28, so the image will be displayed correctly everywhere.

ROWORDER is an easy one line change, however, we need to discuss when do we want to plate solve. Doing it before saving the image adds more latency for our operators waiting for the image.