statepoint file is not reading with python script.

54 views
Skip to first unread message

Sharif Abu Darda

unread,
Aug 12, 2020, 8:57:07 PM8/12/20
to OpenMC Users Group
I have a statepoint file and I am trying to asses it in python scripts as 

import openmc
import numpy as np
sp1 = openmc.StatePoint('statepoint.120.h5')
tally = sp1.tallies[1]
flux = tally.mean.ravel()
print(flux)

I am trying to access the tally data.. when I run the script, the terminal is stuck. it never goes to anywhere. and, yes, the statepoint file name is correct. After a while i turn off the terminal process Ctrl+C, This is what I see, it looks the script is stuck in the statepoint initializing line. What am I missing here? 

^CTraceback (most recent call last):

  File "12.py", line 9, in <module>

    sp1 = openmc.StatePoint('statepoint.120.h5')

  File "/opt/anaconda3/envs/openmc-env/lib/python3.8/site-packages/openmc/statepoint.py", line 142, in __init__

    su = openmc.Summary(path_summary)

  File "/opt/anaconda3/envs/openmc-env/lib/python3.8/site-packages/openmc/summary.py", line 57, in __init__

    self._read_geometry()

  File "/opt/anaconda3/envs/openmc-env/lib/python3.8/site-packages/openmc/summary.py", line 107, in _read_geometry

    self._read_surfaces()

  File "/opt/anaconda3/envs/openmc-env/lib/python3.8/site-packages/openmc/summary.py", line 125, in _read_surfaces

    surface = openmc.Surface.from_hdf5(group)

  File "/opt/anaconda3/envs/openmc-env/lib/python3.8/site-packages/openmc/surface.py", line 459, in from_hdf5

    bc = group['boundary_type'][()].decode()

  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper

  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper

  File "/opt/anaconda3/envs/openmc-env/lib/python3.8/site-packages/h5py/_hl/dataset.py", line 543, in __getitem__

    self.id.read(mspace, fspace, arr, mtype)

KeyboardInterrupt

Reply all
Reply to author
Forward
0 new messages