Siril 1.2.1, problem with normalization/stacking (emty result fit file)

Hello,
I have a problem with stacking fits files. After Stacking Siril creates empty result fit file.
I’m using Ubuntu Linux 22.04 and Siril 1.2.1.
I have FITS file Compression set to Gzip (2) in Preferences.
I’ve attached three fits source files to illustrate problem.
After creating sequence from them, registering them (Global Star Alignment), and then stacking with, for example Average Staking with rejection, then selecting winsorized sigma clipping with 3/3 parameters, I’m getting empty result file (only white pixels). Same I’m getting with larger sequence of over 100 fits.
In Console I see following output (output from last step - stacking):

21:11:34: Reading FITS: file r_test_00001.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
21:11:34: Sequence loaded: r_test_ (1->3)
21:11:43: Stacking: processing...
21:11:43: Processing all images in the sequence (3)
21:11:43: Stacking result will be stored as a 32-bit image
21:11:43: Computing normalization...
21:11:43: With the current memory and thread (8) limits, up to 8 thread(s) can be used for sequence normalization
21:11:44: Reading FITS: file r_test_00003.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
21:11:44: Reading FITS: file r_test_00001.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
21:11:44: Reading FITS: file r_test_00002.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
21:11:47: Normalization computation time: 3.74 s
21:11:47: Using 20211 MB memory maximum for stacking
21:11:47: We have 15 parallel blocks of size 805 (+3) for stacking.
21:11:47: Computing weights based on number of stars...
21:11:47: Starting stacking...
21:11:53: Pixel rejection in channel #0: 0.000% - 0.000%
21:11:53: Pixel rejection in channel #1: 0.000% - 0.000%
21:11:53: Pixel rejection in channel #2: 0.000% - 0.000%
21:11:53: Rejection stacking complete. 3 images have been stacked.
21:11:53: Integration of 3 images on 3 of the sequence:
21:11:53: Pixel combination ......... average
21:11:53: Input normalization ....... additive + scaling
21:11:53: Output normalization ...... disabled
21:11:53: Pixel rejection ........... winsorized sigma clipping
21:11:53: Rejection parameters ...... low=3.000 high=3.000
21:11:53: Creating rejection maps ... no
21:11:53: Image weighting ........... from star count
21:11:53: RGB equalization .......... disabled
21:11:53: Background noise value (channel: #0): 0.000 (0.000e+00)
21:11:53: Background noise value (channel: #1): 0.000 (0.000e+00)
21:11:53: Background noise value (channel: #2): 0.000 (0.000e+00)
21:11:54: Saving FITS: file test-winsor-r_test_stacked.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
21:11:55: Execution time: 11.55 s

P.S
link to fits:

Hello.
Without testing anything I see in your logs:

Processing all images in the sequence (3)
Pixel rejection ........... winsorized sigma clipping
Image weighting ........... from star count

There’s absolutely no chance of it working.
Why is this?
Firstly, as explained in the tooltip and documentation, the winsorized sigma clipping algorithm is used for large data sets. With 3 images, it’s impossible for the statistics to give good results.
Next, a weighting is added. So in the end, no pixel is retained, and you get a black image.

Thanks for the response. Same result I was getting also with full dataset (116 frames). I was thought that image could be not normalized properly due to large black “borders” which appear after registration ?

After further investigation, looks like it happens only when I select Image weighting: from Star count.

Here is console log of two subsequent stacks of same dataset (116 images). First without star count weighting, second - with it. On second stack empty fit file is generated. “Background noise value (channel: #0): -nan (-nan)” - look strange to me.

08:11:18: Sequence loaded: r_bkg_pp_light_ (1->116)
08:11:50: Stacking: processing...
08:11:50: Processing images of the sequence with a weighted FWHM lower or equal than 5.17814 (116)
08:11:50: Stacking result will be stored as a 32-bit image
08:11:50: Computing normalization...
08:11:50: With the current memory and thread (8) limits, up to 8 thread(s) can be used for sequence normalization
08:11:54: The AutoStretch display mode will use a 16 bit LUT
08:12:06: Reading FITS: file r_bkg_pp_light_00085.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
08:12:06: Reading FITS: file r_bkg_pp_light_00094.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
08:12:06: Reading FITS: file r_bkg_pp_light_00079.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
08:12:06: Reading FITS: file r_bkg_pp_light_00096.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
08:12:07: Reading FITS: file r_bkg_pp_light_00002.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
08:12:07: Reading FITS: file r_bkg_pp_light_00042.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
08:12:07: Reading FITS: file r_bkg_pp_light_00025.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
08:12:07: Reading FITS: file r_bkg_pp_light_00104.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
08:12:16: Reading FITS: file r_bkg_pp_light_00107.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
08:12:16: Reading FITS: file r_bkg_pp_light_00108.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
08:12:17: Reading FITS: file r_bkg_pp_light_00110.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
08:12:17: Reading FITS: file r_bkg_pp_light_00114.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
08:12:20: Normalization computation time: 30.12 s
08:12:23: Using 18983 MB memory maximum for stacking
08:12:23: We have 15 parallel blocks of size 805 (+3) for stacking.
08:12:23: Starting stacking...
08:18:27: Pixel rejection in channel #0: 0.402% - 0.782%
08:18:27: Pixel rejection in channel #1: 0.154% - 0.859%
08:18:27: Pixel rejection in channel #2: 0.385% - 0.835%
08:18:28: Rejection stacking complete. 116 images have been stacked.
08:18:28: Integration of 116 images on 116 of the sequence:
08:18:28: Pixel combination ......... average
08:18:28: Input normalization ....... additive + scaling
08:18:28: Output normalization ...... enabled
08:18:28: Pixel rejection ........... winsorized sigma clipping
08:18:28: Rejection parameters ...... low=3.000 high=3.000
08:18:28: Creating rejection maps ... no
08:18:28: Image weighting ........... disabled
08:18:28: RGB equalization .......... disabled
08:18:28: Background noise value (channel: #0): 59.187 (9.031e-04)
08:18:28: Background noise value (channel: #1): 68.487 (1.045e-03)
08:18:28: Background noise value (channel: #2): 56.212 (8.577e-04)
08:18:34: Saving FITS: file winsor2-r_bkg_pp_light_stacked.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
08:18:35: Execution time: 6 min 45 s
08:49:26: Stacking: processing...
08:49:26: Processing images of the sequence with a weighted FWHM lower or equal than 5.08448 (111)
08:49:26: Stacking result will be stored as a 32-bit image
08:49:26: Computing normalization...
08:49:26: With the current memory and thread (8) limits, up to 8 thread(s) can be used for sequence normalization
08:49:26: Normalization computation time: 0.47 ms
08:49:29: Using 19485 MB memory maximum for stacking
08:49:29: We have 15 parallel blocks of size 805 (+3) for stacking.
08:49:29: Computing weights based on number of stars...
08:49:29: Starting stacking...
08:55:45: Pixel rejection in channel #0: 0.403% - 0.784%
08:55:45: Pixel rejection in channel #1: 0.155% - 0.860%
08:55:45: Pixel rejection in channel #2: 0.386% - 0.837%
08:55:45: Rejection stacking complete. 111 images have been stacked.
08:55:45: Integration of 111 images on 116 of the sequence:
08:55:45: Pixel combination ......... average
08:55:45: Input normalization ....... additive + scaling
08:55:45: Output normalization ...... enabled
08:55:45: Pixel rejection ........... winsorized sigma clipping
08:55:45: Rejection parameters ...... low=3.000 high=3.000
08:55:45: Creating rejection maps ... no
08:55:45: Image weighting ........... from star count
08:55:45: RGB equalization .......... disabled
08:55:45: Background noise value (channel: #0): -nan (-nan)
08:55:45: Background noise value (channel: #1): -nan (-nan)
08:55:45: Background noise value (channel: #2): -nan (-nan)
08:55:47: Saving FITS: file winsor3-r_bkg_pp_light_stacked.fit.fz, 3 layer(s), 6032x4028 pixels, 32 bits
08:55:48: Execution time: 6 min 21 s

Hello again. First of all, thank you for all hard work on making Siril the best free astronomy image processing tool!
Today I was processing old session from last year in Siril and noticed another strange bug, possibly related to mentioned above. Same session processed in DeepSkyStacker was perfectly fine…
Ubuntu Linux 22.04, Siril 1.2.1.
I was processing stack of TIF files from Touptek G3M-178C astro camera, taken with native Touptek app (Toupview). They are 8 bit tiff files. There were no calibration files of any kind, only lights.
I attached 3 files from the serie, which are enough I think to reproduce problem.
What I did:

  1. created sequence
  2. go to Register, select Global Star Alignment
  3. click Go Register. All went fine here, no errors in console. However, after clicking on individual images after registration (r_l-test_xxx) I see only first image is normal, others are empty black images.
    Obviously stacking doesn’t work at all, and indeed while stacking it returns lot of errors :

15:04:43: Reading FITS: file r_l-test_00001.fit, 3 layer(s), 3040x2048 pixels, 32 bits
15:04:43: Reading FITS: file r_l-test_00002.fit, 3 layer(s), 3040x2048 pixels, 32 bits
15:04:43: Reading FITS: file r_l-test_00003.fit, 3 layer(s), 3040x2048 pixels, 32 bits
15:04:43: MAD is null. Statistics cannot be computed.
15:04:43: MAD is null. Statistics cannot be computed.
15:04:43: MAD is null. Statistics cannot be computed.
15:04:43: MAD is null. Statistics cannot be computed.
15:04:43: Normalization failed. Check image 3 first.

m101-20230609001219132.tif (12.6 MB)
m101-20230609001240605.tif (12.5 MB)
m101-20230609001302093.tif (12.6 MB)

Any ideas?

Hello.

OK. But that doesn’t help us at all, as DSS and Siril do not share a single line of code.

Apparently here, there is a bug with 8bits images. What you can do is to convert your TIFF images into SER file. It will work.

Yes, I know that DSS and Siril completely different… just that DSS could process tiff files that Siril couldn’t.
Thanks for the advise - will try to use .ser conversion!

OK.

ANd thx for the report. We will try to fix it.

1 Like

Found the bug occuring with weighing by number of stars. It occurs because we limit detection to 2000 stars with global registration (which is more than enough for registration), so that all your images have exactly the same number of stars. And this messes up the weight calcs.
I’ll fix it and send you a link to test with an Appimage.

btw, if you really want to weight by number of stars, you should use the 2-pass registration, see this: Registration — Siril 1.2.0 documentation (which also explains the 2000 stars threshold). With this method, you’ll also be able to adapt the framing.

Cheers,

Cecile

1 Like

Thank you! Also using .ser file was a perfect way to solve the problem… All stacked fine !

Thank you! Will test it for sure… Also will try 2 step registration too…

Here you go: https://gitlab.com/free-astro/siril/-/jobs/6384582016/artifacts/download
The first bug (not the one for 8b images) should be solved
Thanks for the report

Cecile

2 Likes

Downloaded and tested with new version. Works perfectly on both small (3 images) and full set 116 frames!
Thank you !

1 Like