Processing astrophotos is a time-intensive process. In addition to the hours spent capturing images, more time is required to process them into a beautiful final image. Many of these steps must be performed manually because they require setting adjustments based on the object captured and imaging conditions. However, a few steps, especially during preprocessing, can be automated with the PixInsight Weighted Batch Preprocessing Script.

The astrophotography processing workflow can be broken down into three main phases:

  1. Preprocessing
  2. Linear processing
  3. Non-Linear processing

For preprocessing, the basic flow is to align and stack the individual images into a single image for each filter. But there are many more intermediate steps that should be included. And in most cases, these steps are always performed the same way regardless of the object imaged. (1. Image Calibration, 2. Cosmetic Correction, 3. Subframe Selector, 4. Star Alignment, 5. Local Normalization, 6. Image Integration, 7. Drizzle Integration)

For a while, PixInsight included a Batch Preprocessing script. This was helpful, but it didn’t have the capability to handle every part of a normal preprocessing workflow. However, around 2021, the Batch Preprocessing script received some very welcome enhancements that incorporates all parts of a preprocessing workflow. The Weighted Batch Preprocessing Script requires minimal configuration before letting it perform the preprocessing steps, which can often take hours.

Prerequisites

Before beginning, a Cosmetic Correction icon must be available within the PixInsight workspace so it can get incorporated into the script. To create the icon, simply figure out the Cosmetic Correction settings, then drag the triangle (lower-left corner of the wizard) onto the workspace. It is a good idea to label the icon after creation.

Overview

The Weighted Batch Preprocessing script (Script – Batch Preprocessing – Weighted Batch Preprocessing) might take a few moments to load, especially if it was already loaded and populated with files.

The wizard is broken down into

  • Bias: Provides the configuration parameters to create a master bias frame.
  • Darks: Provides the configuration parameters to create a master dark frame
  • Flats: Provides the configuration parameters to create a master flat frame.
  • Lights: Provides the steps on creating a master light frame. This uses the Image Calibration, Cosmetic Correction, Subframe Selector, Star Alignment, Local Normalization, and Image Integration steps of the manual preprocessing workflow.
  • Calibration: The calibration panel provides details how the bias, dark, flats, and lights are integrated into master images.
  • Post-Calibration: The post-calibration panel provides configuration options for Drizzle Integration
  • Pipeline: Provides an overview of all preprocessing steps, including estimated disk space requirements per step.

The script does have the intelligence to identify and categorize these files into the appropriate buckets when using the Files button, but this is often based on file and folder names. It is often safer to select these categories (Bias, Darks, Flats, and Lights button) manually.

Bias

The first step is to add the Bias frames into the script, which is a specific type of calibration frame used to correct for electronic noise inherent to the camera sensor.

If individual frames are added, the weighted batch preprocessing script will integrate those separate files into a single master bias image. If a master bias is added, the script will use the master bias image as-is with no further processing.

The Image Integration section of the Bias tab details how the bias images are integrated into a single master bias frame. Typically, these settings can be left at the defaults.

Darks

The next step is to add the Dark frames into the script, which addresses noise generated due to heat from the camera. The longer duration of an exposure, the greater the heat build up, which translates into unwanted variations in pixel intensity.

Just like the Bias section, if individual frames are added, the weighted batch preprocessing script will create a master dark frame. If a master dark is added, the script will use the master dark image as-is with no further processing.

The Image Integration section of the Dark tab details how the dark images are integrated into a single master dark frame. Typically, these settings can be left at the defaults.

Note: The Exposure tolerance setting tells the script that any image within the defined number of seconds should be considered the same. An image at 595 seconds will get integrated with an image at 604 seconds. If you are using Dark Flats, you will want to move the exposure tolerance to zero so that it creates dark flats per filter exposure as dark flat exposure difference are sometimes less than 1 second.

Flats

Flat frames are added to help compensate for uneven illumination that could be caused by vignetting or dust. A master flat frame is required for each filter.

This is where your file/folder naming structure is useful. Because if the files are labeled with the word Flat and the Filter name, the preprocessing script is able to group the files together by filter and create master flat frames for each filter.

Lights

Finally, the light frames are added.

Having the filter name within the file name allows the preprocessing script to group images by filter.

The Lights tab, provide many additional options regarding calibration and integration.

  1. Subframe weighting. This aligns with the Subframe Selector process where each frame is graded and weighted based on the quality. Different weighting options are available, but PSF Signal Weight often works well.
  2. Astrometric Solution: This will try to platesolve the image. Although this can save a little time later, image solving often requires adjustments to the configuration. It is typically best disable this option. If it is enabled, it is good to deselect the “Interactive in case of failure”. When enabled, the script will pause, waiting for user input when the image solve process fails.
  3. Local Normalization. This aligns with the Local Normalization process. It is typcially a good idea to have local normalization be based on a set of integrated images versus a single frame. By selecting Normalization parameters, the Reference Frame Generation option is available to set to Integrate of Best Frames. When using best frames, also define the maximum number of frames to use. Around 10% is a good number.
  4. Image Integration: This aligns with the Image Integration process. In most cases, these settings can be left as default.

Calibration

With the frames added, it’s worthwhile to verify the settings the preprocessing steps in the Calibration tab.

Verify the following items:

  • Bias: All bias images should be contained within the summary
  • Dark: All dark images should be contained within the summary
  • Flat: All flat images for the different filters should be included.
    • If Bias frames are used, the Bias column should have a green check.
    • If Dark Flats are used, the Flat column should have a check.
    • Selecting Show Calibration Diagram, provides information on how the master flat frame is created.
  • Light: All light images should be broken up into the different filters.
    • If Bias frames are used and not already subtracted from the flats, the Bias frame column has a green check.
    • If dark frames are used, the Dark column should have a green check.
    • If Flats are used, the Flat column should have a check.
    • Selecting Show Calibration Diagram, provides information on how the master light frame is created.
    • If the light frames don’t have the correct darks or flats assigned, they can be manually selected within the Calibration Settings section of this screen.
  • Cosmetic Correction:
    • If a Cosmetic Correction template is setup within the workspace, select it within the Cosmetic Correction selection.
    • If Cosmetic Correction is used for all light images, select the button Apply to All Light Frames

Post-Calibration

If Drizzle Integration is going to be applied to the light images, select it in the the Post-Calibration tab.

To enable Drizzle Integration

  • Select Enable
  • Increase the scale, most likely a value of 2
  • Select Apply to all groups

Note: When enabling drizzle and setting the scale value, the screen might freeze for a few minutes as it recomputes.

Pipeline

When all configuration items are complete, select the Pipeline tab. This provides an overview of the entire script process and estimated disk space (it will be a lot)

Run

Before hitting Run, check the following

  • Output Directory: Select the output directory for the weight batch pre-processing script.
  • Registration Reference Image: Select to Auto to let the script determine which frame should be used as the reference.
  • Diagnostics: Select the diagnostics button. This does a pre-check on the config to make sure nothing has been missed

If everything looks good, select Run and walk away for a few hours.