Jump to content

  •  

CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.

Photo

Siril Smart Telescope PreProcessing Script (Python)

  • Please log in to reply
52 replies to this topic

#1 naztronomy

naztronomy

    Vostok 1

  • *****
  • topic starter
  • Posts: 159
  • Joined: 11 Dec 2021
  • Loc: Boston

Posted 26 May 2025 - 02:32 PM

I turned my Seestar preprocessing SSF scripts into a python script that gives you more control and also lets you process Dwarf and Celestron origin images. Note: Origin images are currently not working, I'm looking into it. 

 

Screenshot 2025-05-25 151935.png

 

Here's a demo video on how this works: https://www.youtube....h?v=E_LIjdVQdSg

 

You can download the script here: https://github.com/n...t/siril-scripts

 

Python in Siril is still in beta so there are some workarounds I do in my code but so far it works really well. The video goes over some troubleshooting steps but if anyone tries and runs into issues, let me know. 

 

Future work includes adding calibration frames and more smart scopes to the list (and a better user interface). 


  • swsantos, Pinac, Stevan Klaas and 1 other like this

#2 lsjones

lsjones

    Sputnik

  • -----
  • Posts: 37
  • Joined: 26 Feb 2020
  • Loc: Denver CO

Posted 26 May 2025 - 06:57 PM

Could you point me to some documentation on setting up Python with Seril 1.4? I get a very general error message on start up and I'm out of ideas. I'm on Windows.



#3 naztronomy

naztronomy

    Vostok 1

  • *****
  • topic starter
  • Posts: 159
  • Joined: 11 Dec 2021
  • Loc: Boston

Posted 26 May 2025 - 11:06 PM

Could you point me to some documentation on setting up Python with Seril 1.4? I get a very general error message on start up and I'm out of ideas. I'm on Windows.

What error are you getting? One thing you can try is go to Scripts >> Python Scripts >> Siril_Catalog_installer.py. Running this script and installing the astrometry/spcc data fixes python issues. 

 

If that doesn't help, if you can send me a screenshot, I can take a look. 



#4 lsjones

lsjones

    Sputnik

  • -----
  • Posts: 37
  • Joined: 26 Feb 2020
  • Loc: Denver CO

Posted 26 May 2025 - 11:29 PM

After installing 1.4 and seeing Python fail I did a standard Python installation but it did not help. (Possible pathing issue?)

On startup I get this:

 

Initializing FFTW multithreading support...
log: Welcome to siril v1.4.0-beta1
log: Supported file types: BMP images, PIC images (IRIS), PGM and PPM binary images, RAW images, FITS-CFA images, Films, SER sequences, TIFF images, XISF images, JPG images, JPEG XL images, PNG images, HEIF images, AVIF images.
log: Setting CWD (Current Working Directory) to 'D:\_Session\Seestar\M 16 Eagle'
log: Parallel processing enabled: using 16 logical processors.
log: Color management active.
log: JPEG ICC profiles supported.
Siril bundle path: C:\Program Files\Siril
Bundle python path: C:\Program Files\Siril\python\python.exe
Python found in system: C:\Users\lsjon\AppData\Local\Microsoft\WindowsApps\python.exe
Python executable: C:\Users\lsjon\AppData\Local\Microsoft\WindowsApps\python.exe
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings

 

Any help appreciated. (I'm a little embarrassed to admit I was a UNIX/Linux admin for 20+ years, but sometimes Windows stumps me.)



#5 lock042

lock042

    Siril astronomical image processing software

  • -----
  • Vendors
  • Posts: 605
  • Joined: 03 Nov 2015

Posted 27 May 2025 - 12:43 AM

Go to the Siril's preferences: scripts tab.
At the very bottom (scroll if needed) click on "reset Python Venv"
  • naztronomy likes this

#6 JS04_Astro

JS04_Astro

    Lift Off

  • -----
  • Posts: 14
  • Joined: 13 Jun 2024
  • Loc: New York

Posted 27 May 2025 - 09:21 AM

would love to see Vaonis Scopes added to this script. used to use siril to stack a bunch of my Vespera Images.



#7 naztronomy

naztronomy

    Vostok 1

  • *****
  • topic starter
  • Posts: 159
  • Joined: 11 Dec 2021
  • Loc: Boston

Posted 27 May 2025 - 09:26 AM

After installing 1.4 and seeing Python fail I did a standard Python installation but it did not help. (Possible pathing issue?)

On startup I get this:

 

Initializing FFTW multithreading support...
log: Welcome to siril v1.4.0-beta1
log: Supported file types: BMP images, PIC images (IRIS), PGM and PPM binary images, RAW images, FITS-CFA images, Films, SER sequences, TIFF images, XISF images, JPG images, JPEG XL images, PNG images, HEIF images, AVIF images.
log: Setting CWD (Current Working Directory) to 'D:\_Session\Seestar\M 16 Eagle'
log: Parallel processing enabled: using 16 logical processors.
log: Color management active.
log: JPEG ICC profiles supported.
Siril bundle path: C:\Program Files\Siril
Bundle python path: C:\Program Files\Siril\python\python.exe
Python found in system: C:\Users\lsjon\AppData\Local\Microsoft\WindowsApps\python.exe
Python executable: C:\Users\lsjon\AppData\Local\Microsoft\WindowsApps\python.exe
Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings

 

Any help appreciated. (I'm a little embarrassed to admit I was a UNIX/Linux admin for 20+ years, but sometimes Windows stumps me.)

Adding to what Cyril said about resetting venv, I'd ask you to double check that "C:\Program Files\Siril\python\python.exe" actually exists. Python is bundled with Siril so you shouldn't need anything extra. This is just to make sure it's installed in the expected location.

 

And nothing to be embarrassed about! I work with both Linux and Windows and I mix them up all the time, especially when I'm doing things in command line. 


Edited by naztronomy, 27 May 2025 - 09:30 AM.


#8 lsjones

lsjones

    Sputnik

  • -----
  • Posts: 37
  • Joined: 26 Feb 2020
  • Loc: Denver CO

Posted 27 May 2025 - 09:53 AM

Thank you both for your help. That did not solve the issue, is this forum the proper venue to troubleshoot this?

 

I see that C:\Program Files\Siril\python does not exist. 

 

>where python, returns:

C:\Users\lsjon\AppData\Local\Microsoft\WindowsApps\python.exe
C:\Users\lsjon\AppData\Local\Programs\Python\Python313\python.exe

 

>python --version, returns:

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Apps > Advanced app settings > App execution aliases.

 

The preferences Scripts page has script locations as:

C:\Users\lsjon\AppData\Roaming\siril\scripts
C:\Program Files\Siril\scripts

 

My full PATH is a crime against humanity but does contain:

;C:\Users\lsjon\AppData\Local\Programs\Python\Python313\Scripts\;C:\Users\lsjon\AppData\Local\Programs\Python\Python313\;C:\Users\lsjon\AppData\Local\Programs\Python\Launcher\


Edited by lsjones, 27 May 2025 - 10:13 AM.


#9 lock042

lock042

    Siril astronomical image processing software

  • -----
  • Vendors
  • Posts: 605
  • Joined: 03 Nov 2015

Posted 27 May 2025 - 10:56 AM

If python does not exist please be sure to download the beta 2 version and to reinstall it.
  • lsjones and naztronomy like this

#10 lsjones

lsjones

    Sputnik

  • -----
  • Posts: 37
  • Joined: 26 Feb 2020
  • Loc: Denver CO

Posted 27 May 2025 - 11:44 AM

That was my next move. grin.gif

 

(ETA Predictably enough that seems to have solved the problem. Thanks for the help!


  • naztronomy likes this

#11 kabes

kabes

    Sputnik

  • -----
  • Posts: 29
  • Joined: 22 Sep 2009

Posted 27 May 2025 - 06:46 PM

I’ve been using your previous Siril 1.4 preprocessing scripts and it works well. Nice to see it in python form now. 
 

Curious what success people have had with drizzle above 1.0 on the Seestar and what settings were used. I tried a 2x but it created some odd noise patterns that looked like multicolored stars (and noise reduction would ignore it, thinking it’s data). Perhaps it’s the pixel fraction that needs to change? Haven’t experimented much with that yet. 



#12 Silent_Light

Silent_Light

    Viking 1

  • *****
  • Posts: 588
  • Joined: 26 Sep 2022
  • Loc: 8000 ft asl South Central Colorado

Posted 27 May 2025 - 06:51 PM

No idea if you can help....but I've noticed that the Seti Astro python scripts in beta 1.4 2 shut off my PC when they finish. Nothing has ever crashed my computer till now. Win 11 pro.

Is there something about the scripts that do that ? I'm no programmer and don't intend to be

#13 naztronomy

naztronomy

    Vostok 1

  • *****
  • topic starter
  • Posts: 159
  • Joined: 11 Dec 2021
  • Loc: Boston

Posted 28 May 2025 - 01:17 PM

I’ve been using your previous Siril 1.4 preprocessing scripts and it works well. Nice to see it in python form now. 
 

Curious what success people have had with drizzle above 1.0 on the Seestar and what settings were used. I tried a 2x but it created some odd noise patterns that looked like multicolored stars (and noise reduction would ignore it, thinking it’s data). Perhaps it’s the pixel fraction that needs to change? Haven’t experimented much with that yet. 

I tested 2x and 3x drizzle and I've seen some odd noise patterns but nothing bad enough that raised alarms. How many frames are you stacking? You'd normally need a lot of images for drizzle to be effective. I usually just stick with 1x drizzle. 

 

Siril recommends an inverse change for pixel fraction So if you do 2x drizzle, you're supposed to do 0.5px. I've experimented a bit with different values but haven't done an in-depth analysis yet. 

 

No idea if you can help....but I've noticed that the Seti Astro python scripts in beta 1.4 2 shut off my PC when they finish. Nothing has ever crashed my computer till now. Win 11 pro.

Is there something about the scripts that do that ? I'm no programmer and don't intend to be

It shuts your pc off? That is strange! I wonder if it's your GPU getting overwhelmed. Can you uncheck "use GPU" and see if that helps?



#14 Silent_Light

Silent_Light

    Viking 1

  • *****
  • Posts: 588
  • Joined: 26 Sep 2022
  • Loc: 8000 ft asl South Central Colorado

Posted 28 May 2025 - 02:45 PM

It shuts your pc off? That is strange! I wonder if it's your GPU getting overwhelmed. Can you uncheck "use GPU" and see if that helps?


It sure does ! With an 8gb GPU and 8 core pc processor I've never had any issues with graphics or stacking huge imaging data sets (imx571) once. Gaming on ultra mode has been seamless.

I'll have to figure out where "use gpu" even is.....

Has to be something in the script itself.

#15 naztronomy

naztronomy

    Vostok 1

  • *****
  • topic starter
  • Posts: 159
  • Joined: 11 Dec 2021
  • Loc: Boston

Posted 28 May 2025 - 03:12 PM

It sure does ! With an 8gb GPU and 8 core pc processor I've never had any issues with graphics or stacking huge imaging data sets (imx571) once. Gaming on ultra mode has been seamless.

I'll have to figure out where "use gpu" even is.....

Has to be something in the script itself.

I'm looking at the Cosmic Clarity Sharpening and Denoise script, 'Use GPU' is a checkbox right in the UI. 

 

These are the only two I've used of his so far. 

 

It may not be the GPU setting but I can't think of anything else that could cause your pc to crash. Maybe a RAM card getting some kind of error? 



#16 Stevan Klaas

Stevan Klaas

    Mariner 2

  • -----
  • Posts: 276
  • Joined: 18 Sep 2018
  • Loc: Geneva, Switzerland

Posted 28 May 2025 - 03:40 PM

To use drizzlex2/ drop 0.9 / Square as per tradition Pixinsight…I shoot at least 6 hours in bortle 8 to 9. Lower than that for me it’s just loss of SNR that doesn’t compensate gain in resolution.

 

The gain in non stellar objects is only visible after deconvolution in graxpert or BlurX and you need thick signal.

 

 

I’ve been using your previous Siril 1.4 preprocessing scripts and it works well. Nice to see it in python form now. 
 

Curious what success people have had with drizzle above 1.0 on the Seestar and what settings were used. I tried a 2x but it created some odd noise patterns that looked like multicolored stars (and noise reduction would ignore it, thinking it’s data). Perhaps it’s the pixel fraction that needs to change? Haven’t experimented much with that yet. 

 


Edited by Stevan Klaas, 28 May 2025 - 03:46 PM.


#17 Airstrike

Airstrike

    Vostok 1

  • -----
  • Posts: 114
  • Joined: 15 Feb 2023

Posted 03 June 2025 - 05:34 PM

grabbed a handful of subs to test

selected key options in the panel and hit run / seems to stack all the images fine but i got this error pop up with a bunch of red text  >>> here is the log thats in red >>>>

i know absolutley nothing about scripting coding or any of that stuff sry frown.gif  ALSO i noticed after i run the script if i want to run it it again i have to reset the working directory everytime , i did reset python  in the preferences several times fingertap.gif

 

23:21:27: Chunk file not found: C:\Users\X570 Aorus Elite\AppData\Local\siril\siril_cat1_healpix8_xpsamp\siril_cat1_healpix8_xpsamp_43.dat
23:21:27: Catalog error, no stars identified!
23:21:27: Exception in Tkinter callback
23:21:27: Traceback (most recent call last):
23:21:27:   File "C:\Users\X570 Aorus Elite\AppData\Local\siril\venv\Lib\site-packages\sirilpy\connection.py", line 346, in _send_command
23:21:27:     err, bytes_written = win32file.WriteFile(self.pipe_handle, complete_message, write_overlapped)
23:21:27:                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23:21:27: pywintypes.error: (6, 'WriteFile', 'The handle is invalid.')
23:21:27:
23:21:27: The above exception was the direct cause of the following exception:
23:21:27:
23:21:27: Traceback (most recent call last):
23:21:27:   File "C:\Users\X570 Aorus Elite\AppData\Local\siril\venv\Lib\site-packages\sirilpy\connection.py", line 1072, in cmd
23:21:27:     response = self._request_data(_Command.SEND_COMMAND, command_bytes, timeout=None)
23:21:27:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23:21:27:   File "C:\Users\X570 Aorus Elite\AppData\Local\siril\venv\Lib\site-packages\sirilpy\connection.py", line 481, in _request_data
23:21:27:     status, response = self._send_command(command, payload, timeout)
23:21:27:                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23:21:27:   File "C:\Users\X570 Aorus Elite\AppData\Local\siril\venv\Lib\site-packages\sirilpy\connection.py", line 405, in _send_command
23:21:27:     raise SirilConnectionError(_("Error in _send_command(): {}").format(e)) from e
23:21:27: sirilpy.exceptions.SirilConnectionError: Error in _send_command(): (6, 'WriteFile', 'The handle is invalid.')
23:21:27:
23:21:27: The above exception was the direct cause of the following exception:
23:21:27:
23:21:27: Traceback (most recent call last):
23:21:27:   File "C:\Program Files\Siril\python\Lib\tkinter\__init__.py", line 1968, in __call__
23:21:27:     return self.func(*args)
23:21:27:            ^^^^^^^^^^^^^^^^
23:21:27:   File "C:\Program Files\Siril\scripts\Naztronomy-Smart_Telescope_PP.py", line 749, in <lambda>
23:21:27:     command=lambda: self.run_script(
23:21:27:                     ^^^^^^^^^^^^^^^^
23:21:27:   File "C:\Program Files\Siril\scripts\Naztronomy-Smart_Telescope_PP.py", line 850, in run_script
23:21:27:     self.spcc(
23:21:27:   File "C:\Program Files\Siril\scripts\Naztronomy-Smart_Telescope_PP.py", line 472, in spcc
23:21:27:     self.save_image("_spcc")
23:21:27:   File "C:\Program Files\Siril\scripts\Naztronomy-Smart_Telescope_PP.py", line 400, in save_image
23:21:27:     self.siril.cmd(
23:21:27:   File "C:\Users\X570 Aorus Elite\AppData\Local\siril\venv\Lib\site-packages\sirilpy\connection.py", line 1094, in cmd
23:21:27:     raise SirilError(_("Error in cmd(): {e}")) from e
23:21:27: sirilpy.exceptions.SirilError: Error in cmd(): {e}

Attached Thumbnails

  • Screenshot 2025-06-03 232108.jpg
  • Screenshot 2025-06-03 232149.jpg
  • Screenshot 2025-06-03 233159.jpg

Edited by Airstrike, 03 June 2025 - 05:49 PM.


#18 naztronomy

naztronomy

    Vostok 1

  • *****
  • topic starter
  • Posts: 159
  • Joined: 11 Dec 2021
  • Loc: Boston

Posted 05 June 2025 - 08:32 PM

Airstrike, sorry, I didn't see your response earlier. I would have sent you a link to try the beta version of the script. 

 

The newest version of this script is officially part of Siril's script repository so it's easier to install and comes with a few enhancements and bug fixes. 

 

Watch the full demo here: https://www.youtube....h?v=HVHnaRuaLDk

 

 

Screenshot 2025-06-04 021434.png

 

 

Give this a shot and let me know if that works better for you. 

 



#19 kabes

kabes

    Sputnik

  • -----
  • Posts: 29
  • Joined: 22 Sep 2009

Posted 06 June 2025 - 11:21 PM

I was able to improve my 2x drizzle results by switching the kernel from square to gaussian by manually editing the script file. No more weird fake stars in the background (they were only visible after denoising). Maybe something to consider adding as an option. I plan to experiment with lanczos2 and lanczos3 next. 


  • naztronomy likes this

#20 Airstrike

Airstrike

    Vostok 1

  • -----
  • Posts: 114
  • Joined: 15 Feb 2023

Posted 07 June 2025 - 02:14 AM

Airstrike, sorry, I didn't see your response earlier. I would have sent you a link to try the beta version of the script. 

 

The newest version of this script is officially part of Siril's script repository so it's easier to install and comes with a few enhancements and bug fixes. 

 

Watch the full demo here: https://www.youtube....h?v=HVHnaRuaLDk

 

 

attachicon.gif Screenshot 2025-06-04 021434.png

 

 

Give this a shot and let me know if that works better for you

all good thanks naz :) brilliant update matebow.gif



#21 naztronomy

naztronomy

    Vostok 1

  • *****
  • topic starter
  • Posts: 159
  • Joined: 11 Dec 2021
  • Loc: Boston

Posted 07 June 2025 - 01:29 PM

I was able to improve my 2x drizzle results by switching the kernel from square to gaussian by manually editing the script file. No more weird fake stars in the background (they were only visible after denoising). Maybe something to consider adding as an option. I plan to experiment with lanczos2 and lanczos3 next. 

That's great to know, thank you! I plan on creating a few 'advanced options' available for people. A few advanced users have suggested it so I might do that for the next patch in a couple of weeks. 

 

Let me know what you find with your experiment with lanczos2 and lanczos3! 

 

all good thanks naz smile.gif brilliant update matebow.gif

Thank you!



#22 kabes

kabes

    Sputnik

  • -----
  • Posts: 29
  • Joined: 22 Sep 2009

Posted 07 June 2025 - 02:01 PM

That's great to know, thank you! I plan on creating a few 'advanced options' available for people. A few advanced users have suggested it so I might do that for the next patch in a couple of weeks. 

 

Let me know what you find with your experiment with lanczos2 and lanczos3! 

 

Thank you!

I was just trying lanczos2 and lanczos3 but both of them cause the script to fail at stacking near the end when it's doing the normalization (after it's done scanning for black frames). This is with S50 data. Back to gaussian and it's still fine.
 


  • naztronomy likes this

#23 naztronomy

naztronomy

    Vostok 1

  • *****
  • topic starter
  • Posts: 159
  • Joined: 11 Dec 2021
  • Loc: Boston

Posted 07 June 2025 - 03:06 PM

I was just trying lanczos2 and lanczos3 but both of them cause the script to fail at stacking near the end when it's doing the normalization (after it's done scanning for black frames). This is with S50 data. Back to gaussian and it's still fine.
 

Interesting, thank you. I'm away from home until Wednesday, I'll do some testing when I get home as well. 



#24 michaelrasbury

michaelrasbury

    Lift Off

  • -----
  • Posts: 6
  • Joined: 21 May 2025

Posted 19 June 2025 - 08:51 AM

Quite often, the python script fails after producing the OG image and doesn't proceed to create the SPCC images or others? I'm using the seestar s50 and latest Siril. Any ideas? The final error Siril displays is "Load command failed: Command 'load' failed: File not found. The errors start happening after this log, "M_27_773x20sec_2025-06-01_drizzle-2.0x__2025-06-19_0957_og.fits: file not found or not supported." This happens although the file has been created and is accessible in the folder.


Edited by michaelrasbury, 19 June 2025 - 08:59 AM.


#25 naztronomy

naztronomy

    Vostok 1

  • *****
  • topic starter
  • Posts: 159
  • Joined: 11 Dec 2021
  • Loc: Boston

Posted 19 June 2025 - 12:39 PM

Quite often, the python script fails after producing the OG image and doesn't proceed to create the SPCC images or others? I'm using the seestar s50 and latest Siril. Any ideas? The final error Siril displays is "Load command failed: Command 'load' failed: File not found. The errors start happening after this log, "M_27_773x20sec_2025-06-01_drizzle-2.0x__2025-06-19_0957_og.fits: file not found or not supported." This happens although the file has been created and is accessible in the folder.

Can you share your logs? I can take a look. 




CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.


Recent Topics






Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics