Open sdickreuter opened 9 years ago
While your implementation of the nonlinearity correction is correct, you must not apply this correction to a spectrum that was not dark-count-corrected!
So before this can be merged into master, the dark-count-correction needs to be implemented and in the code we need to be sure, that if the non-linearity-correction is enabled that the dark-count-correction is enabled too.
Do you mean that the a dark spectrum has to be substracted before the nonlinearity correction ? That would mean that for using the nonlinearity one would have to inlcude a framework for saving the spectra into the oceanoptics-module, that could get ugly ...
By the way, I got the formula for the correction from this site: http://www.manualsdir.com/manuals/292553/ocean-optics-ooinlcorrect.html
"Do you mean that the a dark spectrum has to be substracted before the nonlinearity correction ?" No. The counts of the dark pixels (the ones that are physically blocked on the CCD) need to be subtracted from the spectrum.
This is because otherwise the assumption that doubling the integration time = doubling the intensity which should be doubling the counts is wrong.
I guess in spectra suite if you only enable the non-linearity correction but not the dark count correction, the dark counts are added again, after the nonlinearity correction.
Ah ok I understand, I'll have a look into this next week, should'nt be too hard to implement I guess.
Will be resolved when PR #19 gets merged.
I could'nt open a second pull request, so here is a patch for the implementation of the nonlinearity correction: