sandy.mcnp.mctal module
This module contains all classes and functions to provide a API for a MCNP mctal file.
- class sandy.mcnp.mctal.MctalTally(tally, vals, *args, **kwargs)
Bases:
object
Container for a MCTAL tally.
- Attributes:
- valspandas.DataFrame
dataframe of tally values
6 columns are provided:
f[c|t] : cells, surfaces or detector bins
fc = “cumulative” value is given ft = “total” value is given
d : total vs. direct or flagged vs. unflagged bins
For detectors, n=2 unless there is an ND on the F5 card; for cell and surface tallies, n=1 unless there is an SF or CF card
u[c|t] : user bins
uc = “cumulative” value is given ut = “total” value is given
s[c|t] : segment bins
sc = “cumulative” value is given st = “total” value is given
m[c,t] : multiplier bins
mc = “cumulative” value is given mt = “total” value is given
c[c,t] : cosine bins
cc = “cumulative” value is given ct = “total” value is given
Note
f flag for point values is not yet implemented
e[c,t] : energy bins
ec = “cumulative” value is given et = “total” value is given
Note
f flag for point values is not yet implemented
t[c,t] : time bins
tc = “cumulative” value is given tt = “total” value is given
Note
f flag for point values is not yet implemented
vals : tally values
The order is what a 9-dimensional Fortran array would have if it were dimensioned (NF,…,NE,NT), where NF is the # of cell, surface, or detector bins, NE is the # of energy bins, and NT is the # of time bins
err : tally statistical error (relative)
Methods
from_file
([filename, encoding, errors])Parse a mctal output file and return tallies.
what_bins
- property cell_bins
- property cosine_bins
- property detector_bins
- property energy_bins
- classmethod from_file(filename='mctal', encoding='utf8', errors='ignore')
Parse a mctal output file and return tallies.
- Parameters:
- filenamestr, optional, default is ‘mctal’
name of the mctal file
- encodingstr, optional, default is ‘utf8’
option passed to python built-in function open
- errorsstr, optional, default is ‘ignore’
option passed to python built-in function open
- Returns:
- dict
dictionary of (tally numbers, MctalTally objects)
- property multiplier_bins
- property segment_bins
- property time_bins
- property user_bins
- what_bins()