Siril Scripts - Help writing the Script

Can someone help me to write a script for processing images in Siril, please?

I can successfully process manually Light and Flat Frames I would like to in Siril but to make the process easier and quicker I have been trying to write the script but I could not work it out.

The following are the steps I do when I process my images manually.

Step 2: convert the PNG files (into a series of FIT) of Light Frames

In the Conversion tab, add the .PNG (any format) files, give the Sequence name (e.g. “moon”), file converting file format to FITS images and Convert.

This will create the sequence moon_seq

Step 3: convert the PNG files (into a series of FIT) of SkyAutoFlat Frames

In the Conversion tab, add the .PNG (any format) files, give the Sequence name (e.g. “SkyAutoFlat”), file converting file format to FITS images and Convert.

This will create the sequence SkyAutoFlat_seq

Step 4: create the Synthetic Flat (“SkyAutoFlat”)

Go back to the Sequence tab and re-select the original SkyAutoFlat_seq

On the Stacking tab, select Median stacking and No normalisation, then Start stacking

In the Command line, type “save SkyAutoFlat” to apply save the result

Step 3: apply the Sky-Auto-Flat correction

Go back to the Sequence tab and re-select the original moon_seq

On the Pre-processing tab, select Use Flat and choose the SkyAutoFlat.fit file

Make sure that Auto-evaluate nominalisation is ticked

Untick Equalize CFA

Click Start pre-processing: this will create a new sequence pp_moon_seq

Step 4: stack the corrected sequence

On the Stacking tab, now select Sum stacking and Start stacking

This creates the file pp_moon_stacked.fit

Hello, I think something like this should work, starting with two sibling directories named ‘lights’ and ‘flats’:

cd flats
convert SkyAutoFlat
stack SkyAutoFlat med -nonorm

cd ../lights
convert moon
preprocess moon -flat=../flats/SkyAutoFlat_stacked
stack pp_moon sum

I guess that you already know that using PNG for input files is not a good idea because of the compression and the fact that it’s color images?
You might add a registration step between calibration and stacking too.

Hi Vincent,

Thank you so much for helping me to write this script. I am very happy to have this.

Regarding the format of the images, yes you are right and thank you for suggesting me but the purpose I take images for is capturing the moon at the time of conjunction and those who have been successful told me to take images in png format. I use Monochrome CMOS camera to takes images of the sky.

  1. When the script finishes running, I have to manually open the result file, is there a code that opens the result file in Siril so the file is ready to manually enhance the image?

  2. I am not sure how to apply the following two things through the script in the Sky-Auto-Flat correction.
    Make sure that Auto-evaluate nominalisation is ticked
    Untick Equalize CFA

I have a little bit amended the script you wrote but could you help me two following points, please

Convert Light Frames to .fit files

cd lights
convert moon -out=…/process

Convert Flat Frames to .fit files

cd …/flats
convert flat -out=…/process

create the Synthetic Flat SkyAutoFlat

cd …/process
stack flat med -nonorm

apply the Sky-Auto-Flat correction

cd …/process
preprocess moon -flat_stacked

stack the corrected sequence

cd …/process
stack pp_moon sum -out=…/result

cd …
close

Looks good, make sure it’s .. not ... :slight_smile: .. is the parent directory, ... would be a directory name.

For question 1, yes you can add a new line load pp_moon_stacked at the end. Don’t add the close.
For question 2, auto-evaluate normalization is the default, and equalizing CFA is not provided in the options of preprocess, so acts like unticked.

Thank you so much Vincent. All worked and made life a lot easier