This question already has an answer here:
I want to do some performance tests concerning what the ISO setting "really does", whether ETTR makes sense, measure the noise, etc. on my camera.
Rather than look at the pixels after it's been Bayer decoded, mapped, reconstructed, etc. I'd like to look at the real raw data; that is, the sensor sample values. Ideally it would be three matrices for R, G, and B components (with G being twice the size in both dimensions).