Closed ckuethe closed 1 year ago
@ckuethe yes, that is true. N42 doesn't have object definition for extra polynom coefficients up to 4 and this is bad. Because we about 2 years used this calibration for CsI spectrometers to achieve calibration with 3% error at low energies (about 30keV - 400 keV)
In my opinion, this is a defect in the N42 specification - more coefficients should be allowed.
However, if you are using more than three coefficients, you should instead consider using non-linear deviation pairs; this way changes in temperature, or over time, can be accommodated with just the gain (linear) coefficient. However, this brings up another deficiency in the specification, that the non-linear deviation coefficients are not defined - for this, see https://github.com/sandialabs/SpecUtils/blob/36283b39a2292bd7baeac0daeb6f86c3701abc80/SpecUtils/EnergyCalibration.h#L444
Also, see issue #12 . Specifically, there are a few other issues in N42 files output by SpecUtils/InterSpec.
Commit 36283b39a2292bd7baeac0daeb6f86c3701abc80 fixed opening BecqMoni files (hopefully all of them), and issue #12 covers the remaining portions of this issue.
@ckuethe Thanks for linking to your XSD validation tool!
@Am6er reported in commitcomment-131492754 that there are some files that don't load correctly in InterSpec.
When I use my n42validate tool, the files all fail to validate against the N42 schema. It appears that calibration polynomials can only go up to quadratic. I made the same assumption when loading radiacode generated files. I can probably do a quick patch to not reject files with higher order calibration polynomials, but maybe emit a warning.