paulromano / endf-python

Python ENDF Parser
https://endf-python.readthedocs.io
MIT License
21 stars 4 forks source link

Feature request: Add support for temperatures #13

Open shimwell opened 4 weeks ago

shimwell commented 4 weeks ago

Thanks for making this package Paul

I've been trying to make use of endf.IncidentNeutron instead of openmc.IncidentNeutron for a plotting package I'm working on.

The first feature that appears to be different is the temperature attribute.

import openmc
openmc_neutron = openmc.data.IncidentNeutron.from_ace('neutron_file/Li/006/lib/endf/Li006-n.ace')
openmc_neutron.temperatures
>>>['293K']

import endf
endf_neutron = endf.IncidentNeutron.from_ace('neutron_file/Li/006/lib/endf/Li006-n.ace')
endf_neutron.temperatures
>>> AttributeError: module 'endf' has no attribute 'temperature'. Did you mean: 'temperature_str'?

Just wondering if adding temperature is on the roadmap

shimwell commented 4 weeks ago

looks like one can access the temperatures with this code

endf_neutron = endf.IncidentNeutron.from_ace('neutron_file/Li/006/lib/endf/Li006-n.ace')
reactions=endf_neutron.reactions[1]
temperatures=list(reactions.xs.keys())

So perhaps we could just add a getter to the IncidentNeutron class

shimwell commented 4 weeks ago

If we do add tempertures then we could perhaps also sneak in IncidentNeutron.kTs which is in the openmc.IncidentNeutron and is the temperture in eV

Also openmc.IncidentNeutron.energy makes use of temperatures for the keys