Welcome, Guest
Username: Password: Remember me

TOPIC: Extracting punctual results

Extracting punctual results 2 years 6 months ago #40399

  • omar
  • omar's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 23
Hello community,

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, Tp 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

regards,

OH
The administrator has disabled public write access.

Extracting punctual results 2 years 6 months ago #40405

  • jtravert
  • jtravert's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 36
  • Thank you received: 23
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 = res.get_timeseries_on_nodes('WAVE HEIGHT HM0', 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.
Good luck,
Jean-Paul
The administrator has disabled public write access.
The following user(s) said Thank You: omar

Extracting punctual results 2 years 6 months ago #40406

  • omar
  • omar's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 23
Hello jtravert,

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?

regards,

OH
The administrator has disabled public write access.

Extracting punctual results 2 years 6 months ago #40421

  • jtravert
  • jtravert's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 36
  • Thank you received: 23
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 (gitlab.pam-retd.fr/otm/telemac-mascaret/...otebooks/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.
The administrator has disabled public write access.
The following user(s) said Thank You: omar
Moderators: tfouquet

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.