# Accessing Photo-Nuclear Reaction Data

**URL:** <https://openmc.discourse.group/t/accessing-photo-nuclear-reaction-data/3405>\
**Category:** User Support\
**Created:** [September 8, 2023, 9:07am UTC](https://openmc.discourse.group/t/accessing-photo-nuclear-reaction-data/3405 "2023-09-08T09:07:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![scheur13](https://avatars.discourse-cdn.com/v4/letter/s/e56c9b/32.png) [@scheur13](https://openmc.discourse.group/u/scheur13)\
**Post date:** [September 8, 2023, 9:07am UTC](https://openmc.discourse.group/t/accessing-photo-nuclear-reaction-data/3405/1 "2023-09-08T09:07:27Z")

</div>

Hi,

I was trying to use the `openmc.data` class to access photo-nuclear reaction cross sections either in `ENDF` or `ACE` format. I tried accessing the data using the `IncidentPhoton` and `PhotonReaction` classes but got error for either one.  
I am unsure if these classes are even designed to access the data I am interested in and looking through the documentation I wasn’t able to find a definitive answer. My code looks like this:

> mo100\_g = openmc.data.PhotonReaction.from\_ace(‘./j20u/42100.20u’, mt=4)

It returns the following error:

> File [~/anaconda3/envs/openmc/lib/python3.11/site-packages/openmc/data/photon.py:992](https://file+.vscode-resource.vscode-cdn.net/home/stefan/Python/PhD/Simulation/PHITS/LWFA_Beamline/Medical/~/anaconda3/envs/openmc/lib/python3.11/site-packages/openmc/data/photon.py:992), in PhotonReaction.from\_ace(cls, ace, mt)
> 
> 989 rx = cls(mt) 991  
> '# Get energy grid (stored as logarithms)  
> → 992 n = ace.nxs[3] 993 idx = ace.jxs[1]  
> 994 energy = np.exp(ace.xss[idx : idx+n])\*EV\_PER\_MEV
> 
> AttributeError: ‘str’ object has no attribute ‘nxs’

I also tried using the `openmc.data.ace.Library` function and I was able to read the ACE file but I wasn’t able to get to the cross sections. Any insight and help is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [September 16, 2023, 9:34pm UTC](https://openmc.discourse.group/t/accessing-photo-nuclear-reaction-data/3405/2 "2023-09-16T21:34:18Z")

</div>

Hi @scheur13. At present, our ACE/ENDF functionality in `openmc.data` only handles photoatomic data, not photonuclear data. It wouldn’t be terribly difficult to code something up to read the data given our existing capabilities though if you wanted to give it a shot.
