# How can I view this statepoint.150.h5 summary.h5 data files in openmc with which commands in ubuntu terminal?

**URL:** <https://openmc.discourse.group/t/how-can-i-view-this-statepoint-150-h5-summary-h5-data-files-in-openmc-with-which-commands-in-ubuntu-terminal/2697>\
**Category:** User Support\
**Created:** [February 7, 2023, 1:12pm UTC](https://openmc.discourse.group/t/how-can-i-view-this-statepoint-150-h5-summary-h5-data-files-in-openmc-with-which-commands-in-ubuntu-terminal/2697 "2023-02-07T13:12:38Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![emilmammadzada](https://avatars.discourse-cdn.com/v4/letter/e/c4cdca/32.png) [@emilmammadzada](https://openmc.discourse.group/u/emilmammadzada)\
**Post date:** [February 7, 2023, 1:12pm UTC](https://openmc.discourse.group/t/how-can-i-view-this-statepoint-150-h5-summary-h5-data-files-in-openmc-with-which-commands-in-ubuntu-terminal/2697/1 "2023-02-07T13:12:38Z")

</div>

How can I view this statepoint.150.h5 summary.h5 data files in openmc with which commands in ubuntu terminal?

---

<div class="post-metadata">

**Author:** ![Shimwell](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shimwell/32/3876_2.png) [@Shimwell](https://openmc.discourse.group/u/Shimwell)\
**Post date:** [February 7, 2023, 2:44pm UTC](https://openmc.discourse.group/t/how-can-i-view-this-statepoint-150-h5-summary-h5-data-files-in-openmc-with-which-commands-in-ubuntu-terminal/2697/2 "2023-02-07T14:44:30Z")

</div>

I think most users will open the statepoint file with the openmc python api as that provides access to useful methods of extracting tallies etc.

However if you want to just see the contents from the terminal the statepoint file is a hdf5 format file so you can use commands like h5dump

```bash
h5dump statepoint.150.h5

```

---

<div class="post-metadata">

**Author:** ![emilmammadzada](https://avatars.discourse-cdn.com/v4/letter/e/c4cdca/32.png) [@emilmammadzada](https://openmc.discourse.group/u/emilmammadzada)\
**Post date:** [February 7, 2023, 3:50pm UTC](https://openmc.discourse.group/t/how-can-i-view-this-statepoint-150-h5-summary-h5-data-files-in-openmc-with-which-commands-in-ubuntu-terminal/2697/3 "2023-02-07T15:50:53Z")

</div>

How can i use python api for this h5 file view in openmc?

---

<div class="post-metadata">

**Author:** ![Shimwell](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shimwell/32/3876_2.png) [@Shimwell](https://openmc.discourse.group/u/Shimwell)\
**Post date:** [February 7, 2023, 7:00pm UTC](https://openmc.discourse.group/t/how-can-i-view-this-statepoint-150-h5-summary-h5-data-files-in-openmc-with-which-commands-in-ubuntu-terminal/2697/4 "2023-02-07T19:00:45Z")

</div>

Assuming you want to access a tally you can open and print the results from within a python script like this

import openmc  
sp = openmc.StatePoint(‘statepoint.150.h5’)  
tally = sp.get\_tally(id=1)  
print(tally)

Docs for statepoints are  
[http://openmc.readthedocs.io/en/stable/pythonapi/generated/openmc.StatePoint.html#openmc.StatePoint](http://openmc.readthedocs.io/en/stable/pythonapi/generated/openmc.StatePoint.html#openmc.StatePoint)

And for summary.h5 files  
[http://openmc.readthedocs.io/en/stable/pythonapi/generated/openmc.Summary.html#openmc.Summary](http://openmc.readthedocs.io/en/stable/pythonapi/generated/openmc.Summary.html#openmc.Summary)

---

<div class="post-metadata">

**Author:** ![emilmammadzada](https://avatars.discourse-cdn.com/v4/letter/e/c4cdca/32.png) [@emilmammadzada](https://openmc.discourse.group/u/emilmammadzada)\
**Post date:** [February 7, 2023, 9:34pm UTC](https://openmc.discourse.group/t/how-can-i-view-this-statepoint-150-h5-summary-h5-data-files-in-openmc-with-which-commands-in-ubuntu-terminal/2697/5 "2023-02-07T21:34:02Z")

</div>

## Python Api gived me this Error

LookupError Traceback (most recent call last)  
Cell In[20], line 3  
1 import openmc  
2 sp = openmc.StatePoint(‘statepoint.150.h5’)  
----\> 3 tally = sp.get\_tally(id=1)  
4 print(tally)

File ~/.local/lib/python3.10/site-packages/openmc/statepoint.py:639, in StatePoint.get\_tally(self, scores, filters, nuclides, name, id, estimator, exact\_filters, exact\_nuclides, exact\_scores)  
637 # If we did not find the Tally, return an error message  
638 if tally is None:  
 → 639 raise LookupError(‘Unable to get Tally’)  
641 return tally

LookupError: Unable to get Tally

---

<div class="post-metadata">

**Author:** ![Shimwell](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shimwell/32/3876_2.png) [@Shimwell](https://openmc.discourse.group/u/Shimwell)\
**Post date:** [February 7, 2023, 9:36pm UTC](https://openmc.discourse.group/t/how-can-i-view-this-statepoint-150-h5-summary-h5-data-files-in-openmc-with-which-commands-in-ubuntu-terminal/2697/6 "2023-02-07T21:36:49Z")

</div>

I forgot to mention you will need to change the id=1 part to the id number of your tally.

---

<div class="post-metadata">

**Author:** ![emilmammadzada](https://avatars.discourse-cdn.com/v4/letter/e/c4cdca/32.png) [@emilmammadzada](https://openmc.discourse.group/u/emilmammadzada)\
**Post date:** [February 7, 2023, 9:40pm UTC](https://openmc.discourse.group/t/how-can-i-view-this-statepoint-150-h5-summary-h5-data-files-in-openmc-with-which-commands-in-ubuntu-terminal/2697/7 "2023-02-07T21:40:25Z")

</div>

I changed the number 1, it gave the same error again

---

<div class="post-metadata">

**Author:** ![Shimwell](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shimwell/32/3876_2.png) [@Shimwell](https://openmc.discourse.group/u/Shimwell)\
**Post date:** [February 8, 2023, 11:02am UTC](https://openmc.discourse.group/t/how-can-i-view-this-statepoint-150-h5-summary-h5-data-files-in-openmc-with-which-commands-in-ubuntu-terminal/2697/8 "2023-02-08T11:02:40Z")

</div>

The example I gave does also assume you have a tally in the simulation as well knowing that tally id number.

We can adapt it to get any tally that is present

```auto
import openmc
sp = openmc.StatePoint(‘statepoint.150.h5’)
tallies = sp.tallies
print(tallies)

```

In my case I get this print out

```auto
{35: Tally
	ID =	35
	Name =	dose_on_cell
	Filters =	CellFilter, EnergyFunctionFilter, ParticleFilter
	Nuclides =	total
	Scores =	['flux']
	Estimator =	tracklength, 36: Tally
	ID =	36
	Name =	surface_current
	Filters =	CellFilter, SurfaceFilter
	Nuclides =	total
	Scores =	['current']
	Estimator =	analog}
>>> 

```

Therefore I could grab tally using the ID or the dictionary key of 35

The [post processing example](https://docs.openmc.org/en/v0.8.0/pythonapi/examples/post-processing.html) might be helpful as a general guide

---

<div class="post-metadata">

**Author:** ![emilmammadzada](https://avatars.discourse-cdn.com/v4/letter/e/c4cdca/32.png) [@emilmammadzada](https://openmc.discourse.group/u/emilmammadzada)\
**Post date:** [February 8, 2023, 2:46pm UTC](https://openmc.discourse.group/t/how-can-i-view-this-statepoint-150-h5-summary-h5-data-files-in-openmc-with-which-commands-in-ubuntu-terminal/2697/9 "2023-02-08T14:46:34Z")

</div>

## I think this example is not the correct command for assembly.Same error

AttributeError Traceback (most recent call last)  
Cell In[9], line 1  
----\> 1 tallies = sp.get\_tallies  
2 print(tallies)

AttributeError: ‘StatePoint’ object has no attribute ‘get\_tallies’

---

<div class="post-metadata">

**Author:** ![Shimwell](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shimwell/32/3876_2.png) [@Shimwell](https://openmc.discourse.group/u/Shimwell)\
**Post date:** [February 8, 2023, 5:35pm UTC](https://openmc.discourse.group/t/how-can-i-view-this-statepoint-150-h5-summary-h5-data-files-in-openmc-with-which-commands-in-ubuntu-terminal/2697/10 "2023-02-08T17:35:49Z")

</div>

corrected sp.get\_tallies to sp.tallies

---

<div class="post-metadata">

**Author:** ![emilmammadzada](https://avatars.discourse-cdn.com/v4/letter/e/c4cdca/32.png) [@emilmammadzada](https://openmc.discourse.group/u/emilmammadzada)\
**Post date:** [February 8, 2023, 5:50pm UTC](https://openmc.discourse.group/t/how-can-i-view-this-statepoint-150-h5-summary-h5-data-files-in-openmc-with-which-commands-in-ubuntu-terminal/2697/11 "2023-02-08T17:50:33Z")

</div>

This code runnig but output:{ }  
In [6] : import openmc  
sp = openmc.StatePoint(‘statepoint.150.h5’)  
tallies = sp.tallies  
print(tallies)  
Output:{}

---

<div class="post-metadata">

**Author:** ![Shimwell](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/shimwell/32/3876_2.png) [@Shimwell](https://openmc.discourse.group/u/Shimwell)\
**Post date:** [February 8, 2023, 6:56pm UTC](https://openmc.discourse.group/t/how-can-i-view-this-statepoint-150-h5-summary-h5-data-files-in-openmc-with-which-commands-in-ubuntu-terminal/2697/12 "2023-02-08T18:56:59Z")

</div>

Sounds like there are no tallies in the model

---

<div class="post-metadata">

**Author:** ![paulromano](https://yyz2.discourse-cdn.com/free1/user_avatar/openmc.discourse.group/paulromano/32/486_2.png) [@paulromano](https://openmc.discourse.group/u/paulromano)\
**Post date:** [February 8, 2023, 9:10pm UTC](https://openmc.discourse.group/t/how-can-i-view-this-statepoint-150-h5-summary-h5-data-files-in-openmc-with-which-commands-in-ubuntu-terminal/2697/13 "2023-02-08T21:10:19Z")

</div>

Here’s the user’s guide section on tallies: [8. Specifying Tallies — OpenMC Documentation](https://docs.openmc.org/en/latest/usersguide/tallies.html)

You may also want to have a look at our [Jupyter notebook examples](https://github.com/openmc-dev/openmc/wiki/Example-Jupyter-Notebooks).
