#!/usr/bin/env python # coding: utf-8 # In[10]: from collections import defaultdict import matplotlib.pyplot as plt import openmc.deplete import openmc.data # In[3]: chain = openmc.deplete.Chain.from_xml('/home/romano/openmc-data/depletion/chain_casl_pwr.xml') # In[4]: u235 = chain['U235'] # In[5]: u235.yield_data # The yield data is organized by incident neutron energy # In[6]: u235.yield_data.energies # You can index the yield data by energy: # In[7]: thermal_yield = u235.yield_data[0.0253] thermal_yield # And then by a product: # In[8]: thermal_yield['I135'] # `thermal_yield` will act as a dictionary, so you can use methods like `items()` on it: # In[9]: list(thermal_yield.items()) # In[11]: chain_yields = defaultdict(float) for nucname, y in thermal_yield.items(): z, a, m = openmc.data.zam(nucname) chain_yields[a] += y mass, yields = zip(*sorted(chain_yields.items())) # In[18]: plt.plot(mass, yields) plt.xlabel('Mass number') plt.ylabel('Chain yield') # In[ ]: