Flats upside down when running OSC_Preprocessing?

I have a problem with gradient in my pictures I cannot understand. I’m processing .CR2 images from IR-modified Canon D550. When I run the OSC_Preprocessing I get this image:

Vignetting seems almost gone, but as you see there is a visible gradient in the image. Camera is poiting very close to polaris.

When I modify the master-flat section to this:

#build master-flat
stack pp_flat rej 3 3 -norm=mul
load pp_flat_stacked.fit
rotate 180
save pp_flat_stacked.fit
cd …

Now my image looks like this:

My pp_flat_stacked looks like this:

light_00001 before processing:

Are my flats flipped upside down? How about bias and darks? Any idea why this happens?

This is unlikely. I don’t see why your flat would be upside down there is NO reason. Siril does not read the EXIF giving file orientation.
For me, this gradient come from light pollution. You can remove it with the appropriate tool, even on each light if needed.

Thanks! I’ll investigate more pictures from other parts of the sky and see if I can find a pattern.

Please check the included gif-anim

50g9id

The images are part of 180x360 panorama. I have total 32 columns of 16 images. They all overlap at Polaris. The bight star rotating is Polaris. As you see all images have grading, darkest at the bottom, no matter what way camera is poiting.

Here is the same gifanim, processed the same way but with the flats turned 180 degrees:

50gc3c

I’m sure your eyes are more trained than mine to see what is going on here, but for me it looks like the grading is gone and that the sky is little darker at oposite side of polaris. The darker area seems to rotate with camera. Location was very dark place in mountains, very cold winter night with great visibility. No light pollution, but the sky can be a little brighter looking north due to aurora borealis.

Maybe the flats are not upside down as it seems to me, but there may be some other source of confusion? Maybe my flats are just bad somehow? But I’m getting the same results with 2 sets of flats. One set made inside house, white walls, white ceiling, camera in white lightbox, lens covered white piece of plastic. The other flat set is made outside a foggy day, with lens covered by white tshirt.

Any ideas?

For me it is not a matter of flat orientation. This kind of gradient is very usual.
Again, it is impossible that your flat has not the right orientation if you have converted your RAW files with SIRIL.

So. The best approach for me is to extract the gradient from each light with the background extraction tool.

Other track, you said you shot your flats after. Generally you need to do it right after, with same optic chain. In your case maybe you flat are not good enough.

I’m starting to think that the gradient may be caused by long exposure and my short exposures of flats does not have this kind of gradient.

Background extraction tool does not work for me, because I need the gradient in images near horizon.
I’m sure I can manage to remove the stars in Photoshop and create this gradient. Is there a way in Siril to remove such gradient by applying a .fit file? Subtraction of a bitmap or multiplication by bitmap?

So what? Siril will build it. The tool is designed for that. I don’t know why you say it does not work. You can explain?

I’m only interested in removing the artificial gradient. Near horizon light pollution and bright sky is dominant and if I flatten the background I won’t be able to stich images, because lower part of one image does not match upper part of image below.

Sure. But try the tool on each light. It will do it.

Hello, sorry late answer. Thank you for looking into this!

Please check the image.

On left images preprocessed, streched by histogram, applied background extraction, converted to tiff and roughly stiched.

BE does not work good here, as top of one image does not match bottom of image above.

On right, preprocessed with flats rotated 180 degrees(!) and streched by histogram. If I didn’t rotate my flats the result would be about the same as on left side but without the very dark areas in sky near horizon on left. Those areas are impossible to deal with when stiching.

When I add more columns the stich between columns is not very visible.

On right side you see that the bottompart is OK, but the top part of picture is not so good. I think it’s because its not correct way to solve this by rotating flats. I need to keep the flats the way they are, but I need to apply gradient from top to bottom in each image to remove the artificial gradient.

Please note that I need to keep the natural gradient. SInce camera is on a wedge the gradient near horizon goes from lower left corner in image, to upper right corner.

I think the gradient may be from heat distribution in camera spreading to sensor, either internal motherboard or from heater strips I had to use in the panoramic head to make it work at -20 celcius.

Do you have any tricks on how to apply gradient to my flats?