@@ -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()
121146plot.show()
122147```
123148
149+
124150![ openmc particle source position plot] ( https://user-images.githubusercontent.com/8583900/179424915-bee56a87-6214-46ef-8625-92b8f4cbd1b3.png )
125151
126152Tokamak 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 )
0 commit comments