Jump to content
  • Announcements

    • Rahul Ponginan

      Please click here for a short but important announcement   03/26/17

      Dear Users Our Commercial and Academic users around the world can use these same forums here as before i.e. the Altair Support Forum , Commercial users from India with solver queries can go to the Solver Forum for India Commercial Users , Academic Users from India and AOC India Participants are requested to go to the Forum for India Academic Users and AOC India Participants , We will be tending to all queries in all the forums promptly as before, thank you for your understanding. 
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

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

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

Rahul R likes this

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×