There multiple technical solutions when doing a calibrated dark, like adding pedestal ...
An additive pedestal common to all calibrated frames is the
only valid solution to this problem.
it seems that the ImageCalibration truncates the intermediate result 'dark - bias'. Is this right ?
Not actually. Truncation to the [0,1] range is carried out as the very last step of the calibration task for each frame, i.e. after overscan, bias, dark, flat and pedestal correction.
Or should it log a message like '1234567 pixels of the dark truncated to zero' to attract attention to that specific problem?
This seems reasonable. I'll try to add this warning in the next version of the ImageCalibration module.
why PI could not work in floating point using negative values ? Should it become a problem ?
Without truncation, the calibration process would be inaccurate and hence useless. For image calibration to work, the whole data set, including all bias, dark, flat, science and calibrated frames, must be referred to a common numeric range. This is what we call a
coherent data set, where all of the data share a common physical significance. When a negative value arises after subtraction of a bias frame, it should be considered as an
outlier, or an
invalid observation. It falls outside the common reference range and hence must be truncated to the range's lower bound (i.e. zero). The alternative to truncation is rescaling. Now imagine that we rescale each calibrated frame to make room for its negative values. Then the resulting calibrated data would be incoherent, without a common reference range, and hence meaningless.
When truncated zero pixels become a problem because of too high bias values, the solution is adding a constant pedestal to all calibrated frames. The constant pedestal is added after calibration, just before truncation, and will be removed automatically when the corresponding master frame is applied in a subsequent calibration (pedestal values are stored as standard PEDESTAL FITS keywords). Typically, a small pedestal between 50 and 100 DN is sufficient.