Hi all,
I'm working on a new image, but the CCD camera is getting very old, so it has a sensor plenty of defects. To remove these defects I had to write some scripts. I'll be writing an online article about the scripts in early June. The scripts don't have a GUI at this moment (and I have no plan to add it, I simply don't have the time). So anybody is welcome to code it. :-)
The attached image shows an integration of all the H-alpha exposure without alignment. This image increases the signal to noise ratio of all the defects in the image, which are the following:
- The top and bottom dark bands are some sort of gradients introduced (I guess) by the amplifier. These gradients vary in intensity from frame to frame.
- The diagonal dark structure at right bottom is an RBI residual coming from the flats on the afternoon. This planetary nebula has an extremely low surface brightness, and shooting with RBI supression would increase the background noise, so always do a regular readout. The problem is that you can have an RBI residual of varying intensity in certain frames.
- The CCD has a lot of entire and partial defective columns. More of 10% of the columns are now defective, which means that you cannot use CosmeticCorrection because you would be painting a lot of data...
These are the scripts I've developed:
PatternSubtraction script:
Script to subtract a fixed pattern from an image. This script can correct the active image or a list of images in an specified input directory.
To correct the RBI residual signal, I made a master dark with RBI-cancellation readout. Then, you remove the small-scale components with MMT. This image will work as the pattern reference. The script can be applied to the active image or a list of images in an input directory. In any case, you need to open the processed pattern reference image and specify its identifier in the script setup. The script works by progressively subtracting the pattern from the image until it finds a minimum in the noise measurement. I'm also attaching the RBI pattern reference image.
LinearDefectDetection script:
Script to detect defective columns or rows in a reference image. It can detect entire or partial defective columns or rows. The best approach to detect these line defects is to use an integrated image of non-aligned images. This way, we increase the signal to noise ratio of the lines, which is crucial to be able to detect them above the noise floor. This wouldn't be possible in a single subframe because most of the defects are well below the noise of the image and they only appear as diffuse lines in the integrated image. So, first you need to generate this kind of master image. The script will be always applied to the active image. It takes its time to finish since the algorithms are complex, but the time is well worth and it's a one-time process.
PartialLineDetection script:
A stand-alone version of the partial line detection function. It's always applied to the active image, which should be an integrated image of the subframes without alignment, in the same way as in the LinearDefectDetection script. It writes a CosmeticCorrection-compatible defect table as well.
LinearPatternSubtraction script:
Script to correct residual column or row patterns in an image. It can read the previously generated defect table and correct the defects on the active image or in an image list. It is possible to correct all the entire columns or rows in an image and, at the same time, correct the specified defects in the defect table.
The script writes a CosmeticCorrection-compatible defect table to disk. You can then use this table in CosmeticCorrection, but it better (IMHO) if you use this table to correct the defects with LinearPatternSubtraction.
All these scripts are configured by modifying the properties of the Config function. If you want to give it a quick try, open the LinearPatternSubtraction script in the script editor. Set the correctEntireImage property to true, don't specify a defect list in the partialDefectsFilePath property, and modify the backgroundReferenceLeft, backgroundReferenceRight, backgroundReferenceTop and backgroundReferenceBottom properties to select the right area in your image. Then, hit F9 to apply the script to the active image. It will correct and vertical banding in your image.
The scripts I'm sharing solve all the problems above. Feel free to contribute. I guess my code won't be very smart since this is my first time programming in an object-oriented language (my only experience up to now was shell scripting). But the code is very well commented and documented. PLEASE READ THE INCLUDED DOCUMENTATION!
Feel free to ask anything about the scripts and how to set them up.
Thanks,
Vicent.