CCD Control and FITS Header

Main forum about Astroart
Post Reply
Forum_2014
Posts: 255
Joined: 03 Dec 2018, 22:33

CCD Control and FITS Header

Post by Forum_2014 »

Hi Everyone,

my main usage of AA5 is CCD control via scripts. Operating the camera (Atik 314L+) via scripts is very powerful, so I like it very much.

Recently I came across problems when calibrating the image data with the image processing software PixInsight.
I had a hard time to realize that the problems were caused by lack of the optional keywords BZERO = 32768.0 and BSCALE = 1.0 in the 16-bit bias frames.
I know the shortcoming of the FITS standard that the 16-bit number format is signed, producing a range of -32768 to +32767. The range of data from many cameras is 0 to 65535.
And obviously PixInsight expects this range of data.

Tests let me recognize that especially the FITS header of bias frames sometimes include the keywords BZERO and BSCALE and sometimes not. Whereas images gained with the control
by ArtemisCapture (propriatary capture software for Atik cameras) always include this keywords correctly.
Further tests showed that this ambiguous behavier is not controllable with settings of Preferences in AA5 or with script functions like Image.SetKey(key$,value).

Is anybody out there who has a sense what causes AA5 to whrite the FITS header in this ambiguous way and how can one control this?

Any hint how to overcome this issue is much appreciated.
Thanks,
Rolf

Forum_2014
Posts: 255
Joined: 03 Dec 2018, 22:33

Re: CCD Control and FITS Header

Post by Forum_2014 »

Hi,
Astroart is 100% FITS compatible, there is only one standard and we follow it strictly.
You can verify opening and saving image with some official FITS software from this page:

http://fits.gsfc.nasa.gov/fits_viewer.html

Other software is not compatible, you can verify this downloading FITS images from professional observatories which uses IRAF.
BZERO/BSCALE/signed/unsigned is often badly implemented in Windows software.

Forum_2014
Posts: 255
Joined: 03 Dec 2018, 22:33

Re: CCD Control and FITS Header

Post by Forum_2014 »

Hi,
thank you for replying to my question.

Okay, surely, I know some of this official FITS software to show the entries of FITS headers. They were the way I could see what is going on: Sometimes the frames gained by controlling the Atik 314L+ camera with AA5 include the keywords BZERO and BSCALE and sometimes not.

Fact is, when not included, then the results of calibrating lightframes with PixInsight are bizarre.
So I tried to insert the missing (optional) keywords by writing a program to do this. The findings are: Yes, the keywords are available now but the autoscaled image looks totaly different and the so changed frames are not usable to calibrate lightframes. Presumably there is some checksum in play I have no knowledge of.

So my main question remains: Why are the the obviously importend keywords in frames gained under AA5 sometimes included and sometimes not and how can one control this?

Thanks,
Rolf

Forum_2014
Posts: 255
Joined: 03 Dec 2018, 22:33

Re: CCD Control and FITS Header

Post by Forum_2014 »

Hello,
BZERO and BSCALE are not written if they are 0 and 1, following the FITS standard.

If the image range is 0..64k then the FITS encoding of "unsigned" 16 bit requires BZERO = 32768. So it must be written.
Maybe the other programs do not know that when BZERO is missing its default value is zero?

Default values (0,1,emptystring) are used in the FITS standard to keep the header as short as possible, to help its reading by humans, e.g. to avoid "spamming" of keywords not necessary.

So: if the image range if 0..32k there is no BZERO, if instead the range is 0..64k there is BZERO = 32768 so that adding 32768 to the signed range of -32k..+32k of the FITS internal signed file format, a 0..64k range is obtained.

Post Reply