* If I take an image at the shortest shutter speed I can and at a dark image, I see a nice Gaussian peak in RawDigger at 127, I do not see a 'spike' at 4095, even after I have underexposed this far. In other words, I am not seeing any 'hot pixels': my assumption being I would see these in the 4095 bin (but I could be wrong here?).
Hot pixels only appear at shutter speeds over about 1 second. Most cameras start taking an automatic "dark frame" above one second, and subtract it from the picture to cancel out hot pixels. This doubles the time to take each picture, which is not always desirable. You can turn this off in the main CHDK menu under Raw/Dark Frame Subtraction (set it to OFF).
So to see hot pixels, turn off dark frames and take a 60 second exposure with the lens cap on and/or in a dark closet.
I was trying to figure out what all the dots are in the dng images you posted. They may be "dead pixels", which apparently show up as totally black, i.e. 0. They might show up in my histogram as 0 pixels, but I probably am skipping over them since my sample step size is around 50 pixels for a full image.
Maybe you could try taking a totally overexposed image, i.e. 60 second exposure in a bright room, and see if you see the dots in the dng file. If so, maybe Rawdigger could tell you their value, i.e. 0?
The above has told me that your count (the lapser-count), which is statistically down on the real count, ie you sample the real RAW data, means that if I use a 'zero threshold' or 10-200 (to account for bin width), I should be OK. In other words if I use a lapser-count in the righthand 1/3 stop of the righthand zone (2046 bins wide), I can use 10 or 20 as my threshold, ie this is my 'zero'. Indeed this is what I am finding.
OK, that makes sense. The "lapser count" (has a nice ring to it), is an absolute number of pixels when the scale is 0. The total number of pixels varies, so it might be better to use a scale of 10000 or so. The result returned by get_histo_range(from,to,scale) is:
(lapser_count*scale)/total
A 0 scale just returns lapser_count, as you know. The original function used a scale of 100. For now, the total number of pixels should be between around 8,000 and 12,000, but that may change in future updates. A scale of 10,000 should give you the precision you need, plus it should work if the number of pixels increases or decreases.
Of course, each scene is different and speculars could throw my 'zero' test off.
One of my obsessions is sunset time lapses, which start out with the sun in the frame. That's about as "specular" as you can get, so if you figure that one out, let me know.
BTW I still have not worked out how to put CHDK on a 8Gb card or larger without a lot of 'mucking about'.
Try formatting your SDHC card with this program. Then add full CHDK, boot with firmware update, then go to Misc/SD card/ in the CHDK menu, and make it bootable (with write protect). Then you can add my custom builds. It works for my 64GB card.
http://www.ridgecrop.demon.co.uk/guiformat.exe