-
Notifications
You must be signed in to change notification settings - Fork 15
Description
Context: I was trying to simulate some fd.SR1WIMPSource events while loading the model parameters in via the configuration file functionality (PR 140).
df = fd.SR1WIMPSource(config=config_path).simulate(100)
Specifically, I wanted to simulate some fd.SR1WIMPSource events between 30 keV - 40 keV instead of the default 0.7 - 50 keV so I had the following line in the config file
energy_edges = np.geomspace(30., 40, 100)
However, I got some simulated events with energy outside 30 keV - 40 keV.
Problem: The model attributes of WIMPEnergySpectrum were not loaded in correctly from configuration files.
The configurations are loaded in in source.py which is called after the energy spectrum has been computed in energy_spectrum.py.
Solution:
It is possible to create a specific class that inherits from fd.SR1WIMPSource and this somehow manages to overwrite the model attributes like mw and energy_edges.
class my_wimp(fd.SR1WIMPSource):
mw = 50
energy_edges = np.geomspace(30., 40., 100)
However, being able to load in all model attributes of the sources via a single configuration file is still a better solution in terms of keeping track of the configurations used for fits.