Closed Sheshuk closed 1 year ago
Sounds good to me.
Just to make sure I understand this correctly: This would not affect any materials in the current official SNOwGLoBES version; it is only for future or custom materials, right?
Just to make sure I understand this correctly: This would not affect any materials in the current official SNOwGLoBES version; it is only for future or custom materials, right?
Right. Although it will make SimpleRate read the binning for current materials as well (the same way, as SNOwGLoBES used to do it), but numerically nothing will change. Just less hardcoded values.
What I want
As the developer I want our
snowglobes_interface
to be easily adaptable for the new materials in SNOwGLoBES. New materials can have different energy binning, so I'd likeSimpleRate
to be able to read the binning from SNOwGLoBES and use it when computing the rateWhat we have now
I see that the energy binning in SimpleRate is defined as https://github.com/SNEWS2/snewpy/blob/b35379952fe18aedc28cdb106f1ee9e7ad08b082/python/snewpy/snowglobes_interface.py#L161-L163
What I suggest
We are already reading this binning for each material: https://github.com/SNEWS2/snewpy/blob/b35379952fe18aedc28cdb106f1ee9e7ad08b082/python/snewpy/snowglobes_interface.py#L101-L107 so there is no need to guess energies from the material name - we could use
self.binning[material]
- after we transform it to the binning array(s).