Loading and Combining Variables from Multiple Files

In Tecplot 360 EX, you can load multiple data files in two different ways:

• All at once by choosing all the files in the Load Data Files dialog.

• By appending data to the data that has already been loaded.

The Variable Load and Combine dialog appears when loading multiple data files in certain formats, whether you load the files all at once or append new data to previously-loaded data, if the names of the variables in the data files do not match. The dialog allows you tell Tecplot 360 EX which variables (if any) have the same meanings across the files, as well as which variables should not be loaded at all.

variable_load_and_combine.png

This feature works only with data in the following formats:

• Tecplot - text (.dat), binary (.plt), and subzone (.szplt)

• CGNS

• EnSight

• Excel

• HDF and HDF5

• Text (using the Text Spreadsheet or General Text loader)

• TRIX

• VTK

The Variable Load and Combine dialog appears only when the files you are loading do not all contain exactly the same variable names (or, when appending, if the variable names in the file being loaded do not exactly match those of the data already loaded). When all variable names match in the files being loaded, this dialog does not appear; instead, Tecplot assumes that all the variables have the same meaning in all the files.

note00058.pngIf a file you are loading or appending has multiple variables with the same name, Tecplot 360 EX asks if you want to load them by position. See “Loading by Position” on page 62. When loading by position, you cannot combine variables (and do not need to).

The dialog allows you to indicate that variables with different names have the same meaning (referred to as combining the variables) in two different ways.

• Select variables having the same meaning, one in each list, then click Combine.

• Apply a previously-defined variable alias file that indicates which variable names have the same meaning.

The two methods can also be used together. For example, you might first apply a variable alias file that deals with the most common equivalent variables in your typical data sets, then clean up any remaining variables (uncommon variables, or variables that don't always have a well-defined meaning) by hand.

The dialog has the following parts:

• The Available Variables list initially displays all the variables declared in the files you are loading. As you choose variables to combine or load, they move to the Variables to Load list. Any variables remaining in the Available Variables list when you click OK are not loaded.

• The Variables to Load list displays variables that are slated to be loaded in the current load operation. If you are appending data, variables that have already been loaded in previous load operations also appear here. Variables are colored according to the following rules:

Black - Variable is not combined; it is either already loaded, or will be loaded

Blue - Variable appears under the same name in multiple files and has been automatically combined

Green - Variable has different names in different files and has been combined by the user, either using the Combine button or by applying a variable alias file

• The Add Selected button moves a variable from the Available Variables list to the Variables to Load list, adding it to the set of variables that will be loaded in the current operation. The added variable's name appears in black. By default, variables that are unique to one file are not loaded.

• The Add All button moves all variables listed in the Available Variables list to the Variables to Load list, indicating that you want to load all of them in the current operation. The variable names appear in black.

• The Combine button combines the variable selected in the Available Variables list with the variable selected in the Variables to Load list, indicating that the variables have the same meaning. The variable is given a name derived from both the selected variables, and this name appears in the Variables to Load list and is colored green. See Combining Variables Manually.

• The Remove button removes the selected variable from the Variables to Load list, if possible. If the variable is already part of the current data set (that is, you are appending data, and the variable is from a previous load operation), it cannot be removed.

When removing a combined variable, all the original variables that were combined are separated and moved back to the Available Variables list, again except for any which have already been loaded from a previous operation.

• The Apply button applies a variable alias file to the variables being loaded, combining variables if they are defined in the file as having the same meaning as another variable. See Creating and Using a Variable Alias File.

• Click OK to proceed with loading after setting up the variable combining the way you want it.

Variables that have the same name are automatically combined, as this is almost always what you will want to have happen. They appear in blue in the Variables to Load list. If you do not want this to happen, load the files one at a time and, before loading the file with duplicate variable names, rename the existing variables you do not want to combine with newly-loaded variables of the same name. (You can rename variables by double-clicking them in the Data Set Information dialog.)

Combining Variables Manually

To combine two variables manually, telling Tecplot 360 EX that they have the same meaning, you select the first variable in the Available Variables list and the second in the Variables to Load list, then click the Combine button. The combined variable is added to the Variables to Load list and given a name consisting of both original variable names separated by a semicolon.

If the variables to be combined are in the Available Variables list, as may be the case when loading all the files at once instead of appending, select one in the Available Variables list and click Add Selected to select it to be loaded. Then combine them as above.

If there are more than two variables that have the same meaning, combine the first two, then select the combined variable in the Variables to Load list and combine it with the next variable having the same meaning in the Available Variables list as above.

You may combine multiple sets of variables at a time. If you select more than one variable in the Available Variables list, and the same number in the Variables to Load list, clicking Combine combines the first selected variable from the Available Variables list with the first selected variable from the Variables to Load list, the second with the second, and so on.

You may not combine variables from the same file.

Creating and Using a Variable Alias File

The variable_aliases.txt file found in the Tecplot 360 EX installation directory lists sets of variables that should be considered equivalent.  See Section 30 - 1 “Custom Files loaded on Startup” for information about how variable aliases are loaded.

The variable_aliases.txt file must begin with a #!VA 1 line to indicate that it is a variable alias file (format version 1). On subsequent lines, the # character indicates the beginning of a comment; everything following the # on a line is ignored. Variable aliases are specified by listing the equivalent names on a line separated by semicolons. For example:

#!VA 1

p;press;pressure

t;temp;temperature        # temperature variables in Celsius

m;mach

a;alpha;aoa               # angle of attack in radians

b;beta;aos                # angle of sideslip in radians

Variable names found in this file are case-insensitive. Excess whitespace is ignored.

When you click Apply, Tecplot 360 EX combines variables as indicated in variable_aliases.txt. Where two or more files contain variables whose names appear on the same line, these variables are combined, and the resulting Tecplot 360 EX variable is given a name containing the original variable names (as they appear in the datasets being loaded) separated by semicolons. The new variables then appear in the Variables to Load list in the dialog.

For example, if you load two files with the variables "P" and "Pressure," and the lines shown above appear in the variable_aliases.txt file, when you click Apply, these two variables appear in the Variables to Load list as a single variable called either "P;Pressure" or "Pressure;P" depending on the order in which the files were loaded.

If multiple lines in variable_aliases.txt might apply to the data sets being loaded, these conflicts are resolved based on the order in which the files are loaded. For example, if you load three files containing variables "M," "Mach," and "Mass," in that order, and variable_aliases.txt contains lines equating "M" with "Mach" and also "M" with "Mass," the resulting data set would have a variable named "M;Mach" and a second variable "Mass." Because the file containing the variable "Mach" was loaded before the file containing the variable "Mass," "M" was combined with "Mach" when that file was loaded and cannot also be combined with "Mass."

You may change the names of combined variables after loading the data by double-clicking the variable in the Data Set Information dialog (Data Set > Data Set Info).