-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move away from poetry, doc improvements, gui fixes
* bokeh 3 fix and bug fix * bumping version requirements * moving load of data and added get_edge * fixes to data * adding tests * added custom material example * added example that show edges * moved api to generated dir and added clean command to make * bug fixes and improvements to gui * Update .gitignore * fixes to docs * update to tests for edges * update to bokeh version pin * expanded get_element_symbol ability and solved issue #52 * removed poetry * Update codestyle.yml * fixes tests and linting * Update testing.yml * Update .pre-commit-config.yaml * added pre-commit checks * Update pyproject.toml * moved precommit to its own workflow * fixed missing doc dependency * pre-commit fixes * not needed because get_atomic_number issue error already * fix for new version of black req * Update README.rst * update to black version req and black fix * fixed license file reference * fixed dynamic version number and cleanup
- Loading branch information
Showing
170 changed files
with
2,532 additions
and
2,270 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This workflow will install Python dependencies and run a few (not all) pre-commit checks | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- uses: pre-commit/action@v3.0.0 | ||
with: | ||
extra_args: check-ast --all-files | ||
- uses: pre-commit/action@v3.0.0 | ||
with: | ||
extra_args: trailing-whitespace --all-files | ||
- uses: pre-commit/action@v3.0.0 | ||
with: | ||
extra_args: mixed-line-ending --all-files | ||
- uses: pre-commit/action@v3.0.0 | ||
with: | ||
extra_args: debug-statements --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
Defining your own custom material | ||
================================= | ||
Though the compounds list provided in this package is extensive it may not provide the exact material that you are interested in. | ||
It easily possible to define your own material if you know it's chemical composition. | ||
The following example, we investigate the absorption of a Gallium Arsenide (GaAs) detector in the same configuration as that in `G. Lioliou & A.M. Barnett (2016) <https://doi.org/10.1016/j.nima.2016.08.047>`__. | ||
Compare our plot with their `Figure 1 <https://www.sciencedirect.com/science/article/pii/S016890021630866X#f0005>`__. | ||
|
||
.. plot:: | ||
:include-source: | ||
|
||
import astropy.units as u | ||
import numpy as np | ||
|
||
from matplotlib import pyplot as plt | ||
from roentgen.absorption import Material | ||
|
||
gaas_deadlayer = Material({'Ga': 0.518, 'As': 0.482}, | ||
density=5.32*u.g/u.cm**3, thickness=500*u.nm) | ||
|
||
gaas_detector = Material({'Ga': 0.518, 'As': 0.482}, | ||
density=5.32*u.g/u.cm**3, thickness=10000*u.nm) | ||
e = np.linspace(1, 30, 1000)*u.keV | ||
|
||
plt.plot(e, gaas_detector.absorption(e) * gaas_deadlayer.transmission(e)) | ||
plt.xlabel(f'Energy [{e.unit}]') | ||
plt.ylabel('Quantum Efficiency') | ||
plt.ylim(0.001, 1) | ||
plt.yscale('log') | ||
plt.show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
X-ray Transmission through air at STP | ||
====================================== | ||
|
||
.. plot:: | ||
:include-source: | ||
|
||
import numpy as np | ||
from matplotlib import pyplot as plt | ||
from astropy import constants as const | ||
import astropy.units as u | ||
|
||
from roentgen.absorption import Material | ||
from roentgen.util import density_ideal_gas | ||
|
||
air_density = density_ideal_gas(1 * const.atm, 20 * u.Celsius) | ||
air = Material('air', 1 * u.m, density=air_density) | ||
|
||
e = np.linspace(1, 30, 1000)*u.keV | ||
|
||
plt.plot(e, air.transmission(e)) | ||
plt.xlabel(f'Energy [{e.unit}]') | ||
plt.ylabel('X-ray Transmission through 1 m of air at STP') | ||
plt.ylim(0, 1) | ||
plt.show() |
Oops, something went wrong.