overflowx -- Correct 8-bit overflow in FOC images (as far as possible).
overflowx input1 input2 output
In 8-bit mode, an FOC pixel will overflow---cycling back through 0---when the count exceeds 255. If an image is taken with the same conditions, but with a shorter exposure time, then it can be corrected, assuming that the pixels have cycled through 0 no more than one time. Alternatively, in the special case of flat fields we know that the image should not change too rapidly from one pixel to the next, we can therefore attempt to correct an image with overflowed pixels.
There are two modes of operation. The first uses two images, and checks the ratio of pixel values. If the ratio of overflowed to normal image exceeds low_thresh, then we add 255 to first image, unless this would give too high a ratio. Negative ratios are interpreted as multiple of rms statistics (sqrt(count)).
If only one image is given, we proceed along each line and starting at a specified pixel, if we detect a downward shift by more than low_thresh we add 255, unless we would end up with a positive shift greater than high_thresh.
- input[file name]
- Name of the image with 8-bit overflow.
- input[file name]
- Name of the optional image without overflow. If this parameter is not used, then input1 is corrected as a flat field image.
- output [file name]
- Output image name.
- (lowthresh = 128.) [real]
- Lower threshold for allowed pixel change. If lowthresh is negative it is interpreted as the number of standard deviations ( = sqrt(count) in non-overflowed pixel) allowed.
- (highthresh = 128.) [real]
- Upper limit for pixel change. If highthresh is negative, it is interpreted as the number of stand deviations ( = sqrt(count) in non-overflowed pixel) allowed.
- (startpix = 1) [integer, min=1]
- Starting pixel for processing in each line. This allows the first few pixels in a line to be ignored. The unprocessed pixels are just copied from input1 to output.
- (ratio) [real]
- Expected ratio for counts input2/'input1', for example the ratio of exposure times if other conditions are the same.
1. Correct an image as a flat field, one line at a time.
fo> overflowx inimage "" outimage
2. Here the ratio of the non-overflowed to overflowed images should be 0.5. Those pixels for which the ratio is too much lower than this will be corrected, unless an overcorrection would result.
fo> overflowx ov norm out ratio=0.5
This task was written by David Giaretta.