I have seen some users here having problems with flat frames not working as expected during BatchPreProcessing.
I also had several images where flat frames were not working as expected.
The issue I saw was that sometimes master flat frames were created with very dark corners, which was causing calibrated light frames to have very bright corners.
After some investigation, I was able to trace this issue to the way how flat frames are integrated by the script - they are integrated using AdditiveWithScaling normalization, which apparently shifts the levels of the resulting flat frame.
I applied a fix on my installation of PI to resolve this issue and I see much better results with the images I previously had problems with.
Here is how to apply the fix:
1. Locate this file on Linux (on Windows it should be somewhere else) and edit it as root:
/opt/PixInsight/src/scripts/BatchPreprocessing/BatchPreprocessing-engine.js
2. Find this function:
StackEngine.prototype.doIntegrate = function( frameGroup )
3. Locate this fragment in this function:
case ImageType.FLAT:
4. Make the following change on 2 following lines:
II.normalization = ImageIntegration.prototype.NoNormalization;
II.rejectionNormalization = ImageIntegration.prototype.NoRejectionNormalization;
Disclaimers:
1. This fix worked for me but may not work for you, so use it at your own risk
2. I am not fully understanding the reason why the original implementation is not working properly
3. I am not sure if this kind of post is allowed in this area, so please feel free to move it to appropriate section of the forum
4. I noticed that saved instances of the script can no longer be opened due to checksum error, which is not a big deal for me
Alex