Im using spyder to run OpenMC, and when I enter openmc.run(), the program willl run but due to problems with my host machine, the kernel will often restart randomly, leading to me losing all of my dataframes and variables which were stored. All the output files from the simulation run are still saved to disk, and I was wondering if there was a way for me to get the simulation data back into the kernel using the saved output files without having to run the simulation again.
Hi Ryani42
Welcome to the community.
Quite a lot of information is contained within the statepoint.batches.h5 and summary.h5 output files after each simulation.
You could consider having a second script that just loads the h5 files and post processes the results. For example getting a tally from a statepoint file could be done like this
# open the results file
sp = openmc.StatePoint("statepoint.10.h5")
# access the tally using pandas dataframes
my_tally = sp.get_tally(id=1)
df = my_tally.get_pandas_dataframe()
# prints the contents of the dataframe
print(df)