A python package with a GUI to calculate x-ray spectra generated in tungsten anodes, as well as the bremsstrahlung component in other media.
- X-ray spectra calculation using the models from .
- HVL calculation.
- Python library and Graphical User Interface.
- Export to xlsx files (Excel Spreadsheet).
- Python API.
If you have pip you can install xpecgen as a package by running
pip install xpecgen
and then you can launch the GUI by just executing
xpecgen, see the command line interface by executing
xpecgencli -h, or check the demo.py explaining its use as a library,
You will need tk to make use of the GUI. You can check the advanced guide if you need help for this.
If you do not have python installed yet, check the advanced guide.
The updated API documentation is available here.
You can also use the python help system to check it:
from xpecgen import xpecgen as xg help(xg)
To have a general overview of the model see . The bremsstrahlung calculation is done using full interpolations for the electron fluence, so none of the simplifications in section IV.C were used in this implementation. This description of the fluence can be used with others materials, always via the CSDA scaling, if requested. However, note that its accuracy has not been tested. Both characteristic peaks models in section II.D were implemented. The polynomial one is used by default. Half-value layers are calculated using the exponential model of attenuation (aka narrow beam geometry). In the GUI they are calculated in the sense of dose, but the library allows for generalizing this to any desired reponse function.
Despite the GUI and the API allow selecting different target materials, note the model only considered tungsten in detail. When a different material is selected, its bremsstrahlung cross-section and range scaling are used instead. However, differences in the electron fluence in the target might affect the results. In particular, the penetration depth is increased in low Z materials in units of the CSDA range, so the results should be used with caution, specially in that case.