Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BecqMoni files not loading #16

Closed
ckuethe opened this issue Nov 1, 2023 · 3 comments
Closed

BecqMoni files not loading #16

ckuethe opened this issue Nov 1, 2023 · 3 comments

Comments

@ckuethe
Copy link
Contributor

ckuethe commented Nov 1, 2023

@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.

n42validate Calibration\ 13.01.2023.N42 
[ERROR] Calibration 13.01.2023.N42
failed validating [-5.90955288142523, 0.375881542623178, 8.4487324360803e-06, -5.64086320297731e-10, 1.22453656607698e-14] with XsdLengthFacet(value=3, fixed=True):

Reason: length has to be 3

Schema:

  <xsd:length xmlns:xsd="http://www.w3.org/2001/XMLSchema" value="3" fixed="true">
    <xsd:annotation>
      <xsd:documentation>Three and only three coefficient values are allowed.</xsd:documentation>
    </xsd:annotation>
  </xsd:length>

Instance:

  <n42:CoefficientValues xmlns:n42="http://physics.nist.gov/N42/2011/N42">-5.90955288142523 0.375881542623178 8.4487324360803E-06 -5.64086320297731E-10 1.22453656607698E-14 </n42:CoefficientValues>

Path: /{http://physics.nist.gov/N42/2011/N42}RadInstrumentData/{http://physics.nist.gov/N42/2011/N42}EnergyCalibration[1]/{http://physics.nist.gov/N42/2011/N42}CoefficientValues

---------------------------------------------------------------------------

@Am6er
Copy link

Am6er commented Nov 1, 2023

@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)

@wcjohns
Copy link
Collaborator

wcjohns commented Nov 5, 2023

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

/** Applies the deviation pairs to the energy given by polynomial/FRF

@wcjohns
Copy link
Collaborator

wcjohns commented Nov 5, 2023

Also, see issue #12 . Specifically, there are a few other issues in N42 files output by SpecUtils/InterSpec.

Commit 36283b3 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!

@wcjohns wcjohns closed this as completed Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants