xpecgen
xpecgen: A program to calculate x-ray spectra generated in tungsten anodes - Published in JOSS (2016)
Science Score: 93.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
✓DOI references
Found 9 DOI reference(s) in README and JOSS metadata -
✓Academic publication links
Links to: joss.theoj.org, zenodo.org -
○Committers with academic emails
-
○Institutional organization owner
-
✓JOSS paper metadata
Published in Journal of Open Source Software
Repository
A python package with a GUI to calculate X-ray sPECtra GENerated in tungsten anodes.
Basic Info
- Host: GitHub
- Owner: Dih5
- License: gpl-3.0
- Language: Python
- Default Branch: master
- Size: 1.37 MB
Statistics
- Stars: 19
- Watchers: 3
- Forks: 4
- Open Issues: 1
- Releases: 8
Metadata Files
README.md
xpecgen
A python package with a GUI to calculate x-ray spectra generated in tungsten anodes, as well as the bremsstrahlung component in other media.
Features
- X-ray spectra calculation using the models from [1].
- HVL calculation.
- Python library and Graphical User Interface.
- Export to xlsx files (Excel Spreadsheet).
- Python API.
Usage example
GUI

Python interpreter
python
from xpecgen import xpecgen as xg
s=xg.calculate_spectrum(100, 12, 3, 150)
s.attenuate(0.12, xg.get_mu(13))
s.attenuate(100, xg.get_mu("air"))
s.export_xlsx("spectrum.xlsx")
s.show_plot()
Installation
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.
Documentation
The updated API documentation is available here.
You can also use the python help system to check it:
python3
from xpecgen import xpecgen as xg
help(xg)
Contributing
See CONTRIBUTING.md.
Model details
To have a general overview of the model see [1]. 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.
Citation
If you use this application to make use of the models in [1], you should cite it. If you also want to acknowledge the implementation itself you can also cite [2].
References
[1] Hernández, G., Fernández F. 2016. "A model of tungsten x-ray anode spectra." Medical Physics, 43 4655. doi:10.1118/1.4955120.
[2] Hernández, G., Fernández F. 2016. "xpecgen: A program to calculate x-ray spectra generated in tungsten anodes." The Journal of Open Source Software, 00062. doi:10.21105/joss.00062.
Owner
- Name: Guillermo Hernández
- Login: Dih5
- Kind: user
- Location: Salamanca, Spain
- Company: Universidad de Salamanca
- Repositories: 12
- Profile: https://github.com/Dih5
A fan of the dihedral group of order 10.
JOSS Publication
xpecgen: A program to calculate x-ray spectra generated in tungsten anodes
Tags
X-ray spectra Tungsten anode Computer modelingGitHub Events
Total
Last Year
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Guillermo Hernández | g****g@g****m | 121 |
| Arfon Smith | a****n | 1 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 11
- Total pull requests: 8
- Average time to close issues: about 2 months
- Average time to close pull requests: 17 minutes
- Total issue authors: 5
- Total pull request authors: 2
- Average comments per issue: 1.18
- Average comments per pull request: 0.13
- Merged pull requests: 8
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- Dih5 (7)
- tacaswell (1)
- jkahn (1)
- bpops (1)
- easyXAFS (1)
Pull Request Authors
- Dih5 (7)
- arfon (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 108 last-month
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 7
- Total maintainers: 1
pypi.org: xpecgen
A package with a GUI to calculate X-ray sPECtra GENerated in tungsten anodes
- Homepage: https://github.com/Dih5/xpecgen
- Documentation: https://xpecgen.readthedocs.io/
- License: GPLv3
-
Latest release: 1.3.0
published about 8 years ago
