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

Energy resolution #232

Open
2 tasks
jccurtis opened this issue Feb 17, 2021 · 7 comments
Open
2 tasks

Energy resolution #232

jccurtis opened this issue Feb 17, 2021 · 7 comments

Comments

@jccurtis
Copy link
Collaborator

jccurtis commented Feb 17, 2021

  • energy to energy resolution
  • standard detector functional forms (equations)

attn @cosama, @markbandstra, @jvavrek

@jccurtis
Copy link
Collaborator Author

jccurtis commented Feb 17, 2021

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

@jccurtis
Copy link
Collaborator Author

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

@cosama
Copy link
Contributor

cosama commented Feb 17, 2021

Bunch of different resolution functions with references: https://doi.org/10.1016/j.nima.2012.02.006

@jccurtis
Copy link
Collaborator Author

  • Add valid range of energies

@markbandstra
Copy link
Member

TODO from our meeting

  • toggle sigma or FWHM
  • toggle absolute or relative
  • choose channel-channel or energy-energy
  • set range of validity (default (0, None) or (0, np.inf))
  • integrate into Spectrum following pattern of EnergyCal

@jvavrek
Copy link
Contributor

jvavrek commented Feb 23, 2021

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.

@markbandstra
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants