Open jccurtis opened 3 years ago
from @cosama
if params == 1:
self.res_func = lambda r, x: r[0] * 662. * np.sqrt(x / 662.) / 2.355
elif params == 2:
self.res_func = lambda r, x: r[1] + r[0] * 662. * np.sqrt(x / 662.) / 2.355
else:
raise NotImplementedError()
I've used the following for NaI(Tl):
def eres_keV_to_fhwm_keV(e, a=92.1592, b=0.0012675, c=4.1493):
return (a / np.sqrt(e) - b * e + c) * e
Bunch of different resolution functions with references: https://doi.org/10.1016/j.nima.2012.02.006
TODO from our meeting
(0, None)
or (0, np.inf)
)Spectrum
following pattern of EnergyCal
One thought I just had: it would be really convenient to have a classmethod
that is supplied a single energy and resolution (whether absolute or relative) like:
bq.energy_res.SqrtEModel.from_point(662, rel=0.03)
Depending on how we structure things, we could have a SqrtEModel
subclass from an abstract EnergyResolutionModel
. Then one-parameter models like SqrtEModel
can be constructed from a single point, hence the from_point
method, but more complicated functional forms cannot.
An energy resolution calibration like this could be easily handled by the new Calibration
class (#248). However, we would have to figure out how/whether to integrate the features enumerated above.
attn @cosama, @markbandstra, @jvavrek