<jupyter_start><jupyter_text>ACE Module==========This notebook demonstrates basic usage of the ``pyne.ace`` module.<jupyter_code>import os
import matplotlib.pyplot as plt
import pyne.ace
import requests
url = "https://www-nds.iaea.org/wolfram/w180/beta3/W180.ace"
r = requests.get(url)
with open("W180.ace", "wb") as outfile:
    outfile.write(r.content)<jupyter_output><empty_output><jupyter_text>The main class in ``pyne.ace`` is called ``Library``. It is instantiated using the name of an ACE file, in this case one distributed with MCNP.<jupyter_code>lib = pyne.ace.Library('W180.ace')<jupyter_output><empty_output><jupyter_text>One can choose to read all tables in the file or selectively read a subset by specifying an argument to the ``read`` method.<jupyter_code>lib.read('74180.21c')<jupyter_output><empty_output><jupyter_text>After the call to ``read()``, the Library instance will have a dictionary called ``tables``.<jupyter_code>lib.tables
w180 = lib.tables['74180.21c']<jupyter_output><empty_output><jupyter_text>Once a table is selected, we can inspect, e.g., the energy grid and the total cross section.<jupyter_code>w180.energy
w180.sigma_t<jupyter_output><empty_output><jupyter_text>To get data on a reaction, such as fission or $(n,2n)$, there is an attribute called ``reactions``.<jupyter_code>w180.reactions
elastic = w180.reactions[2]<jupyter_output><empty_output><jupyter_text>An instance of a Reaction contains the reaction cross section and any angular or energy distributions that may be present.<jupyter_code>elastic.sigma<jupyter_output><empty_output><jupyter_text>With the energy grid (stored on the table), and the cross section (stored on the reaction), one can generate plots of the cross section.<jupyter_code>plt.loglog(w180.energy, elastic.sigma)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11374930977360574, 'fraction_numerical': 0.025952512424075095, 'mean_word_length': 7.125560538116592, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '8', 'dir': 'jupyter-structured-clean-dedup', 'id': '617034', 'license': 'MIT', 'n_tokens_mistral': 638, 'n_tokens_neox': 592, 'n_words': 169, 'path': 'examples/ace.ipynb', 'repo_name': 'MigMagan/pyne', 'size': '1811'}