Jump to content
rjromijnders

Python post-processing T01 file

Recommended Posts

Dear all,

 

I was wondering whether it is possible to directly post-process Time History data output with custom-written Python scripts?

What kind of format is the *T01 file? Is it a binary format (is the format known)?

 

A short synopsis of what I am working on is an automated peak detection method on certain Time History Output data.

I want to find out at which time a peak value occurs, and subsequently want to look up the Y-value at that same time for a different Time History Output.

 

If a script (different from Python) is available that can directly be applied to the *T01, then I am also happy.

 

Kind regards,

Robbin

Share this post


Link to post
Share on other sites
Guest

Hi Robbin,

Apologies for a delayed response.

 

The format of T01 file is as shown in image below.

t01.PNG

 

The peak value of a curve can be found from the coordinate info panel in HyperGraph.

 

curve.PNG

Share this post


Link to post
Share on other sites

Hi George,

 

thanks for the response.

I get the point of reading the peak value from Hypergraph X-Y plot.

 

What if I do not want to use Hypergraph, but instead I want to use a script that directly processes the T01 file?

 

Or is there any easy way to process the T01 file, like...

 

def processT01(inputfile="runnameT001", param="IE"):

1= Load the T01 file

2= Read the values for the defined parameter, in this case "INTERNAL ENERGY"

3= Convert the values to a comma-separated value, e.g.

Time, IE

0.000, 3150.

0.100, 3155.

0.200, 3158.

Save in this format to a new file: "my_output.csv"

 

In this way I can further post-process the data.

 

I need to do this for multiple simulations, and for multiple time history output data per simulations (e.g. 5 springs per simulation).

That is why I want to automate this process.

 

Kind regards,

Robbin

Share this post


Link to post
Share on other sites
Guest

Hi Robbin,

The possible workaround for your need is:

You can plot in HyperGraph manually first time and then save it as Report Template. Next time, you can say "Open Report Template" and select a different T01 file. The process will be repeated for the newly selected T01 file. In order to get the curve data in csv format, you can use Export Curves option in HyperGraph.

I have made a simple recording of these steps which is attached along.

report_temp.swf

Share this post


Link to post
Share on other sites

OK, this will work for me as a temporary workaround. Thanks George! :)

 

One more question: how could I get a list of the available output request from my T01 file? So, the Y-Type, Y-Request and Y-Component, but then before I open the T01 file in Hypergraph?
 

Share this post


Link to post
Share on other sites
Guest

Hi Robbin,

I am not clear about the query, can you please elaborate?

If you are asking about the T01 variables available, then from the Help menu you will get all the details on the available output request in T01 file. Please search in Help for /TH which will list all the time history output variables.

 

Share this post


Link to post
Share on other sites

I have already found what I am looking for:

 

hwi GetSessionHandle session_handle

session_handle GetProjectHandle project_handle

session_handle GetDataFileHandle data_handle $input_file

foreach val [data_handle GetDataTypeList false] {

    puts $val

    }

 

In this way I get a list of all the entities that are saved to the Time History output file.

Next, I am plotting the curves for selected entities and automatically exporting the curve(s) to a .csv file.

 

The outputted .csv file can be further processed using any desired scripting language.

 

Kind regards,

Robbin

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...