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:

DATE / TARGET / FILTER / IMAGETYPE / imageXYZ.fit

Examples:

2022-12-18/Horsehead Nebula/L/DARKFLAT/darkflat000.fit
2022-12-18/Horsehead Nebula/L/FLAT/flat000.fit
2022-12-18/Horsehead Nebula/L/DARK/master-dark.fit
2022-12-18/Horsehead Nebula/L/LIGHT/light000.fit

2022-12-18/Horsehead Nebula/B/DARKFLAT/darkflat000.fit
2022-12-18/Horsehead Nebula/B/FLAT/flat000.fit
2022-12-18/Horsehead Nebula/B/DARK/master-dark.fit
2022-12-18/Horsehead Nebula/B/LIGHT/light000.fit

2022-12-20/Horsehead Nebula/L/DARKFLAT/darkflat000.fit
2022-12-20/Horsehead Nebula/L/FLAT/flat000.fit
2022-12-20/Horsehead Nebula/L/DARK/master-dark.fit
2022-12-20/Horsehead Nebula/L/LIGHT/light000.fit

2022-12-20/Horsehead Nebula/B/DARKFLAT/darkflat000.fit
2022-12-20/Horsehead Nebula/B/FLAT/flat000.fit
2022-12-20/Horsehead Nebula/B/DARK/master-dark.fit
2022-12-20/Horsehead Nebula/B/LIGHT/light000.fit

What I want in the end is something like this:

2022-12-18/Horsehead Nebula/L-CALIBRATED/pp_light000.fit
2022-12-18/Horsehead Nebula/B-CALIBRATED/pp_light000.fit

2022-12-20/Horsehead Nebula/L-CALIBRATED/pp_light000.fit
2022-12-20/Horsehead Nebula/B-CALIBRATED/pp_light000.fit

Hi,

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/master-dark.fit -flat=../L/FLAT/flat000.fit .... (I leave it to you adding the other options as required)
    You would have light_.fit as well as pp_light_.fit 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.

Cheers,

C.

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!