Hi Farzad,
Thank you for uploading the data. The problem with these dark frames is that they use a very limited range of pixel sample values. On average they have an effective bit depth of about 6.5 bits.
To verify this, you can use the following script:
/*
* Effective dynamic range by histogram quantization.
*
* This script can evaluate ranges not larger than MAX_RANGE.
* To evaluate ranges smaller than the 16-bit range, set MAX_RANGE to 65536 below.
* This will speed up calculation considerably, and will require much less
* memory than the default value.
*/
#define MAX_RANGE 10000000
function CountValues( image )
{
for ( var c = 0; c < image.numberOfChannels; ++c )
{
// Generate a 16-bit histogram for the current channel
var H = new Histogram( MAX_RANGE );
image.selectedChannel = c;
H.generate( image );
// Count the number of nonzero histogram levels
var N = 0;
for ( var i = 0; i < MAX_RANGE; ++i )
if ( H.count( i ) != 0 )
++N;
console.writeln( format( " %2d | %8u | %5.2f |", c, N, Math.log2( N ) ) );
console.flush();
}
image.resetSelections();
}
function main()
{
var window = ImageWindow.activeWindow;
if ( window.isNull )
throw Error( "There is no active image window!" );
console.show();
console.writeln( "Calculating effective dynamic range..." );
console.writeln( "<b>", window.currentView.fullId, "</b>" );
console.writeln( "Channel | Values | Bits |" );
console.writeln( "--------|----------|-------|" );
console.flush();
CountValues( window.currentView.image );
}
main();
Just open Script Editor, create a new JavaScript source code document, copy the code above, and save it as a new file with the .js suffix. Load one of your dark frames and run the script. As you'll see, each of these dark frames use 90-95 discrete pixel values, which means that they are approximately 6.5-bit images. Our ImageIntegration tool has not been designed to work with extremely reduced bit depths like these.
Another problem is that these images have a median absolute deviation (MAD) of zero. This happens because more than one half of the pixels are equal to the median. This property, along with the reduced bit depth noted above, causes these frames to provide very little information about the dark current of your camera. To visualize this problem, you can use the following PixelMath expression:
$T == median($T)
Since MAD is zero, you can't use any statistical estimator of variability based on MAD, such as MAD itself, BWMV, Sn, or Qn. To integrate these frames, you have to use the average absolute deviation from the median, or the percentage bend midvariance, which don't use and are not related to MAD.
A different, although probably related problem is the fact that Winsorized sigma clipping is indeed very inefficient for these images. I have to investigate why exactly this happens, but I am sure the algorithm is performing a huge amount of iterations because the limited range of values makes it very difficult to find convergence.
I hope this analysis will help you understand and diagnose the problem.