How to create directory containing only calibrated lights with Siril scripting?

I’ve been trying to write my own Siril script which will take my lights and eventually dump the final calibrated lights in a separate directory, but I’ve been struggling to do this without also copying some intermediate file that is not the calibrated light. It seems to me that the key issue is that I can’t run the preprocess command with an -out=directory option, but maybe there’s some way for me to achieve what I want that is not obvious to me?

It’s really convenient for me to have a totally separate output directory containing only the calibrated lights so I can easily merge multiple nights of lights to stack. Having other files that are not the calibrated lights requires me to manually go into directories and move the calibrated lights.

Here is a typical directory tree I have from NINA that I use:



2022-12-18/Horsehead Nebula/L/DARKFLAT/
2022-12-18/Horsehead Nebula/L/FLAT/
2022-12-18/Horsehead Nebula/L/DARK/
2022-12-18/Horsehead Nebula/L/LIGHT/

2022-12-18/Horsehead Nebula/B/DARKFLAT/
2022-12-18/Horsehead Nebula/B/FLAT/
2022-12-18/Horsehead Nebula/B/DARK/
2022-12-18/Horsehead Nebula/B/LIGHT/

2022-12-20/Horsehead Nebula/L/DARKFLAT/
2022-12-20/Horsehead Nebula/L/FLAT/
2022-12-20/Horsehead Nebula/L/DARK/
2022-12-20/Horsehead Nebula/L/LIGHT/

2022-12-20/Horsehead Nebula/B/DARKFLAT/
2022-12-20/Horsehead Nebula/B/FLAT/
2022-12-20/Horsehead Nebula/B/DARK/
2022-12-20/Horsehead Nebula/B/LIGHT/

What I want in the end is something like this:

2022-12-18/Horsehead Nebula/L-CALIBRATED/
2022-12-18/Horsehead Nebula/B-CALIBRATED/

2022-12-20/Horsehead Nebula/L-CALIBRATED/
2022-12-20/Horsehead Nebula/B-CALIBRATED/


way I would do it is, based on your example, say for your Lum layer:

  • cd to 2022-12-18/Horsehead Nebula/L/LIGHT/
  • convert light -out=../../L-CALIBRATED
  • cd ../../L-CALIBRATED
  • preprocess light -dark=../L/DARK/ -flat=../L/FLAT/ .... (I leave it to you adding the other options as required)
    You would have as well as files in L-CALIBRATED folder, but the light_*.fit would only be symlinks, so not using space. You could also dispose of them with a line of Python if required.

Now, way I would do it if I was to choose the filing:

  • create the sessions with date and object fields inverted, say Horsehead Nebula/2022-12-18/L
  • do the same as above but when running convert, specify at which number to start with -start= option, based on the number of files already present in L-CALIBRATED
    And then, you have everything already grouped when you want to run registration for all the sessions.



Yeah, it seems like I’ll have to just delete some intermediate files with a script. It would be awesome if the preprocess command could have -out=directory, but I’ll just write some bash or python script to clean things up for now. Thanks!