RMS icon indicating copy to clipboard operation
RMS copied to clipboard

Fix limited dynamic range in 8bit FF frames

Open cbassa opened this issue 4 years ago • 0 comments

The FF frames are stored as 8bit FITS extensions. For the MAXPIXEL, MAXFRAME and AVEPIXEL extensions this is not an issue, but for the STDPIXEL frame the use of 8bits reduces the sensitivity, as the majority of STDPIXEL values are 1, with long tail to values of about 40 (out of 255). As a result, computing significance through (MAXPIXEL - AVEPIXEL) / STDPIXEL adds noise due to the lack of dynamic range in the STDPIXEL frame.

The FITS standard offers the BSCALE and BZERO keywords to apply a scaling and offset factor to scale the 8bit data. In astropy, the presence of these keywords in the extension header will be applied when reading the data of the extension, converting the 8bit data to floating point on the fly. For more information, see https://docs.astropy.org/en/stable/io/fits/usage/image.html.

For example for RMS, you could already get a factor of 10 more dynamic range by setting BSCALE to 0.1 in the STDPIXEL frame.

cbassa avatar May 19 '21 13:05 cbassa