opengate
opengate copied to clipboard
Polyenergetic Source
Hello, really like this project!
Is there a way to implement a polyenergetic source? I am trying to introduce an xray spectrum as arrays of weights and energies.
My current implementation is like this:
source.energy.type = "spectrum_lines"
source.energy.spectrum_weight = w
source.energy.spectrum_energy = en
But I'm not sure if it will give me my desired behavior. Any help would be greatly appreciated!
Hello, thanks ;) Indeed, the doc is still lacking for this, sorry.
- with "spectrum_lines", it means the source will be polyenergetic, yes, but with a discrete number of photopeaks (if this is gamma) given by the two arrays: energy and weight.
- you can also use "histogram", also with the two arrays, for a continuous energy distribution
See the code here (first for the python interface, second for the C++ description)
- https://github.com/OpenGATE/opengate/blob/master/opengate/sources/generic.py
- https://github.com/OpenGATE/opengate/blob/master/core/opengate_core/opengate_lib/GateGenericSource.cpp#L447
If you are brave, please do not hesitate to complete the documentation here ("edit" in the small menu): https://opengate-python.readthedocs.io/en/latest/user_guide.html#sources
HTH