1. A method for correcting pixel charge data for non-ideal behavior in a CMOS sensor of an X-ray diffraction system, comprising, for each pixel in the sensor: (a) non-destructively sampling charge accumulated in the pixel at a plurality of times during a sensor frame time period and correcting each sample value for gain variation and nonlinearity; (b) estimating fixed pattern and dark current noise for the pixel and subtracting the estimated fixed pattern and dark current noise from each corrected sample value; (c) estimating reset noise for the pixel and subtracting the estimated reset noise from each sample value corrected in step (b) to produce a plurality of corrected sample values; (d) fitting a model basis function of charge versus time to the corrected sample values produced in step (c); and (e) evaluating the fitted model basis function at an end time of the frame time period.