Hello to all forum users,
My name's Edoardo Radice from Italy.
I am a beginner with pixinsight (at the moment i have only a trial licence) and i'm learning basics.
Being a DSLR user one of my first concerns was about colored flats (taken on morning sky or with light pollution filters).
I usually use Iris for frame calibration: here exists a GRAY_FLAT command that turns a colored flat in a gray one.
in Maxim exist a "boxcar filter" that does something similar.
In PI it seems that does not exist something similar (i have found a few forum topics about this, i hope i haven't missed something important

).
Although many PI expert says that colored flats are not a problem (obviously i can correct color hues with color balance and background neutralization), i prefer starting with a gray flat.
Googling on the internet i have found somewhere that a low pass filter with the scheme
1 1 0
1 1 0
0 0 0
can fix the problem, so i've tried to create it with pixel math.
Following the PM tutorial i wrote this expression that works quite well
x = XPos();
y = YPos();
left = x-1;
top = y-1;
plt = Pixel( $target, left, top );
pt = Pixel( $target, x, top );
pl = Pixel( $target, left, y );
p = Pixel( $target, x, y );
(p+pl+pt+plt)/4
(you can find GrayFlat.xpsm as attachment).
Just to test the procedure, i opened a master flat from my canon 350D with an Astronomik CLS filter.
in sflat_RGB_VNG.jpg you can see the debayered version of the flat with the blue hue caused by the filter.
in sflat_RGB_VNG_gray.jpg you can see the debayered version of the flat after application of the pixel math instace.
finally sflat_flattened_with_gray.jpg you can see the debayered version of the "blue" flat flattened with the gray flat: there is no change in color hue after flattening and the field appears well flattened.
Obviously applying a low pass filter some information in your original flat is loosen, so you cannot anymore use your calibrated frames for scientific uses like photometry.
But if your goal is only to produce a nice picture to share with friends this procedure can be useful.
Comments and advice are welcome
Bye
Edoardo