Lesson 2: Python on Tecplot examples

| | Comments (0) | TrackBacks (0)
In the Tecplot distributions ($TECHOME/examples/python) are some sample python scripts to illustrate different concepts and address specific user-requested features.  Over the next few months, we'll dissect these, calling out useful features. 

Until then, here is an overview of what's there:


  • Keyframe animation (by Andrew Ritzmann) --  [Tutorial]  This script lets you generate an animation based on the viewer's perspective moving.  Simply set a view, take a snapshot, move to the next view, take another snapshot, etc. When you're done, click "OK" and the script interpolates ten positions between each snapshot, generating an AVI animation as its output.  Future versions may include more sophisticated splines. With a two-line change, one can generate a Flash animation.  Source: KeyFrame.py

  • Direct Excel Reading (by Andrew Ritzmann) -- This script is illustrative of using a third-party python library to directly read from an Excel file, do some conversion, and plot the results.  The reader must be installed separately.  The zip file includes the xlrd reader for Windows.  Other platforms may download it from John Machin's site.

    The sample geyser temperature reading data is courtesy of Dr. Hank Heasler, National Park Service. 

    Zip distribution: convert_excel.zip.  

  • FFT (by Jim Carson, based on work by Anders Andressen in Linux Gazette) -- This simple example illustrates loading data, computing an FFT, and plotting the results. The space-delimited data file, sunspots.dat, contains the number of sunspots observed from 1700 through 2000.   Script: sunspots.py

  • Integration visual (by Andrew Ritzmann) -- this python script fills in the area under a curve, useful to show a user which area will be integrated. Source: integration_visual.py

Tecplot 360 2008 only (because Tecplot Focus doesn't have these two loaders):

  • Load multiple plot3D grid files (by Andrew Ritzmann) -- this python routine uses a TK dialog as a front-end to load multiple PLOT-3D files into Tecplot, saving many mouse clicks. It intelligently pattern matches for grid and solution files, then uses Tecplot's macro language to actually load the data.
    Script, animated example

  • Load multiple STL files (by Andrew Ritzmann) -- this python routine uses a TK dialog as a front-end to load multiple STL (CAD-type drawings) data files, saving many mouse clicks.
    Script, (no animation, yet)

Finally, for humor value, my first python script ever:

  • Style-o-Matic (by Jim Carson) -- This script is an example of using python to automate calling Tecplot's macro language.  What it does is automatically set surface versus volume styles differently, based on the contents of a text file in the user's TECHOME directory.  For example, for volume zones it will toggle off the shade and mesh styles.    Archive: styleomatic.zip.

0 TrackBacks

Listed below are links to blogs that reference this entry: Lesson 2: Python on Tecplot examples.

TrackBack URL for this entry: http://www.tecplottalk.com/b/mt-tb.cgi/4

Leave a comment

About this Entry

This page contains a single entry by jim published on January 26, 2008 3:20 PM.

Lesson 1: Hello World was the previous entry in this blog.

Python: Toggling zones by regular expressions is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.23-en