Cross Section Data Sources – pyne.xs.data_source

Cross section library data source interfaces.

class pyne.xs.data_source.DataSource(src_phi_g=None, dst_group_struct=None, **kwargs)[source]

Base cross section data source.

This is an abstract class which provides default functionality when subclassed and certain methods are overridden. A data source should know how to find cross section information for a given nuclide, reaction type, and temperature, if available. If such data is not present for this source, then the source should return None.

Furthermore, a data source must be able to declare whether the data is present on the users system.

Finally, data sources distinguish between group structure information coming from or for the source itself (src) and optional user-defined destination (dst) group structure information. This allows the data source to define how it wishes to discretize its data to the custom destination form.

The following methods must be overridden in all DataSource subclasses:

@property
def exists(self):
    # Is this DataSource available on the user's system?
    return (True or False)

def _load_group_structure(self):
    # Sets the source group structure, E_g, native to this DataSource
    ...
    self.src_group_struct = E_g (array-like)

def _load_reaction(self, nuc, rx, temp=300.0):
    # Returns the rection channel for a nuclide at a given temperature
    # or returns None, if this unavailable in this DataSource.
    ...
    return rxdata (ndarray of floats, length self.src_ngroups, or None)

The following methods may be overridden in DataSource subclasses as a potential optimization:

def load(self, temp=300.0):
    # loads the entire data source into memory.  This prevents
    # excessive queries to disk.  This does not return anything.
    pass

# a class attribute that specificies whether the data source uses
# temperature information.  If the data source does not use such
# info, the keys in the rxcache dictionary are shortend to just the
# (nuc, rx) pair.  Accessing (nuc, rx, temp) data will defer to the
# (nuc, rx) pair.
_USES_TEMP = True

Note that non-multigroup data sources should also override the discretize() method. Other methods and properties may also need to be overriden depending on the data source at hand.

All data sources may be used independently or in conjunction with a cross section cache instance.

Parameters:

src_phi_g : array-like, optional

Group fluxes which must match the group structure for this data source.

dst_group_struct : array-like, optional

The energy group structure [MeV] of the destination cross sections. Used when discretizing cross sections from this source.

reaction(nuc, rx, temp=300.0)[source]

Gets the cross section data for this reaction channel either directly from the data source or from the rxcache.

Parameters:

nuc : int or str

A nuclide.

rx : int or str

Reaction id or name.

temp : float, optional

Temperature [K] of material, defaults to 300.0.

Returns:

rxdata : ndarray

Source cross section data, length src_ngroups.

discretize(nuc, rx, temp=300.0, src_phi_g=None, dst_phi_g=None)[source]

Discretizes the reaction channel from the source group structure to that of the destination weighted by the group fluxes. This implemenation is only valid for multi-group data sources. Non-multigroup data source should also override this method.

Parameters:

nuc : int or str

A nuclide.

rx : int or str

Reaction id or name.

temp : float, optional

Temperature [K] of material, defaults to 300.0.

src_phi_g : array-like, optional

Group fluxes for this data source, length src_ngroups.

dst_phi_g : array-like, optional

Group fluxes for the destiniation structure, length dst_ngroups.

Returns:

dst_sigma : ndarray

Destination cross section data, length dst_ngroups.

load(temp=300.0)[source]

Loads the entire data source into memory.

class pyne.xs.data_source.NullDataSource(**kwargs)[source]

Cross section data source that always exists and always returns zeros.

Parameters:

kwargs : optional

Keyword arguments to be sent to base class.

discretize(nuc, rx, temp=300.0, src_phi_g=None, dst_phi_g=None)[source]

Returns zeros.

class pyne.xs.data_source.SimpleDataSource(**kwargs)[source]

Simple cross section data source based off of KAERI data. This data source does not use material temperature information.

Parameters:

kwargs : optional

Keyword arguments to be sent to base class.

discretize(nuc, rx, temp=300.0, src_phi_g=None, dst_phi_g=None)[source]

Discretizes the reaction channel from simple group structure to that of the destination weighted by the group fluxes. Since the simple data source consists of only thermal (2.53E-8 MeV), fission (1 MeV), and 14 MeV data points, the following piecewise functional form is assumed:

System Message: WARNING/2 (\sigma(E) = \sigma(2.53E-8) \sqrt{\frac{2.53E-8}{E}} \sigma(E) = \frac{\sigma(14) - \sigma(1)}{14 - 1} (E - 1) + \sigma(1))

latex exited with error [stdout] This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=latex) restricted \write18 enabled. entering extended mode (./math.tex LaTeX2e <2016/02/01> Babel <3.9q> and hyphenation patterns for 3 language(s) loaded. (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2014/09/29 v1.4h Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo)) (/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty ! LaTeX Error: File `utf8x.def' not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: def) Enter file name: ! Emergency stop. <read *> l.173 \endinput ^^M No pages of output. Transcript written on math.log.
Parameters:

nuc : int or str

A nuclide.

rx : int or str

Reaction key (‘gamma’, ‘alpha’, ‘p’, etc.) or MT number.

temp : float, optional

Temperature [K] of material, defaults to 300.0.

src_phi_g : array-like, optional

IGNORED!!! Included for API compatability

dst_phi_g : array-like, optional

Group fluxes for the destiniation structure, length dst_ngroups.

Returns:

dst_sigma : ndarray

Destination cross section data, length dst_ngroups.

class pyne.xs.data_source.CinderDataSource(**kwargs)[source]

Cinder cross section data source. The relevant cinder cross section data must be present in the nuc_data for this data source to exist. This data source does not use material temperature information.

Parameters:

kwargs : optional

Keyword arguments to be sent to base class.

class pyne.xs.data_source.EAFDataSource(**kwargs)[source]

European Activation File cross section data source. The relevant EAF cross section data must be present in the nuc-data for this data source to exist.

Parameters:

kwargs : optional

Keyword arguments to be sent to base class.

Notes

EAF data does not use temperature information.

load(temp=300.0)[source]

Loads all EAF into memory.

Parameters:

temp : float, optional

The material temperature

Notes

EAF data does not use temperature information (temp).

class pyne.xs.data_source.ENDFDataSource(fh, src_phi_g=None, dst_group_struct=None, **kwargs)[source]

Evaluated Nuclear Data File cross section data source. The ENDF file must exist for this data source to exist.

Parameters:

fh : string, file handle

Path to ENDF file, or ENDF file itself.

kwargs : optional

Keyword arguments to be sent to base class.

reaction(nuc, rx, nuc_i=None)[source]

Get reaction data.

Parameters:

nuc : int or str

Nuclide containing the reaction.

rx : int or str

Desired reaction

nuc_i : int or str

Nuclide containing the reaction. Defaults to nuc.

group_bounds : tuple

Low and high energy bounds of the new group.

Returns:

rxdict : dict

Dictionary containing source group structure, energy values, cross- section data, and interpolation data.

discretize(nuc, rx, temp=300.0, src_phi_g=None, dst_phi_g=None)[source]

Discretizes the reaction channel from the source group structure to that of the destination weighted by the group fluxes.

Parameters:

nuc : int or str

A nuclide.

rx : int or str

Reaction id or name.

temp : float, optional

Temperature [K] of material, defaults to 300.0.

src_phi_g : array-like, optional

Group fluxes for this data source, length src_ngroups.

dst_phi_g : array-like, optional

Group fluxes for the destiniation structure, length dst_ngroups.

Returns:

dst_sigma : ndarray

Destination cross section data, length dst_ngroups.

class pyne.xs.data_source.OpenMCDataSource(cross_sections=None, src_group_struct=None, **kwargs)[source]

Data source for ACE data that is listed in an OpenMC cross_sections.xml file. This data source discretizes the reactions to a given group stucture when the reactions are loaded in. Reseting this source group structure will clear the reaction cache.

Parameters:

cross_sections : openmc.CrossSections or string or file-like, optional

Path or file to OpenMC cross_sections.xml

src_group_struct : array-like, optional

The group structure to discretize the ACE data to, defaults to np.logspace(1, -9, 101).

kwargs : optional

Keyword arguments to be sent to DataSource base class.

pointwise(nuc, rx, temp=300.0)[source]

Returns pointwise reaction data from ACE files indexed by OpenMC.

Parameters:

nuc : int

Nuclide id.

rx : int

Reaction id.

temp : float, optional

The nuclide temperature in [K].

Returns:

E_points : array-like

The array or energy points that the reaction is evaluated at.

rawdata : array-like

Raw pointwise reaction data.

self_shield(nuc, rx, temp, E_points, xs_points)[source]

Calculates the self shielded cross section for a given nuclide and reaction. This calculation uses the Bonderanko method.

Parameters:

nuc : int

Nuclide id.

rx : int

Reaction id.

temp : float, optional

The nuclide temperature in [K].

E_points : array like

The point wise energies.

xs_points : array like

Point wise cross sections

Returns:

rxdata : array like

collapsed self shielded cross section for nuclide nuc and reaction rx

bkg_xs(nuc, temp=300)[source]

Calculates the background cross section for a nuclide (nuc)

Parameters:

nuc : int

Nuclide id.

temp : float, optional

The nuclide temperature in [K].

Returns:

sig_b : array like

Group wise background cross sections.

load(temp=300.0)[source]

Loads the entire data source into memory. This can be expensive for lots of ACE data.

Parameters:

temp : float, optional

Temperature [K] of material, defaults to 300.0.

class pyne.xs.data_source.StatePointDataSource(state_point, tallies, num_den, phi_tot, **kwargs)[source]

Data source for reactions coming from openmc state points

Parameters:

state_point : string

Path to the openmc statepoint file to be used to build the data_source

tallies : array-like

The tally id’s used to pull the cross sections from.

num_dens: map of int to float

A map containing the number densities of the nuclides in the material used in the statepoint.

phi_tot: array of floats

The total flux within the reactor

kwargs : optional

Keyword arguments to be sent to DataSource base class.

reaction(nuc, rx, temp)[source]

Loads reaction data from ACE files indexed by OpenMC.

Parameters:

nuc : int

Nuclide id.

rx : int

Reaction id.

Return

——

Array containing the cross sections for the reaction

requested.