Serpent Support – pyne.serpent

Serpent is a continuous energy Monte Carlo reactor physics code. Pyne contains support for reading in serpents three types of output files, which are all in Matlab’s *.m format. These files are all read in as Python dictionaries and optionally written out to a corresponding *.py file.

All functionality may be found in the serpent package:

from pyne import serpent

Serpent API

pyne.serpent.parse_dep(depfile, write_py=False, make_mats=True)[source]

Converts a serpent depletion *_dep.m output file to a dictionary (and optionally to a *_dep.py file).

Parameters:

depfile : str or file-like object

Path to depletion file or a dep file handle.

write_py : bool, optional

Flag for whether to write the dep file to an analogous python file.

make_mats : bool, optional

Flag for whether or not to build Materials out of mass data and add these to the return dictionary. Materials so added have names which end in ‘_MATERIAL’.

Returns:

dep : dict

Dictionary of the parsed depletion information. Please see the Serpent manual for a complete description of contents.

pyne.serpent.parse_det(detfile, write_py=False)[source]

Converts a serpent detector *_det.m output file to a dictionary (and optionally to a *_det.py file).

Parameters:

detfile : str or file-like object

Path to detector file or a det file handle.

write_py : bool, optional

Flag for whether to write the det file to an analogous python file.

Returns:

det : dict

Dictionary of the parsed detector. Please see the Serpent manual for a complete description of contents.

pyne.serpent.parse_res(resfile, write_py=False)[source]

Converts a serpent results *_res.m output file to a dictionary (and optionally to a *_res.py file).

Parameters:

resfile : str or file-like object

Path to results file or a res file handle.

write_py : bool, optional

Flag for whether to write the res file to an analogous python file.

Returns:

res : dict

Dictionary of the parsed results. Please see the Serpent manual for a complete description of contents.