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]
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 :
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]
1 Like
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]
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).
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.
1 Like