MESHINFO files#

The complete API can be found at f4enix.output.meshinfo.MeshInfo

This kind of files are additional files that are printed by a D1S-UNED run that contain information on the meshes defined in an MCNP input

from f4enix.output.meshinfo import MeshInfoFile

# load the mesh info from an existing file
meshinfo_file = MeshInfoFile.from_file('meshinfo')
meshinfo_file.info  # Each mesh info is stored in the .info dictionary
/home/docs/checkouts/readthedocs.org/user_builds/f4enix/envs/developing/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html
  from .autonotebook import tqdm as notebook_tqdm
{4: <f4enix.output.meshinfo.MeshInfoCyl at 0x70b9817f67a0>,
 234: <f4enix.output.meshinfo.MeshInfoCyl at 0x70b9435173a0>}
# these are simple objects that store a quantity of data about the meshes
# check the documentation for a complete list of attributes
meshinfo = meshinfo_file.info[4]
print('axis: ', meshinfo.axis)
print('mesh type: ', meshinfo.coordinates)
axis:  [0. 0. 1.]
mesh type:  CoordinateType.CYL

The most important attribute though is its DataMass object, which contains a dataframe reporting the mass of each MCNP cell portion contained inside a specific voxel. The correspondent material is also provided.

datamass = meshinfo.data_mass
datamass.df
Mass [g]
Voxel Material Cell
1 0 4 0.000000
2 0 4 0.000000
3 0 4 0.000000
4 0 4 0.000000
5 0 4 0.000000
... ... ... ...
2348 1 1 121449.990840
2349 1 1 121449.990840
2350 1 1 48580.072062
2351 1 1 48580.072062
2352 1 101 24289.972926

2352 rows × 1 columns

A few helper methods have also been provided for this class.

# get a list of cells having a specific material
print('cells with material M1')
print(datamass.get_cells_from_materials([1]))

# Apply some filters to the DF
print('filtered df')
datamass.get_filtered_dataframe(voxels=[1, 2, 50, 120], materials=[0],
                                cells=[4])
cells with material M1
[  2 201   1 101]
filtered df
Mass [g]
Voxel Material Cell
1 0 4 0.0
2 0 4 0.0
120 0 4 0.0