Skip to content

model attributes of WIMPEnergySpectrum not loaded in correctly using configuration files #210

@plt109

Description

@plt109

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions