Hi Jack,
Of course this little script is not intended to replace a full-fledged (and excellent) preprocessing application as CCDStack!
This script is useful to combine a small number of images, say no more than eight or ten. It has a nice feature: it generates two
rejection map images. These maps are nonzero for pixels that have been rejected by the k-sigma clipping procedure. Two maps are generated: one for bright clipped pixels and another for dark clipped pixels. These maps are useful because they allow us in evaluating how good are the clipping parameters.
In the
original tutorial we used the rejection maps to increase the signal-to-noise ratio of the combined image. In this way we achieved a combined image that has all strong points of both combination methods: the good pixel rejection of median combination and the high SNR of mean combination. The results of this method are usually better than the results of most sigma-clipping implementations, but only for small sets of images.
Scripts are extremely powerful in PixInsight. To run this script, do the following:
- Copy the source code.
- Open the Script Editor window in PI
- Select New > JavaScript Source File
- Paste the source code.
- Open your images. They must be registered and have all the same dimensions. Change their identifiers so they have a common prefix and a running postfix, starting from "_1". For example: NGC1234_1, NGC1234_2, NGC1234_3, ... and so on.
- In the script, change the value of BASE_ID from its original value ("ngc7000") to your prefix ("NGC1234" in the example above).
- Set IMAGE_COUNT to the number of images. Must be larger than 3.
- The KAPPA_BRT and KAPPA_DRK values are the pixel rejection points for bright and dark pixels, respectively. They must be fine tuned by trial-error. A lower kappa means more rejected pixels. You must find the largest values able to clip out all hot/cold pixels, gamma rays, plane trails, etc.
- To run the script, select Execute > Compile & Run from the Script Editor (or press F9). When you're asked to save the script, use any location and name you like (e.g. "kappa-sigma" is a good choice).
Have fun!
If you want to speed up the script to find KAPPA_BRT and KAPPA_DRK, you can use a small preview defined in all images (warning: it must have the same position and dimensions in all images). To use this option, change this line in the script:
#define PREVIEW_ID Preview01
assuming that the preview's id is Preview01.
It seems tricky and complex, but believe me, once accustomed it's quite easy to use.