In a previous article, I showed you how to use PixInsight’s CosmeticCorrection process to remove column defects from an image. In that article, you had to determine the location and length of defects as input to the CosmeticCorrection process.

In this article, I demonstrate a method where PixInsight automatically detects column defects for you, and I show you a second method to remove column defects using the built-in LinearPatternSubtraction script.

Preparation

You should have your calibrated images available to you. In the case of Slooh.com images, you download your FITS files (they are already calibrated for you by Slooh.com).

Once you have your FITS files available, we’re going to use the ImageIntegration process to integrate/stack your images. Do not use StarAlign to align your images first because StarAlignment changes your images and moves the defects around your image.

You can integrate all of your images, regardless of the filter that was used at the time the image was captured. The idea is to create an image where all of the column defects are present and stacked to make them appear above the noise threshold of your images.

Once you have integrated your images, you are left with a single image that has all of the column defects on it.

Using LinearDefectDetection To Detect Column Defects

Now that you have your integrated image available, you can use the LinearDefectDetection script (located under Script – Utilities) to detect defects automatically.

Choose an output directory, leave the settings at their default values, and click Run to execute the script.

The script will produce some images, and you can safely discard those. The output directory you selected will contain a text file containing the locations of the column defects on your image.

Using CosmeticCorrection

You can use CosmeticCorrection with the text file that was created in the preceding step. Open the CosmeticCorrection process, click the Use Defect List option, click Load next to the list and load the file that LinearDefectDetection created.

Add your FITS files to the upper part of the CosmeticCorrection process, choose an output folder, and click the Apply Global button to execute the process.

The process creates files ending in _cc by default in the output folder you selected.

Note that the CosmeticCorrection process corrects the column defects by using the values of pixels surrounding the column defect to replace bad pixels. This may leave artifacts on your image, so you can use an alternate method that uses statistical analysis to replace bad pixels.

Using the LinearPatternSubtraction Script

Start the LinearPatternSubtraction script, located under Script – Utilities. Add your FITS files by clearing the checkbox labeled ‘Target is active image’ and use either the Add Files or Add Directory button to add your files.

1. Select an output directory where the corrected files will be written.

2. Put a checkmark next to the ‘Correct columns’ and ‘Correct the entire image’ options.

3. Select the Defects file created by the LinearDefectDetection script

4. Leave the other options at their default values

5. Click Run to execute the script

This script produces some images which you can use for other purposes, and you can safely discard them if you feel you don’t need them.

Your corrected files will be in the output folder.

Continue with Usual Processing

Now that you have the corrected files in hand, either from CosmeticCorrection or LinearPatternSubtraction, you can resume your usual processing steps starting with StarAlignment and followed by all of your other processing steps.

Note that the column defects have been repaired at this point.

Conclusion

In this article, you learned how to detect column defects in your images automatically. You also learned how to use the CosmeticCorrection process and LinearPatternSubtraction script to remove column defects; each process uses a different method to remove column defects.

Complete PixInsight Processing Workflow

This article provides you with a complete PixInsight processing workflow and explains each step in detail.