Skip to content

Commit 6bb64b0

Browse files
committed
updated readme with gammas spec image
1 parent 152588d commit 6bb64b0

5 files changed

Lines changed: 30 additions & 9 deletions

File tree

.flake8

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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,4 @@ openmc_source_plotter/_version.py
137137

138138
# plots
139139
*.png
140+
src/openmc_source_plotter/_version.py

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,31 @@ plot.show()
9191

9292
![openmc particle source direction plot](https://user-images.githubusercontent.com/8583900/143615706-3b3a8467-0233-42d6-a66c-d536c80a01d8.png)
9393

94+
95+
## Plot gamma spectrum of particles
96+
97+
```python
98+
import openmc
99+
import openmc_source_plotter # adds plot_gamma_emission plot to materials
100+
101+
102+
openmc.config["chain_file"] = "chain-endf.xml"
103+
104+
my_material = openmc.Material()
105+
my_material.add_nuclide("Xe135", 1e-12)
106+
my_material.add_nuclide("U235", 1)
107+
my_material.add_nuclide("U238", 1)
108+
my_material.add_nuclide("Co60", 1e-9)
109+
my_material.volume = 1 # must be set so number of atoms can be found
110+
111+
# adds labels to the most active 3 gamma energies
112+
plt = my_material.plot_gamma_emission(label_top=3)
113+
plt.xscale("log") # modify axis from default settings
114+
plt.savefig("gamma_spec.png")
115+
```
116+
117+
![openmc gamma spectrum](https://user-images.githubusercontent.com/8583900/228280129-b8160e18-9ca9-4b20-a4e1-d2948908daf6.png)
118+
94119
## Plot position of particles
95120

96121
```python
@@ -121,7 +146,9 @@ plot = my_source.plot_source_position()
121146
plot.show()
122147
```
123148

149+
124150
![openmc particle source position plot](https://user-images.githubusercontent.com/8583900/179424915-bee56a87-6214-46ef-8625-92b8f4cbd1b3.png)
125151

126152
Tokamak sources can also be plotted using the [openmc-plasma-source](https://github.com/fusion-energy/openmc-plasma-source) package
153+
127154
![openmc_source_plotter_openmc-plasma-source_tokamak](https://user-images.githubusercontent.com/8583900/187487894-ba0bd025-46f2-4c7d-8b15-3d260aed47a0.png)

examples/example_gamma_spec_plot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import openmc
2-
import openmc.deplete
32
import openmc_source_plotter # adds plot_gamma_emission plot to materials
43

54

@@ -10,8 +9,9 @@
109
my_material.add_nuclide("U235", 1)
1110
my_material.add_nuclide("U238", 1)
1211
my_material.add_nuclide("Co60", 1e-9)
13-
my_material.volume = 1
12+
my_material.volume = 1 # must be set so number of atoms can be found
1413

14+
# adds labels to the most active 3 gamma energies
1515
plt = my_material.plot_gamma_emission(label_top=3)
1616
plt.xscale("log") # modify axis from default settings
1717
plt.savefig("gamma_spec.png")

src/openmc_source_plotter/_version.py

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

0 commit comments

Comments
 (0)