EnSight QuickTools Part I: Animated Annotations and CSV Files PDF Print E-mail

With EnSight 8.2.6(c), CEI has expanded the supplied collection of user defined tools to include “QuickTools”. QuickTools are a set of simple Python based user defined EnSight extensions that simplify common operations that might otherwise be complex or impossible to do easily in EnSight. QuickTools are provided with complete source code and users are encouraged to inspect and modify them to meet their own needs.

Accessing QuickTools

userdefined_icon The QuickTools are accessed through the user defined tools icon from the icon strip located below the main EnSight menu bar. If this icon is not available in your icon set, you can enable it using the “Modify and save icon layout…” button in the “General User Interface” preferences panel. When the icon is selected, the user defined tools panel is displayed.  The panel is a collection of horizontal tabs and looks like this:  

image2_2

To access the QuickTools, click on the “EnSight Quick Tools” tab and you will see the four QuickTools: “Import a movie or image as a textured annotation”, “Import a query from a CSV formatted text file”, “Sample a variable while rotating a theta clip” and the “EnSight graphics performance tests”. This article covers the first two of these tools. Other QuickTools will be covered in future articles.

Import a movie or image as a textured annotation

A common request at CEI is the desire to include actual video footage of an experiment synchronized with the simulated model. In EnSight, this involves creating a 2D rectangle annotation and texturing it by a video clip. EnSight has had the ability to apply a texture to 2D shape annotations since early in the 8.2 release cycle and the ability to use movie files as textures in more recent releases. The operation is normally performed through the 2D shapes and texture map editors in EnSight. However, there are a relatively large number of options and settings for these operations and while they describe what operations they perform, it is not always obvious that these features might be used to create an animated annotation. This QuickTool simplifies the process, reducing it to a single step and setting all of the various options you need. When the QuickTool button is clicked, EnSight will prompt you for an image/movie file. Once the selected imagery is loaded into memory, the tool creates a new rectangle annotation and sets up the texture mapping.  An example image of the result:

image3_2 

Note that if an animation is loaded as an annotation, it is linked to the solution times of the loaded dataset. To cause the animation to play back, you need only play the solution time. One thing to be cautious of, EnSight does load the entire video clip into memory and stores it in a lossless fashion internally. Larger clips, especially with large numbers of frames can use up a great deal of memory. The resulting animated clip and geometry can of course be exported to an EnLiten file as well, including the integrated playback.

Import a query from a CSV (Comma Separated Value) formatted text file

EnSight has the ability to read queries from external ASCII text files, but the format of these files are specific to EnSight (see the User Manual, chapter 11.10). Many users have data in standard tabular formatted text files (e.g. CSV files from Excel) and may not be in a position to easily reformat this type of data. This QuickTool is designed to help, it can import data directly from CSV and similarly formatted ASCII files as EnSight queries. When the QuickTools button is clicked, the user is first prompted to select the file to open.  Once a file is selected, a dialog is opened to select importing options:

image4_2

The delimiter between columns of data can be set as well as other options. The user can control how whitespace (e.g. multiple whitespace delimiters) around the delimiter is handled and the character that is used to delineate strings.  Select the appropriate options for the file being imported and click “Ok”.  The file will be read into memory and a spreadsheet-like representation of the file is presented. In this example, we will be importing the output of the EnSight graphics performance tests (covered in more detail in a future article):

image5_2

Conceptually, a query has the general form ydata=f(xdata) with titles for the ‘x’ and ‘y’ axes as well as the query as a whole, five types of information: (YD)ata, (XD)ata, (YT)itle, (XT)itle, (T)itle. The dialog allows one to select sections of the spreadsheet and tag the selected cells one as of the five types using the icons or the menu options. The user must specify the ‘(YD)ata’ portion of the query and defaults are supplied for all the other options if they are not tagged. Once some cells have been selected pressing one of the icons causes them to be tagged visually with that icon. An example is shown below, with the query title, xdata and ydata tagged:

image6_2

There is no requirement that the cells be in columns.  Any rectangle of cells can be selected and they will be read as a vector, going row by row over all of the columns. In the case of the title strings, all of the text in all of the tagged cells will be concatenated and used as the title, so if a title crosses multiple columns, simply tag all of the necessary cells. Cells themselves can also be edited in the spreadsheet by clicking on them and entering new text. Following up on the previous example, the user has typed in titles for the ‘x’ and ‘y’ data vectors and tagged them:

image7_2

The green “+” button is used to actually import the tagged data into EnSight as a new query. The tagged selections in the dialog are then reset and another query may be imported from the same file if desired. If a selection of cells is tagged with a tag that has already used, all original tags of that type are removed before the new cells are tagged. The red “x” button can also be used to reset all of the current tags. Finally, the query can be plotted and adjusted as desired using the various query and plotter tool controls in EnSight:

image8_2  

This is a very simple QuickTool and it makes is much easier to import query data in standard ASCII formats. The tool itself is written in Python and the complete source code is provided in $CEI_HOME/ensight82/site_preferences/user_defined_tools/QuickTools. Users are encouraged to look at how the tool works and create their own QuickTool functions.

 

In our next installment, we will discuss the new EnSight Graphics Performance tests which utilize the same EnSight Python scripting interface and allow one to generate detailed descriptions of graphical system performance.

Until then, we hope you find these new QuickTools useful extensions to EnSight.

 

 

valid xhtml? | valid CSS?

Joomla Templates by Joomlashack