I have a Fujifilm X-T20. I am using Siril. I noticed that there was a weird square in the middle of my dark and bias stacks that were sometimes affecting my final images. After a little searching, I learned this is related to the phase detection auto focus system. The photosites used for auto focus get a little less light than the surrounding photosites. The camera somehow compensates for this and increases the values from these specific photosites. This makes it such that the pattern is not visible in any image where the signal from light sufficiently exceeds the sensor noise. So a light frame or a flat frame won’t show the pattern at all (at least not normally).
Darks and biases, however, are not based on signal from light at all. So when the pixel values are compensated by the camera, they become just a little bit brighter than the surrounding pixels in a dark frame or a bias frame. If these pixels are left alone, they will affect the final image. This is a stretched dark stack from a Fujifilm X-T20. The lighter grey square in the middle is from the auto focus system.
There is a post about this on the PixInsight forums and a workaround was developed that used a sample of pixels in the auto focus area. The difference between the average values for the auto focus pixels compared to the average values of non-auto focus pixels in the same area was used to adjust the pixels involved.
I didn’t know how to do this using Siril alone. The value needed to fudge the auto focus pixels needs to be computed. It does not appear to be static. So… after spending far too much time learning how to write my first CFITSIO program, I came up with the following solution.
The attached text file is really a c program using CFITSIO to read and write FITS files. (change the name to fix_xtrans.c before compiling)
fix_xtrans.txt (7.8 KB)
I built this on a Linux box with CFITSIO installed. I used the following command to compile it. If you can compile the example processes included with CFITSIO, this code should compile the same way.
gcc fix_xtrans.c -o fix_xtrans -lcfitsio -lm
The program takes two parameters. The first is the fits file, the second is the name of the output file.
fix_xtrans dark_stacked.fit dark_corrected.fit
It will then compute the fudge amount and apply it to the correct pixels.
The intent is that this would run against the stacked master dark and master bias files before those files are used against lights and flats.
The code currently only supports Fujifilm X-T20, but could easily be modified for other cameras that have this same issue. I only have the X-T20. Finding the auto focus pixels seemed to be easiest when using a minimum stack of dark frames. That’s not normally how you would stack darks, but it was easier to see that way.
I now await for multiple people to chime in and tell me how I could have done this easier. I’d love to hear about anybody who uses this with success.