lbl-anp / becquerel

Becquerel is a Python package for analyzing nuclear spectroscopic measurements.
Other
43 stars 16 forks source link

Incompatibility between calibration and parsers when calibrated energies can be negative #309

Closed jvavrek closed 2 years ago

jvavrek commented 2 years ago

Often we can end up with negative calibrated energies, e.g., in the first few bins if the calibration linear term is negative. These are clipped to zero by default in the new calibration module. However multiple zero edges will throw an error that the bin edges are not monotonically increasing.

One can normally change the clipping on the domain and range when doing calibrations manually, but not so with parsers, which automatically apply the calibration. One cannot change the clipping ranges passed into the calibration methods because the DEFAULT_DOMAIN etc are passed to those methods when the module is imported, not when the function is called.

We could either provide more kwargs to the parsers to prevent this, or allow negative energies (i.e., broaden or remove the clipping).

werthm commented 2 years ago

I agree, this is an issue for me as well. DEFAULT_RANGE should allow negative energy values as well.

jvavrek commented 2 years ago

I believe @markbandstra is working on this in #319

markbandstra commented 2 years ago

Closed by #319