Python post-processing T01 file

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

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

Answers

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2017

    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.

     

    <?xml version="1.0" encoding="UTF-8"?>curve.PNG

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2017

    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

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2020

    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.

    Unable to find an attachment - read this blog

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2017

    OK, this will work for me as a temporary workaround. Thanks George! :)/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />

     

    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?
     

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2017

    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.

     

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2017

    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