Automatic post-processing through scripts

The use of scripts to pre-process raw and fit files is a real plus of Siril.
I use it constantly to obtain a result.fit file.
Then I post-process this file also with Siril, following the steps described in https://www.youtube.com/watch?v=nuM9OhIq4CQ (in French).

Here is a summary of the different steps:
- Open result.fits file with Siril
- Visualization : Autostretch from the dialog box (preserves a linear image)
- Image Processing > Color Calibration > Photometric Color Calibration
- Image Processing > Histogram Transformation / Apply Autostretch Algorithm to Image + Apply
- Image Processing > Color Saturation
- Image Processing > Remove Green Noise
- Image Processing > Deconvolution
- Crop the image if necessary (on a Mac, tap three fingers on trackpad)
- Image Processing > Background Extraction + Generate + Apply
- Save File > Supported Image Files > TIFF Files (.tif)

Then I finish the processing of the .tif file with GIMP to obtain the final .jpg file.

Most of the time I am satisfied with the Siril post-processing without having to modify the parameters.

My question : Would it not be possible to compile these post-processing steps (described above) into a script ?

Thank you

Not for all.
Some of the tools you use need user intervention.
So you cannot script them. Like the photometric color calibration.

and you are supposed to crop the stacked image to remove the black borders, they can cause some algorithms to fail, and for now we don’t have an automatic way to do it.

1 Like

I agree with lock042 and vinvin that the photometric color calibration and the image cropping need a manual intervention.
However the photometric calibration is at the very beginning of the post-processing sequence and could thus be excluded from the script, and the image cropping is not always necessary .
A standard post-processing script would immediately provide the Siril user with a final image without hassle.
If the user would not be satisfied with the result, he/she could of course return to the manual mode.

OK but a lot of other tools are already scriptable.

Not sure if this thread is still open, but all this is a good question and I have the same need.

I want to be able to automate (completely) the post-processing steps. I am willing to accept a “sub-optimal” result from a script that would have to be done again manually, just allow me to automate the whole process.

Why does photometric color calibration require user intervention? I know my target before I run the script (generally), and could “take the first result” from the search function, or better let me give the coordinates directly from another source if needed.

What about providing arguments to features like autostretch or others? Let me autostretch 95% of the curve or some other parameter (essentially provide parameterization for all functions, but have a default set you use today).

For example, crop provides options of coordinates and I can “script” that function (I know my camera and guiding enough that I could crop 3 pixels per side by “default” for my setup).

My use case is to have roughly 10-14 targets available after an imaging session, possibly with several exposure settings (20 sec subs and 60 sec subs). This means I have 30 images to generate to see how the night went. I can pre-process using siril-cli with the preprocessing script. I can write my own post-processing steps (similar to the above), just not all of them like color calibration.

Because it does not work everytime and user intervention is often needed. Like “playing” with focal length.
For me that makes sense to automate preprocessing because it is always same steps. However, for processing no. I do not agree.

Autostretch has already arguments. You can use it in command line. Like crop, and many other functions.

understood about intervention, but still would think this is useful, and thanks for the reply. I think the key for putting these things in scripts is that it enables repeat or “improved” processing as we learn more.

1 Like

Perhaps a “Prompt” call to open a window that allows interaction with the user ? Asks a question and passes the required parameter in order to fulfill the request… Probobly opens a pandoras box but just a thought.

Clear Skies !!

putting prompt to force user would be one option, but still requires the user, and then continue has to be managed.

per my use case above my problem is I collect > 10 targets per night each with LRGB or HOS filters (maybe 10-40 min per target/filter). I can do many of the items through scripts and get a result.fit file for each filter for each target, but serveral items, like RGB composition, photo color cal, etc require user interaction. WHy not get a general capability to allow me to pass in inputs to these functions? Example — for RGB composition I pass in list of result.fit files, select some area, align, save result). Of course there are non-happy path items and checks, but this as a minimum would allow me to get an RGB for each of my 10 targets. I can go back after the script runs and find out that 7 worked and 3 failed, and then go into those 3 and do manually.

for the other example, PCC has a button now to “get from file” and since Siril 1.0 this is working great for RGB combine images (put still begs the question – why do I need to push this? – put as an option for the script and allow me to say “get from file” in the script).

Loving this program by the way – I am an evangelist for Siril for sure and even with this automation challenge, it is the best available solution [PixInsight is my alternative, but very heavy for user interaction so is really specific to when I have gotten an image and decide to go back and redo better].

Hi, thanks for the message.
We have indeed planned to improve the RGB composition tool and making it available from the command line and scripts. The PCC could also be added as a command for images that already have basic information in the header, with the user providing only the target (or maybe we can find the target name in the header too).
Linear match is already available, histogram stretching can be done with asinh to some extent or in an auto-stretch way, this will not be ideal with automatic settings.
Thanks for the support!

It is not always simple. In many cases it is not enough and a selection must be done around the object to get a proper platesolve. I’m really not a big fan on the whole automation.
The main goal of Siril is to give nice picture, not a whole automation, that generally gives not optimal picture.
We spend a lot of hours capturing pictures, but processing need to take care too. PCC requires only a few clics that doesn’t hurt IMO.

1 Like

I really do understand the challenges, and understand that somethings require human interaction.

I also understand the desire to “give a nice pictures” vs automation

I feel there will always be a conflict between these two target audiences, I just happen to be on the higher automation side.

Part of my “initiial” astrophoto goal was to collect Messier and Caldwell objects, and doing that “reasonably”.

I am moving over to collecting more / longer data on the same object and this reduces to automation a little, but not to zero.

Keep up the great work on Siril – I really am a very thankful user and appreciate it.

Scott

One thing you can already do is use the mtf command to apply the histogram transform to your images. The parameters are the same as those given in the histogram transform tool GUI. Maybe if images are always taken in the same conditions you can have a decent result with the same parameters.

But the PCC is not at all available without user intervention for now.

ok, that is cool. I typically know what I want the output histogram to look like and the autostretch is too agressive for my taste and like to get a soft stretch. I will experiment with that and see what happens

Yes, indeed. A nice example of the automation issue IMO. This histogram should be stretched by hand, iteratively and smoothly with the sliders, by looking what’s going on. The autostretch button should be never used for production images.

I sort of understand why some ask why we want to sacrifice quality for automation. But that is was a huge part of humanity and life is all about. MP3 vs Records vs Tape. I as well would like to automate platesolving and the only thing i think that is stopping me is not being able to write the script to automatically add the RA and DEC (which BTW IS in the Fit Header) I am able to add these properties of the image to saving a file so siril can read that info and add to the script so curious if I just am not adding it properly. I have tried the following
platesolve image_center_coords=195.225 +27.773889 … other parameters
I have tried various formats comma colon space… with + w/o + %RA,%DEC
it just keeps saying Could not parse target coordinates command execution failed: invalid arguments… any help would be much apprecitated the values above i took from the header of the opened image my other parameters work without the coordinate…thanks Ken

Perhaps this is a question for the developers as I am stumped even after using my successful parsing commands of ran and decn. To get the info out of header (which is successful when saving for the file name

Hello, the plate solving process, or platesolve command, takes the coordinates from the FITS header, I don’t understand what you are trying to do but I feel you don’t need to do it.