# Extracting  punctual results

**URL:** <https://opentelemac.org/forum/t/extracting-punctual-results/6867>\
**Category:** TOMAWAC\
**Created:** [May 10, 2022, 3:55pm UTC](https://opentelemac.org/forum/t/extracting-punctual-results/6867 "2022-05-10T15:55:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![user\_15495](https://opentelemac.org/forum/letter_avatar_proxy/v4/letter/u/ac91a4/32.png) [@user\_15495](https://opentelemac.org/forum/u/user_15495)\
**Post date:** [May 10, 2022, 3:55pm UTC](https://opentelemac.org/forum/t/extracting-punctual-results/6867/1 "2022-05-10T15:55:52Z")

</div>

Hello [name removed],

I am looking for how I can extract punctual results. In fact, I know that with commande 1D SPECTRA RESULTS FILE, i can get a file with the frequency distribution of energy, but i need to know the Hm0, [name removed] and dir to a known point. I can’t use BlueKenue because i will try to extract the results for many cases and treat them through python.

I would be very grateful for any help

[name removed]

---

<div class="post-metadata">

**Author:** ![user\_16632](https://opentelemac.org/forum/letter_avatar_proxy/v4/letter/u/4da419/32.png) [@user\_16632](https://opentelemac.org/forum/u/user_16632)\
**Post date:** [May 12, 2022, 6:18pm UTC](https://opentelemac.org/forum/t/extracting-punctual-results/6867/2 "2022-05-12T18:18:46Z")

</div>

Hello,

I recommend you to look into the notebooks, for instance in the sub-section : “How to do 1d plots ?” and you can find everything you are looking for.

Make sure to include the desired variables in the graphic output in the steering file; and then you can use the scripts provided with Telemac to extract the data.

Here is a simple example to extract from 2 nodes the variable HM0 you mentionned in a txt file :

```auto
from data_manip.extraction.telemac_file import TelemacFile

#Open the selafin file

res = TelemacFile('r2d_dean.slf')

# Getting array of time values from file 

times = res.times

n1=len(times)

# List of nodes you want to display

nodes = [484,687]

# Getting water depth values over time for each node in nodes

data = [name removed], nodes)

f=open("node_values.txt","w")

n2=len(nodes)

f.write("Time(s)")

for i in range (n2):

   f.write(" HM0_"+str(i))

f.write("\n")

for i in range (n1):

   f.write(str(times[i]))

   for j in range(n2):

      f.write(" "+str(data[j][i]))

   f.write("\n")

```

You just have to add the desired points that you need and variables.

[name removed]

---

<div class="post-metadata">

**Author:** ![user\_15495](https://opentelemac.org/forum/letter_avatar_proxy/v4/letter/u/ac91a4/32.png) [@user\_15495](https://opentelemac.org/forum/u/user_15495)\
**Post date:** [May 13, 2022, 9:21am UTC](https://opentelemac.org/forum/t/extracting-punctual-results/6867/3 "2022-05-13T09:21:50Z")

</div>

Hello [name removed],

Thank you for your reply, i have successfully extracted the results (Hm0,dir,freq) from the 2D RESULTS FILE.

I didn’t find the sub-section : “How to do 1d plots ?” in the user manual of tomawac, i wanted to read it for more information and better understanding.

I have an over question, What should i do to extract the spectrum on a point? Should I take the values from the “PUNCTUAL RESULTS FILE” and integrate them into the frequencies and directions I entered at the cas file?

[name removed]

---

<div class="post-metadata">

**Author:** ![user\_16632](https://opentelemac.org/forum/letter_avatar_proxy/v4/letter/u/4da419/32.png) [@user\_16632](https://opentelemac.org/forum/u/user_16632)\
**Post date:** [May 17, 2022, 6:40pm UTC](https://opentelemac.org/forum/t/extracting-punctual-results/6867/4 "2022-05-17T18:40:48Z")

</div>

It is located in the notebooks not especially in the tomawac section or user manual. They are jupyter-notebooks that you can open with your telemac installation or you can check on the git of telemac ([https://gitlab.pam-retd.fr/otm/telemac-mascaret/-/blob/main/notebooks/index.ipynb](https://gitlab.pam-retd.fr/otm/telemac-mascaret/-/blob/main/notebooks/index.ipynb)).

I do not use tomawac, so I cannot help you on the second question, but in the notebooks there is a section about spectrum that might help you.
