Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Concatenating *.slf results with PYTHON

Concatenating *.slf results with PYTHON 8 years 7 months ago #20783

  • pprodano
  • pprodano's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 96
  • Thank you received: 55
Hello,

The script I was referring to in the earlier post was developed as part of a specific project. I can not make it public as it contains too many site specific information that is confidential.

The basic idea behind it is this:

1. Prepare a steering file for the base case, where the base case has parameters that are altered for each case (i.e., having a different wind speed and direction for each case).
2. Formulate all combination of parameters of interest (i.e., every combination of wind speed and wind direction)
3. Write a new steering file for every scenario in the list of combinations.
4. Simulate every steering file.
5. Merge all result files into one master library database.

I think this process is called task farming. I am planning to make it more generally applicable. Once I do, I shall share.

Pat
The administrator has disabled public write access.
The following user(s) said Thank You: amanj2013

Concatenating *.slf results with PYTHON 8 years 7 months ago #20784

  • JulienCousineau
  • JulienCousineau's Avatar
Pat and Amanj,

I might be able to help you with the "task farming" or the automation process.I had plans to share this before Christmas but just never got the chance. With work and the new baby, free time is a luxury...

Here how it works (very similar to your idea Pat):
1. The user needs to prepare a template steering file (.cas)
2. The user needs to prepare a log sheet (Excel File in my case) with all the parameters that needs to be changed. Columns are the parameters; Rows are the scenarios. There is a template.
3. The user needs to run a python script that writes new steering file using the template and the log sheet. It will also create a batch file with all the scenarios.
4. The user can also run another python script to extract results for each scenario and write back to the Excel File or a simple Text File. However, this python script is often project specific.

I'll prepare the files this weekend and share it.
It's not too complicated and it does the trick.


Cheers, Julien
The administrator has disabled public write access.

Concatenating *.slf results with PYTHON 8 years 7 months ago #20785

  • amanj2013
  • amanj2013's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 211
  • Thank you received: 24
Thank you dear Julien and Pat,

It will be very useful for all of us when we have a series of scenarios and cases where need to test different parameters as a sensitivity case.

Looking forward having your advice and scripts as well.

Cheers,

AMANJ
The administrator has disabled public write access.

Concatenating *.slf results with PYTHON 8 years 7 months ago #20787

  • cyamin
  • cyamin's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 997
  • Thank you received: 234
Hello all,

I have also created a python script to do task farming using the above methodology. I have found it to be so useful that from non and on, I cannot imagine myself doing telemac simulations without it. It is my first attempt, though, so it is quite messy but I am willing to share if it helps.

So I suggest we open a new thread in the scripts section where we can combine efforts for the benefit of all.

Regards,
Costas
The administrator has disabled public write access.
The following user(s) said Thank You: amanj2013

Concatenating *.slf results with PYTHON 8 years 7 months ago #20801

  • amanj2013
  • amanj2013's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 211
  • Thank you received: 24
Dear Costas,

I believe it will be great and will also help many TELEMAC users in saving time and less effort. Please let me know the title of the new thread.

Cheers,

AMANJ
The administrator has disabled public write access.

Concatenating *.slf results with PYTHON 8 years 7 months ago #20806

  • JulienCousineau
  • JulienCousineau's Avatar
I've created a new thread called "Task Farming/Automation of Simulations" #20805.

Amanj: The script I use at NRC is more complex, however it's not generic and often project specific. I'll slowly put all the features to that thread. Cheers.
The administrator has disabled public write access.

Concatenating *.slf results with PYTHON 8 years 7 months ago #20807

  • amanj2013
  • amanj2013's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 211
  • Thank you received: 24
Great job dear Julien,

I really appreciate your efforts. i know you're quite busy with new baby. It's was a great oppurtunity for me to work with you and I learned many new thing. Wish one day we have more projects together!


Cheers

Amanj
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: borisb

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