Manual pre-processing

By Dominique Dhoosche

Introduction

In this tutorial, we will study the pre-processing process of an astro image taken with a digital camera (DSLR), but the processing of images from astronomical cameras is almost identical. Of course, Siril comes with scripts that perform this process automatically. However, in a number of cases, you will need to perform manual processing:

  • You want to understand what the scripts do: the best way is to do manual pre-processing!
  • You want to refine the pre-processing: scripts use default values that can be optimized
  • Your images contain gradients that are difficult to remove during processing. It is very interesting to remove them on raw images: the gradient is simpler and easier to eliminate.
  • You’re missing flats: of course, this is formally discouraged, but photography sessions don’t always go as planned!
  • And many other reasons… that belong to you :-)

Files used

For this tutorial, we will assume that you have images of the object, biases, flats, and darks.

File organization

It is better to organize your files in different subfolders. We will follow the subfolders used in the scripts: lights for images, biases, darks, and flats for calibration images.

Pre-processing principle

The image calculation is done by the following formula:

$\frac{\text{image}-{\text{dark}}-\text{bias}}{\text{flat}}$

By principle, biases are contained in all the images we have taken: the lights of course, but also in the darks and flats. We will therefore need to remove the biases from the darks and flats to use these calibration images. But let’s analyze this formula. We see that:

$\frac{\text{image}-{\text{dark}}-\text{bias}}{\text{flat}} = \frac{\text{image}-({\text{dark}}+\text{bias})}{\text{flat}}$

We notice that it’s enough to subtract UNPROCESSED darks (which also contain biases) to remove both the dark AND the biases at once: saving work and time!

To pre-process the images, the proposed workflow is as follows:

  1. Set the working directory.
  2. Convert the files.
  3. Know the bias value of your DSLR or camera (or create the master bias (or bias).)
  4. Create the master flat, by subtracting the master bias.
  5. Create the master dark, without subtracting the master bias.
  6. Calibrate the images, with master flat and dark.
  7. Process gradients.
  8. Align the images.
  9. Stack the images.

Set the working directory

Set the working directory.

Set the working directory.

  1. Click on the Home icon
  2. Search for the folder where the images are located, then create a work folder (scripts create a process folder)
  3. Double-click on the work folder to enter it
  4. Validate

All images will now be saved in this folder

Convert files

Convert your files

Convert your files

Siril works with files in FITS format (Flexible Image Transport System). You must therefore convert your raw files. For people who have FITS images from dedicated cameras, conversion is not necessary but renaming is. It is also possible to create a sequence without copying files but by creating symbolic links. An explanation for doing this under Windows is given here .

  1. Click on the Conversion tab
  2. Click on +
  3. Search for the folder where the images to convert are located (by default, we are in the working directory)
  4. Select the images to convert
  5. Add
  6. Give a generic name to the images to convert (lights, flats, …). Siril adds a number after this name to differentiate the images, and this allows sequence creation.
  7. Check that the Debayer option is unchecked (we will do debayering later)
  8. Click on Convert

Siril converts the images to .fit format in the default folder. Then repeat the same process with lights, flats, biases, and darks, giving each a descriptive generic name.

Sequences

A word about sequences, very important in Siril. A sequence is a series of coherent images: the images, darks, biases, etc. These sequences are listed in small files with the .seq extension. Thus, when you convert bias images giving them as sequence name: Bias, the converted images have the names Bias_00001, Bias_00002, Bias_00003, etc. The corresponding sequence name is Bias and is contained in the Bias.seq file that we recommend never editing manually.

It is quite possible to have several sequences in the same folder. However, always remember that you must ALWAYS choose the working sequence before processing. Most often, by default, Siril loads the last calculated sequence, but keep this in mind!

In the Sequences tab, the Search sequences button analyzes your folder and searches for sequences:

Search sequences

Search sequences

Biases

Frankly, use synthetic bias, you’ll avoid adding noise to your images. See this tutorial .

If you really can’t find your synthetic bias, then take bias images.

Process biases

Process biases

  1. Click on the Sequences tab, then choose the bias sequence.
  2. Click on the Stacking tab.
  3. Set the parameters as above.
  4. Click on Start stacking.

The calculation starts, Siril displays the console where you can follow the operations performed.

Once the calculation is finished, verify that the rejection rate is between 0.1 and 0.5%. These values are completely arbitrary and allow beginners to get an idea. It’s not necessary to insist on getting a value below 0.5%: a value of 1% may be just as good. Just keep in mind that you need to check this rejection rate, and if it has an aberrant value, redo the stacking by changing the Low/High Sigma values.

Check rejection rates

Check rejection rates

ATTENTION: when you increase a sigma factor, you lower the rejection rate!

At the end of the calculation, Siril displays the stacked image. It is saved here as Bias_stacked.fit

Flats

Calibrating flats

Process flats

Process flats

  1. Click on the Sequences tab, choose the flat sequence.
  2. Click on the Calibration tab.
  3. If you know your sensor’s bias value, enter this value preceded by the = sign (for example, for this DSLR =2048). Otherwise, indicate the path to the master bias.
  4. Set the other parameters as above. If, due to too long exposure time of your flats (several tens of seconds), you have taken dark flats, you will need to convert them, calibrate them, stack them to obtain a dark_of_flat_master (see the dark chapter below). You can then check “use dark” and indicate where the dark_of_flat_master is located. You can also enable “Cosmetic correction”
  5. Click on Start calibration.

Siril subtracts biases from flats and creates as many processed flat files by adding the prefix pp_ to file names. You can of course change the prefix (pp_ = pre-process in English).

Creating the master flat

Stack flats

Stack flats

  1. Click on the Sequences tab, then choose the preprocessed flat sequence (normally, it’s already loaded at this stage).
  2. Click on the Stacking tab.
  3. Set the parameters as above.
  4. Click on Start stacking.

Siril stacks the biases and creates the file with the defined name. As with biases, verify that the rejection rate is between 0.1 and 0.5%. If the values are aberrant, redo the stacking by changing the Low/High Sigma values. When you increase a sigma factor, you lower the rejection rate!

Darks

Stack darks

Stack darks

As we saw above, we won’t remove biases from darks. Let’s proceed directly to stacking.

  1. Click on the Sequences tab, then choose the dark sequence.
  2. Click on the Stacking tab.
  3. Set the parameters as above.
  4. Click on Start stacking.

Siril stacks the biases and creates the file with the previously defined name (here Dark_stacked.fit, but you can give it any name you want).

As with biases, verify that the rejection rate is between 0.1 and 0.5%. If the values are aberrant, redo the stacking by changing the Low/High Sigma values. When you increase a sigma factor, you lower the rejection rate!

Images

Calibrate images

Pre-process images

Pre-process images

  1. Click on the Sequences tab, then choose the raw image sequence.
  2. Click on the Calibration tab.
  3. Set the parameters as above.
  4. Click on Estimate to know the number of pixels corrected by cosmetic correction. If one of the numbers turns red, change the sigma value. If the value remains red despite sigma value changes, then you can uncheck the corresponding cosmetic correction (hot or cold pixels).
  5. Click on Debayer before saving to convert images to color.
  6. Click on Start calibration.

Siril processes the images with darks (and the biases they contain) and flats and creates as many processed image files, with the prefix pp_ (which you can change).

Gradient removal

If your images show a gradient, usually due to light pollution or the Moon, it’s very likely that this gradient evolves during your session and therefore the appearance changes on your images, especially if you’ve been imaging for several hours. It’s then much better to remove this gradient directly on raw images. Indeed, stacking would make this gradient much more complex to eliminate later.

Remove gradient

Remove gradient

  1. You’re now used to it, check that you’re working on the calibrated image sequence
  2. Menu Image Processing -> Background Extraction....
  3. A window opens. We will place measurement points, Siril calculates the sky background level under these points, and deduces a polynomial interpolation of the gradient: a synthetic sky. The first thing to set is the interpolation method, which we’ll choose “Polynomial” of order 1 because as we said, the gradient shape is simpler on individual images. Then we give the number of points to position on a horizontal line. Here, I kept the proposed value at 20. We can also limit tolerance so that Siril doesn’t position too many points near the nebula. Then click on Generate. Siril then positions the calculation points (squares): you can remove some (right-click on a square) or add some (left-click in the image where you want to add it).
  4. For light pollution gradients, the correction type to choose is Subtractive.
  5. Don’t forget to check Apply to sequence, and here too, you can choose an output prefix for the new image sequence that is created. Click on Apply. Siril then recalculates a new image sequence freed from the gradient.

It may be necessary to redo gradient extraction during processing, but this will then be much simpler to achieve.

Platesolving reference image

This step is optional, but it will help improve image stacking.

Astrometry

Astrometry

  1. Check that we’re working with the right sequence
  2. Menu Tools -> Astrometry -> Astrometric resolution
  3. A new window opens. Enter the name of the object, and click on Search. The coordinates and object name appear below
  4. Enter the focal length of your telescope or lens, and the pixel size of your imager.
  5. Check Auto-crop if the image is a wide field.
  6. Click on OK. The astrometry process begins.
  7. To verify it, click on this icon. The object references will appear in green in the image

Image alignment

Pre-process images

Pre-process images

  1. Click on the Sequences tab, then choose the pre-processed raw image sequence.
  2. Click on the Registration tab.
  3. Set the parameters as above. Indicate that distortion correction should be done from the images on which we performed astrometry previously.
  4. Click on Go register.

Siril aligns the images, corrects their distortion, and creates as many aligned image files, with the prefix r_ (which you can change in box 4).

Image sorting

It’s time to check the quality of your images and eliminate the worst ones.

Image verification

Image verification

  1. As usual, check the sequence you’re working on (if you just aligned, no need to check, Siril will have chosen the aligned sequence)
  2. In the Graph tab, Siril shows a quality graph of the loaded sequence images.
  3. You can set the X and Y axis values here using several parameters: FWHM, Roundness, wFWHM, background value, etc. This allows you to analyze your images under several parameters.
  4. To eliminate the worst from the sequence, right-click on an image with high FWHM and confirm “Exclude image XX”.

Image stacking

Stack images

Stack images

  1. Click on the Sequences tab. And choose the aligned image sequence.
  2. Click on the Stacking tab.
  3. Set the parameters as above. You can choose a weighting factor for images based on the number of stars detected during alignment, wFWHM, noise, or integration time.
  4. Click on Start stacking.

Siril stacks the processed images and creates the file with the defined name. As before, verify that the rejection rate is between 0.1 and 0.5%. If the values are aberrant, redo the stacking by changing the Low/High Sigma values. When you increase a sigma factor, you lower the rejection rate!

What’s next?

This is the end of pre-processing with a clean, but still linear image. Don’t be surprised if it’s still all black, that’s normal! Processing remains to be done, but that’s beyond this tutorial. :-)