Hi Andy,
This is an excellent question.
When a floating point image is being read from a disk file, PixInsight needs to know which pixel values correspond to black and white, respectively. In other words, we need to know the limits of the dynamic range that the image is referred to. This is necessary in order to interpret and represent pixel values correctly.
Unfortunately, the FITS format does not provide a standard way to define these limits. There are no standard header keywords that can tell us which values are to be considered as the minimum and maximum values of the actual dynamic range for a particular image.
I suppose on reflection there might be a bug in CCDStack, because I don't know why any pixel values would be negative, since I have combined a series of images as a sum. No input pixels should be less then zero, unless they scale the image around zero.
This is not a bug. They have the freedom to store a floating point FITS image using the numeric range of their choice; the FITS standard fully guarantees this freedom. A completely different thing, however, is the convenience of doing this. We do think that a standardization of floating point pixel values is a must, and we try to enforce it as long as we can. But this is just our opinion.
As you probably know, PixInsight uses what we call the
normalized real range to store and represent floating point pixel values. This is just the [0,1] range, where 0 corresponds to black (no signal) and 1 corresponds to white (full signal). All floating point images written by PixInsight (currently TIFF and FITS images formats) are always represented and stored in the normalized range.
Unfortunately, other applications usually store floating point images using arbitrary ranges (and sometimes quite odd ones, as you can verify). What happens when we try to read a floating point image that stores pixel values outside the normalized range? How can we know how to interpret existing pixel values? Quick answer: we cannot. Even worse: we have no way to know in advance the range that has been used to represent pixel values stored in
any floating point FITS file.
Our solution to this problem is simple: let the user tell us about the ranges used in every floating point FITS file that doesn't fit the normalized range. You have several options that you can tweak to make things easier. Do the following:
- Open the Format Explorer Window
- Double click the FITS item on the left panel
- On the FITS Format Preferences window, you have:
* Default Floating Point Input Range. This is the effective range that will be considered for FITS files whose pixels fit inside this range. In other words, the minimum and maximum values here are taken as black and white, respectively, to read FITS images. By default, this is the [0,1] range. I recommend you to leave this unchanged.
* Floating Point Out of Range Policy. By default, this is set to "ask on out-of-range values". If you know that you'll be working with nonstandard FITS files all the time, it can be better to change this to "normalize to the default input range". In this way you'll receive no "Range Options" dialogs, and you'll lose no data at all, since the minimum value in the file will be taken as black, and the maximum as white, respectively.
My question is, if I leave the lower and upper ranges at the default values of 0 and 1, am I losing any detail in the image? Is there a compression of values? If I am going to 32-bit floating point, why does the image need to be rescaled at all?
You'll lose no data at all, as long as you leave the "If out of range" option to its default "Rescale image to the specified range" setting.
With the default [0,1] input range, this is what will be calculated for each pixel:
v' = (v - min)/(max - min)
where v is the read pixel value, v' is the final value used by PixInsight, and min, max are, respectively, the minimum and maximum pixel values in the image (the extreme pixel values shown on the FITS Floating Point Range Options dialog).
Two conclusions:
- If possible, try to store your images in 32-bit integer format, instead of 32-bit floating point. With integer pixel values, you'll have no range problems, and the 32-bit integer format is much more accurate than 32-bit floating point (2^32 discrete values instead of about 10^7 values). PixInsight can read and write 32-bit integer FITS and TIFF files. I know that many other applications can't, though...
- If possible, don't use the FITS format to communicate image data between different applications. Unfortunately, there are popular applications and camera makers out there that make really wrong use of the FITS format to store almost anything in very odd ways. Of course, I'm not speaking of CCDStack, which does follow the FITS standard well, AFAIK.
Hope this will help more than confuse :roll: