Skip to content

Commit 975ab97

Browse files
author
Pascal Wolf
authored
Merge pull request #9 from SiLab-Bonn/development
v1.0.0
2 parents e081fcf + 307a134 commit 975ab97

36 files changed

+153
-60
lines changed

.github/workflows/main.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
push:
9+
branches:
10+
- master
11+
- development
12+
pull_request:
13+
branches:
14+
- master
15+
16+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17+
jobs:
18+
# This workflow contains a single job called "build"
19+
tests:
20+
name: Testing on Python ${{matrix.python-version}} | ${{matrix.sim}}
21+
runs-on: ubuntu-20.04
22+
23+
strategy:
24+
fail-fast: false
25+
matrix:
26+
os: [ubuntu-20.04, ubuntu-latest]
27+
python-version: [3.7, 3.8, 3.9]
28+
29+
# Steps represent a sequence of tasks that will be executed as part of the job
30+
steps:
31+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
32+
- uses: actions/checkout@v2
33+
34+
- name: Anaconda ${{matrix.python-version}} setup
35+
uses: conda-incubator/setup-miniconda@v2
36+
with:
37+
auto-update-conda: true
38+
python-version: ${{matrix.python-version}}
39+
40+
- name: Dependency installation
41+
shell: bash -l {0}
42+
run: |
43+
conda info -a
44+
conda install numpy scipy pyyaml matplotlib nose jupyter pandas
45+
pip install -r requirements.txt
46+
47+
- name: Package installation
48+
shell: bash -l {0}
49+
run: |
50+
python setup.py develop
51+
52+
- name: Testing
53+
shell: bash -l {0}
54+
run: nosetests

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# example checkpoints
2-
irrad_spectroscopy/examples/.ipynb_checkpoints/
2+
examples/.ipynb_checkpoints/
33
# example output folder
4-
irrad_spectroscopy/examples/output/
4+
examples/output/
55
# pyc
66
*.pyc
77
# pycharm

.travis.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

README.rst

Lines changed: 86 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
==================================
2-
Irrad_Spectroscopy |travis-status|
2+
Irrad_Spectroscopy |test-status|
33
==================================
44

55
Introduction
66
============
77

8-
``irrad_spectroscopy`` is a package intended to do gammma spectroscopy of (proton) irradiated samples such as chips, sensors,
9-
PCBs, etc. but can be also used for general gamma spectroscopy e.g. of radioactive sources. It consits of few independent
10-
methods which togehter allow for a complete spectroscopic analysis of radioactive gamma-spectra. A step-by-step full spectroscopy
11-
of an example spectrum can be found in the ``examples`` folder.
8+
``ìrrad_spectroscopy`` is a package which provides functions for gamma and X-ray spectroscopy, including isotope identification, activity determination and spectral dose calculations.
9+
Furthermore, it offers functions for calculating the gamma equivalent dose for given isotopes as a function of their initial activity.
10+
11+
The package was developed for spectroscopic analysis or proton-irradiated semiconductor devices but can be used to analyze various samples,
12+
from radioactive sources to activated machine parts. It consits of few independent methods which togehter allow for a complete spectroscopic analysis, including plotting, of
13+
radioactive gamma-spectra. A step-by-step full spectroscopy of an example spectrum can be found in the ``examples`` folder.
1214

1315
Installation
1416
============
1517

16-
You have to have Python 2/3 with the following packages installed:
18+
You have to have Python 3 with the following packages installed:
1719

1820
- numpy
1921
- scipy
@@ -37,6 +39,9 @@ To finally install ``irrad_spectroscopy`` run the setup file
3739
Example usage
3840
=============
3941

42+
Full spectroscopy
43+
-----------------
44+
4045
Check the ``examples`` folder for several measured data sets of different sources for calibration and analysis. A `Jupyter Notebook <http://jupyter.org/>`_
4146
with a step-by-step analysis of an example spectrum of an irradiated chip is provided. Install jupyter and run
4247

@@ -46,14 +51,86 @@ with a step-by-step analysis of an example spectrum of an irradiated chip is pro
4651
4752
in order to open the web interface.
4853

54+
Equivalent dose calculation
55+
--------------------------
56+
57+
The package implements dose rate calculations for individual gamma lines as well as full gamma spectra of isotopes
58+
for various materials (search materials in `this table <https://github.com/SiLab-Bonn/irrad_spectroscopy/blob/development/irrad_spectroscopy/tables/xray_coefficient_table.yaml>`_)
59+
Dose rate calculations are implemented, assuming a point-like source!
60+
61+
Calculating dose rate of an individual gamma line in air:
62+
63+
.. code-block:: python
64+
65+
# Import
66+
from irrad_spectroscopy.physics import gamma_dose_rate
67+
68+
# Get dose rate of single gamma line in uSv/h
69+
# Zn65 line at 1115.564 keV, prob 50.60%, activity of 20 kBq at a distance of 100 cm in air
70+
res = gamma_dose_rate(energy=1115.546,
71+
probability=0.506,
72+
activity=20e3,
73+
distance=100,
74+
material='air')
75+
76+
print(res) # Prints 1.515e-3 # uSv/h
77+
78+
Calculating the (integrated) gamma dose rate of an isotope in air:
79+
80+
.. code-block:: python
81+
82+
# Import
83+
from irrad_spectroscopy.physics import isotope_dose_rate
84+
85+
# Zn65 with activity of 20 kBq at a distance of 100 cm in air
86+
res = isotope_dose_rate(isotope='65_Zn',
87+
activity=20e3,
88+
distance=100,
89+
material='air')
90+
91+
print(res) # Prints {'65_Zn': 1.515e-3} # uSv/h
92+
93+
# Zn65 with activity of 20 kBq at a distance of 100 cm in air
94+
# integrated over 2000 hours
95+
res = isotope_dose_rate(isotope='65_Zn',
96+
activity=20e3,
97+
distance=100,
98+
material='air',
99+
time=2000)
100+
101+
print(res) # Prints {'65_Zn': 2.66} # uSv
102+
103+
Calculating the gamma dose rate of multiple isotopes in air:
104+
105+
.. code-block:: python
106+
107+
# Import
108+
from irrad_spectroscopy.physics import isotope_dose_rate
109+
110+
# Multiple isotopes (Zn65 and Be7) with different activities
111+
# (20 kBq, 100kBq) at a distance of 100 cm in air
112+
res = isotope_dose_rate(isotope=('65_Zn', '7_Be'),
113+
activity=(20e3, 100e3),
114+
distance=100,
115+
material='air')
116+
117+
print(res) # Prints {'65_Zn': 1.515e-3, '7_Be': 0.73e-3} # uSv/h
118+
49119
Testing
50120
=======
51121

52122
The code in this package has unit-tests. These tests contain a benchmark with actual gamma-spectroscopy data of
53123
two calibrated, radioactive sources, namely 22-Na and 133-Ba. The activity reconstruction efficiencies for the
54124
tested data sets are tested to be above 90%.
55125

56-
57-
.. |travis-status| image:: https://api.travis-ci.com/SiLab-Bonn/irrad_spectroscopy.svg?branch=master
58-
:target: https://travis-ci.com/SiLab-Bonn/irrad_spectroscopy
126+
.. |test-status| image:: https://github.com/Silab-Bonn/irrad_spectroscopy/actions/workflows/main.yml/badge.svg?branch=development
127+
:target: https://github.com/SiLab-Bonn/irrad_spectroscopy/actions
59128
:alt: Build status
129+
130+
Example spectrum
131+
================
132+
133+
Generated spectrum, including background and identified peaks, of a radioactive sample after proton irradiation.
134+
Multiple isotopes can be assigned to one peak due to the uncertaiunty of the energy calibration.
135+
136+
.. image:: static/figs/sample_spectrum.png
File renamed without changes.

irrad_spectroscopy/examples/example_data/152Eu_point_source.yaml renamed to examples/example_data/152Eu_point_source.yaml

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)