Extracting data from statepoint binaries

Hi

I’ve been trying to read some data from the statepoint binary files. I would like to get data about the fission source but I’m having some problems. The code should be saving the source to the statepoint file but when I run a python script trying to access it I get the following error:
“AttributeError: ‘StatePoint’ object has no attribute ‘source_bank’”
I was running a modified version of the results.py script but maybe I’m doing it wrong. How would I read let’s say the x coordinate of the first particle in the fission source? The statepoint file specification does list it as ‘source_bank(i) % xyz(1:3)’.

Regards,
Kaur

Hi Kaur,

This should do the trick for you:

import statepoint
sf = statepoint.StatePoint(‘statepoint.100.binary’) <— or whatever your statepoint file is named
sf.read_source()
print(sf.source[0])

Sorry again – I know there’s a lack of documentation on this topic.

Regards,
Paul