This section contains some tutorial examples that show how to use named selections in VisIt.
- These examples use data files from the Tutorial Data.
Named selections restrict the cells used in a plot to a user-specified list of cells. This set of cells usually consists of domainID and cellID pairs. The selections can come from a text file or can be generated from existing plots in VisIt. The selections can be given names (hence the name "named selection") and can be applied to plots using the Subset window.
In this example, we will use named selections to coordinate selected cells between 2 plots.
- Open example.silo
- Add a Parallel Coordinates plot of pressure, radial, grad_magnitude, temp and click Draw
- Enable the Axis restriction tool in the vis window
- Restrict pressure to roughly 3.5 to 4.0
- Open the Selections window
- Click New to activate the Selection Dialog. This will make a new selection with a default name like selection01. Click the dialog's OK button to make a selection based on the current Parallel Coordinates plot.
- Turn on the Automatically apply updated selections check box in the Selections window
- Switch to a 1x2 window layout
- Make window 2 active, delete any plots that were copied to it
- Add a Pseudocolor plot of temp and click Draw
- Open the Subset Window and make the new Pseudocolor plot use selection01 as its selection
- Go back to window 1 and restrict the radial variable to roughly 15 to 25
- Restrict grad_magnitude to roughly 0.0 to 0.2
- Restrict temp to roughly 2.0 to 2.5
- When you are done, delete window 2 and delete all plots from window 1
Cumulative query is a type of named selection that can apply various range queries to data over time. Each time step in the dataset will have some list of cells that satisfies the query criteria. The list of cells can be binned in various ways to and those bins can be restricted to come up with a final list of cells that can be used as a selection.
Finding areas of the globe that have warmed the most
In this example, we will use the avg_temp.visit dataset, which contains the average annual temperature for nearly one century (some years may be projections).
- We want to see the areas on the globe that have warmed the most and have an idea how the has warming progressed.
- We will compute the difference of each year vs. the first year and then see which regions have most frequently been warmer by at least 5 degrees F.
- We will find the regions using cumulative query.
Set up some map context
- Turn on Auto apply in the Main window
- Open continents.shp
- Create a Mesh plot of polygon and click Draw
- Turn off the Apply selection to all plots check box under the plot list
Select the warmer regions
- Open avg_temp.visit
- Open the Expression window
- Create scalar expression tdelta defined as temp_F - conn_cmfe(<i:temp_F>, mesh)
- Open the Controls->Selections window
- Click the New button in the lower left of the window to start creating the selection via the Selection creation dialog.
- Type five_degrees for the selection name
- Click the Database radio button so the avg_temp.visit database will be used for the selection.
- Click the OK button
- Now, in the Selections window, click the Cumulative Query check box to enable the settings for cumulative queries
- Next to the Add variable label, select the tdelta variable to add the tdelta variable to the cumulative query
- Type 5 for the minimum value of tdelta
- Click on the Histogram tab
- Create a Pseudocolor plot of temp_F and click Draw
- Open the Subset window and select five_degrees from the Applied selection options. This will cause your plot to be restricted to the regions that have ever warmed more than 5 degrees.
Show consistently warmer regions
The above plot shows that most of the land areas on the Earth have at some point been warmer than 5 degrees since the first time step in the dataset.
- We want to see which regions have been warmer most frequently
- We can do this be changing the five_degrees named selection
We will change the cumulative query from sorting based on time to sorting based on matches. This means that the cells will be sorted by the number of times they matched the query criteria over time. The cells will then be placed into bins. Cells that matched less frequently will be in bins on the left. Cells that match most frequently will be in bins on the right. For relatively small numbers of time steps, the number of bins will be equal to the maximum number of time steps that generated a match. In the context of this example, the bins on the right were found to be warm for the largest number of time steps.
- Get back to the Histogram tab in the Selections window
- Change the Axis setting from Time to Matches. This will produce a different histogram.
- Type 58 into the Minimum bin spin box
- Click the decrement button on the Minimum bin spin box several times and watch the warm regions expand on the map. Note that most of them appear in the Arctic, indicating that the Arctic has been warming more than most regions on Earth.