- I am not so sure about your analysis regarding the image differences. By default, PixelMath rescales results to the range [0,1], which the apply() calls (e.g. line 358) probably does not (after reading the doc for the corresponding C++ operation in http://pixinsight.com/developer/pcl/doc/html/classpcl_1_1Generic2DImage.html#a96646100c18c95a1de5de737e56daf29). Are you sure?
In PixelMath, there is a "rescale result" checkbox, which gives same stddev for "flat1-flat2" and "flat2-flat1", when applied. In your script Flat1/Flat2 and Bias1/Bias2 are not commutative, leading to totally different results. So obviously no "rescaling" is applied.
But "rescaling" in this context is a deadly operation, because it renders the stddev value unusable. Since we want to measure the photon shot noise from the difference of two consecutive flats, we are interested in the distribution of the ADU values of the unscaled result! So instead of a "rescale" we need a "offset" operation. Right now I'm not too familiar with the PixInsight class library, so I'm not able to provide a clean solution.
Good news: There is an ugly, yet working workaround to quickly measure RAW files:
- patch line 250 of CCDParameter.js as follows:
targetRect.moveTo(
Math.ceil( (width-newWidth)/2 ),
Math.ceil( (height-newHeight)/2 ) );
- load the CR2 files as 16 Bit Integer. This is just the default when you drag them from explorer to PixInsight. The DSLR Raw settings must be set to "RAW CFA bayer monochrom" and "No black point correction".
- apply PixelMath "$T + ( 1024.0/65536.0 )" to bias1, flat1, dark1, but not to flat2, bias2 before using them in the script. Make sure to
not check "rescale". This makes the three difference operation within the script safe without having an side effect to the computations.
The results then are looking very promising and comparable to what I found in the internet, but there is still the mix of the RGGB channels from the bayer matrix. I have no quick solution to this.
Rüdiger
EDIT: The attached screenshot is labeled with ISO 1600, but it shows the result from ISO 200!