Hi Warren,
In recent versions of PixInsight, PEDESTAL keyword values are applied irrespective of their sign.
Apparently SBIG invented the pedestal extension?
The key word here is
invented: the PEDESTAL keyword is not part of the FITS standard format definition. As we interpret it, PEDESTAL should only be present in master calibration frames (typically master bias frames) to prevent negative values after bias or overscan subtraction, and
only when it is
really necessary. If present, the PEDESTAL keyword (or another custom, user-defined keyword that we also support for the same purpose), should have been written by a previous image calibration task, but it should
never be present in uncalibrated raw frames. Since we don't claim to support images calibrated by other applications in our preprocessing tools and pipelines, we implemented the PEDESTAL keyword support as we understand it: a positive integer in DN units that has to be subtracted to get actual pixel sample values referred to zero. When the corresponding keyword is not present, the default PEDESTAL value is zero.
To summarize:
a) If the PEDESTAL keyword is present in raw frames, that is, in pure raw data that has not been previously calibrated, then this is incredibly wrong and we don't support it.
b) If the PEDESTAL keyword is present in calibrated frames or master calibration frames that have been generated by PixInsight, then the corresponding keyword values should be subtracted from pixel data to get unbiased pixel sample values, and there should be (modulo bugs) no problem at all.
c) If the PEDESTAL keyword is present in calibrated frames or master calibrated frames that have been generated by other applications, then it is a nonstandard keyword and we don't support it. We don't claim to support calibrated or calibration data generated by other applications. All master calibration frames must be generated with PixInsight in order to use PixInsight for preprocessing.
So the only practical problem is a): PEDESTAL keywords present in the headers of raw frames. As you have noted, a practical solution to this problem is quite simple: select the "literal value" option for the pedestal mode parameter of ImageCalibration (Pedestal section). Then specify 100 (or the actual PEDESTAL value, known after inspection of FITS headers) as the pedestal value parameter. Of course this assumes that all raw frames have the same value added. Unfortunately, this excludes the BatchPreprocessing script to automate the calibration and registration tasks.
Another possibility—the best one—is writing a script to subtract the PEDESTAL values and keywords from input raw frames automatically, or to fix the wrong keyword values. Such a script is very simple and small; I'll write one as soon as I get a bit of free time.
This is an excellent example of interoperability problems generated by an obsolete, poorly and loosely defined file format.