worlickwerx / sbig-util

Linux utility for Santa Barbara Instrument Group cameras for astronomy
GNU General Public License v3.0
5 stars 2 forks source link

add --color-convert=mono option for single shot color cameras #32

Closed garlick closed 6 years ago

garlick commented 6 years ago

On the single shot color cameras like STF-8300C or ST-iC -

By default we get a raw FITS image that includes Bayer artifacts.

This is probably not a desirable default for these cameras. A better default would be to convert the raw image to monochrome, and allow this to conversion be disabled with an option like --raw-color.

Dark frame subtraction and any other calibration should occur before color conversion.

Sec 5.2 of SBIGUdrv manual shows the Bayer pattern for the ST-2001XCM.

BGB
GRG

Even rows begin with B, odd rows begin with G. Subframe readouts need to start on an even row and even column to maintain this.

It goes on to describe how to convert to monochrome by applying a 3x3 kernel:

1 2 1
2 4 2
1 2 1

value for center pixel L = sum (pixel values * kernel number) / 16

garlick commented 6 years ago

On second thought, maybe sbig-snap should output raw by default, and allow color conversion if the user asks for it with --color-convert=mono or similar?

sbig-focus might do the conversion automatically before handing the image to ds9 though.