We’ve worked hard to ensure that Tecplot 360 is user friendly for pretty much anyone, even if they aren’t proficient with writing scripts. The GUI (Graphical User Interface) is packed with menus and buttons that reveal hundreds of different capabilities. That said, there are always going to be things that people want to do that are not easily accomplished with the GUI – from reading custom data, to maximizing the efficiency with which you create detailed visuals, to performing advanced statistical analysis of your results. For tasks like these there is no better solution than Tecplot 360’s Python API, PyTecplot.
The number of tasks that PyTecplot enables is virtually endless, so we’ll focus on just three that PyTecplot might make a bit easier for you.
1. Reading Data – Importing Custom Data from Excel
The first thing that any Tecplot user needs to be productive is the ability to load their data. For the lucky majority, Tecplot 360 supports a huge range of data types and our partner software providers have also used the TecIO library to write data in Tecplot’s native formats. For the unlucky minority – these data loaders don’t fit the bill, they need the ability to build their own custom data loader. PyTecplot is well suited for just such an occasion. Take some time to watch this webinar series that walks through how to build PyTecplot scripts that load custom file formats: Part 1 and Part 2.
2. Creating Detailed Visuals Efficiently – Seed a Grid of Streamtraces
Creating a beautiful plot in Tecplot 360 is easy, but often our users have some specific wants and needs from their visuals, and sometimes those requirements push the limits of what you can accomplish with mouse-clicks. For example, seeding a streamtrace in an exact coordinate location with a mouse is next to impossible, and placing a series of streamtraces in exact coordinate locations is impossible and tedious. Detailed, iterative tasks like this are where programmatic control of your plots is essential. Here’s just one example of a PyTecplot script that plots out a grid of ribbon-streamtraces: Streamtraces with Python
3. Analyzing Results – Compute an Average Through Time
Experienced scientists and engineers routinely need to do more with their data than just visualize or plot it – often there is additional analysis that is needed as part of the post-processing step. Tecplot 360 has a lot of useful features baked right into the GUI for this, including Data Alter, CFD Analyzer, Interpolate, and more. But as thorough as the Tecplot 360 analysis workbench is, there will always be needs that go beyond what is available in the GUI. Computing the average value of a variable across multiple time steps, for example, is tricky to do interactively. PyTecplot saves the day once again by making it easy to programmatically loop through all the zones associated with a specific time strand and compute the average. Check on this handy script for computing stats over time on GitHub.
If you’ve made it this far, maybe one of these three tasks sounds a lot like something that could improve your post-processing workflows. But even if none of these did it for you, we’re confident that PyTecplot can be a valuable tool to improve the way you post-process your technical data. There’s no substitute for a well-designed GUI when it comes to ease-of-use, but there’s no substitute for scripting when it comes to versatility. Get a head-start on a script of your own by checking out all our Handy Scripts on GitHub.