makepsf/rl results different than GUI deconvolution

Hello,
Just started experimenting with scripts and I stepped on an weird(?) behaviour, where image processed from GUI is different from the one processed by deconvolution commands, using same saved PSF.
I’m pretty sure I missed and/or misunderstood something, but I cannot find what.

This is the script section for deconvolution:

Find and select stars for PSF.

setfindstar reset -moffat -minA=0.07 -maxA=0.7

Denoise the channel a bit to prepare for deconvolution.

load Ha.fit
denoise -mod=0.5 -vst
save Ha_nox.fit

Apply Deconvolution (from Stars) to Ha.

makepsf clear
makepsf stars -ks=25 -savepsf=Ha_nox_PSF.tif
rl -loadpsf=Ha_nox_PSF.tif -alpha=3000 -iters=10 -gdstep=0.0003 -tv
save Ha_dconv.fit

I used the PSF generated from this script both in the script and in the GUI, but the image is ok from GUI:

and completely wrong from automation:

And re-launching the command it’s ever changing:

Any suggestion?
Thank you!

Michele

[I really like Siril! :slight_smile: ]

Thanks for the report. The GUI and the command line should be calling the same functions either the same parameters. I’ll do some investigation and get back to you if I need any more information. Can I just check what version of Siril you’re using?

Thank you for your reply.
Here’s the version:
image

I tried also in another Siril installation (but same version) on my control computer: same results.

Thanks. I can recreate the bug in master as well. It appears to be isolated to the rl command, as the rl command produces the bug whether the psf is created in the GUI or loaded, and the GUI “apply deconvolution” button works in either case. From here I should be able to track it down when I have time over the next few days.

Good. I’m glad the issue can be reproduced.
I’m available for any more testing.
Thank you very much

I found it. There were two issues with parsing the arguments to the deconvolution commands. One was to do with setting the value of alpha, which internally should be set to 1 / (the value entered by the user), and the other was to do with the kernel size, which was not updated from the default value of 15, so in your case using a 25x25 kernel the deconvolution code was seeing a completely scrambled version of it.

I’ve fixed this in git in both the 1.2 and master branches, so it will form part of the 1.2.4 release. In the meantime you will need to either use a 15x15 kernel or use the GUI.

Thanks for the bug report and diagnostic images they were very helpful in tracking this down.

1 Like

Thank you for the quick response!
I stay tuned for next version.