Top Banner
The VisIt tutorial will follow a script, which is contained in this document. Note that the script will likely be modified for the SC10 tutorial and the latest version of the script will be at http://visitusers.org/index.php?title=Short_Tutorial . The tutorial is broken into 6 parts: 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations 1. VisIt basics Starting VisIt The way you start VisIt depends on the platform you are on: On Windows, double click on the VisIt icon On Unix & Mac, invoke: /path/to/visit/bin/visit o Most people ultimately put /path/to/visit/bin in their $PATH and then just say "visit". What you see
36

1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

Jun 18, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

The VisIt tutorial will follow a script, which is contained in this document. Note that the script will likely be modified for the SC10 tutorial and the latest version of the script will be at http://visitusers.org/index.php?title=Short_Tutorial. The tutorial is broken into 6 parts:

1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

1. VisIt basics Starting VisIt The way you start VisIt depends on the platform you are on:

• On Windows, double click on the VisIt icon • On Unix & Mac, invoke: /path/to/visit/bin/visit

o Most people ultimately put /path/to/visit/bin in their $PATH and then just say "visit".

What you see

Page 2: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

• The tall grey window on the left is called the "GUI". It is the primary mechanism for driving VisIt.

• The window on the right is called the "viewer". It displays results. Opening files The first thing to do is to select and open files.

File Selection window

1. Go to the GUI and find File->Select File. 2. Change the "Path" field to be "/path/to/visit/data" 3. Click "Remove all" to clear out the files from the directory you started

VisIt in. 4. Click "Select all" to select all of the files in the "data" directory. 5. Click "OK" on the bottom right. 6. The top part of the GUI has a heading labeled "Selected files". This

will now contain the files from the "data" directory. 7. Highlight the file "noise.silo" and then click "Open"

o You can also double click noise.silo and will automatically open it.

You've opened a file! Advanced file opening features

1. In the file selection window: o There is a field for "host". That is how you run client/server o There is a "filter". That is provided to subset the file list to only

the files VisIt may want. Example filter: "*.silo *.vtk"

2. There is another mechanism for opening files under File->Open that opens a single file.

o This allows you to explicitly tell VisIt what type of file it is opening.

o VisIt uses heuristics otherwise (which are often successful). 3. You can also open files on the command line: "visit -o file.ext"

Page 3: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

Making a plot

A pseudocolor plot of "hardyglobal" ready to be drawn.

The pseudocolor and mesh plots drawn in the vis window. 1. Go to Plots->Pseudocolor->hardyglobal.

o On Windows & Unix: the plots header is located two thirds of the way down the gui.

o On the Mac: the plots header is located along the top pulldown. 2. You will see a green entry added the "Active plots list", which is

located half way down the gui. o This means VisIt will draw this plot after you click "Draw"

3. Click draw. 4. You should see a plot appear in the visualization window. 5. Go to Plots->Mesh->Mesh 6. Click draw. 7. You should now see both a Pseudocolor and plot mesh. 8. Highlight the Pseudocolor plot in the active plots list. 9. Click "Hide/Show"

o (This will hide the Pseudocolor plot ... you should now see only the mesh plot.)

10. Highlight the mesh plot and click Delete. o You should now have an empty window.

Page 4: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

o The Pseudocolor plot should now be selected. 11. Click "Hide/Show"

o The Pseudocolor plot should reappear. Modifying the Plot attributes

Pseudocolor Plot Attributes window

1. Go to Plot Attributes->Pseudocolor. o This should bring up a window for modifying the plot.

2. Change the scale from "Linear" to "Log" 3. Click Apply.

o (The colors changed) 4. Click "Min" on and change the min to 3. 5. Click "Max" on and change the max to 4. 6. Click Apply.

o (The colors change again.) 7. Change the opacity to be 50%. 8. Click Apply.

o (You can now see through the plot. Note that you only see the external faces. If you want to see the data from the whole volume, that will be with the volume plot.)

9. Change back the scale, limits, and opacity back to their original settings and click Apply.

10. Dismiss the Pseudocolor plots window.

Page 5: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

Applying an operator

Slice Operator Attributes window 1. Go to Operators->Slice

o Operators is located next to Plots. 2. You are now looking at a 2D slice. 3. Go to Operator Attributes->Slice. 4. There are many controls for setting the slice plane ... play with them. 5. Operators can be removed by clicking on an expansion arrow in the

plots list, then clicking on the red X icon next to an operator. VisIt interaction modes There are five basic interaction modes:

1. Navigate

2. Zone-pick

3. Node-pick

4. Zoom

5. Lineout

Page 6: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

You always start in Navigate. Navigate allows you to pan and rotate the data set.

1. Put the cursor in the visualization window from the viewer. 2. Left click (or single click if you do not have a 3 button mouse) and

move the mouse. 3. The data set will pan with the mouse.

o In 3D, the data set rotates.

1. The interaction mode is controlled by the toolbar, which is located at the top of the visualization window.

2. The five interaction modes are all located together on the toolbar, towards the bottom.

o Navigate is represented by a compass and should be indented. 3. Click on the magnifying glass, which corresponds to zoom. 4. Go to the visualization window and left click (single click) and HOLD

IT DOWN. 5. Move the mouse a bit.

o You should see a rubber band. 6. Lift up the mouse button.

o You should now be zoomed in so that the viewport matches what was previously inside the rubber band.

1. Find the icon of a camera that has a green "X" around it. (The camera

is mostly obscured by the X) 2. Click it.

o This will reset your view. 3. Click the icon next to the magnifying glass, which has red, blue, and

black lines. o This is for lineout.

4. Put the cursor over the data and left click (single click) and HOLD IT DOWN.

5. Move the mouse a bit. o You should see a single line moving around.

6. Lift up the mouse button.

Page 7: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

7. The window layout changes. You now have two windows. The first window is the same, but the second now contains a "Lineout", which has hardyglobal as a function of distance over the line.

8. On the window that has the curve, find the icon on the toolbar of the

window with a red circle with a line through it. 9. Click this button.

o The new window should disappear.

1. (You should only have one window now.) 2. Click on the icon that has a '+' with a small Z. This is "zone-pick". 3. Put the cursor over the data set and left click (single click). 4. This will bring up a new window ... the pick window.

o The pick window contains information about the zone (i.e. cell or element) that you just picked in.

5. The pick contains variable information, intersection location, zone ID, and IDs of incident nodes (i.e. point or vertex).

Pick can return a lot more information than it did.

1. Go to the Variables tab and add "shepardglobal" 2. Turn on "Physical Coords" under "Display for Nodes" 3. Turn on "Domain-Logical" under "Display for Zones" 4. Click apply. 5. Make another pick. 6. You get info about shepardglobal, the coordinates of each node, and

the logical coordinates for the zone. Other plots

1. We will experiment with the Contour, Filled Boundary, Label, Vector and Volume plots.

Other operators 1. We will experiment with the Clip and Threshold operators.

Saving an image 1. With a current plot, go to File->Save Window.

o This saves an image to the filesystem. Saving a database VisIt can be part of a larger tool chain.

1. If you do not already have one, make a Pseudocolor plot of hardyglobal from the noise.silo database.

2. Apply the Threshold operator and change the range to be 3->max.

Page 8: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

3. Draw. 4. Go to File->Export Database. 5. Change the file type to VTK 6. Export.

o A file named visit_ex_db.vtk has been saved to the file system.

Subsetting 1. Delete any plots in your window. 2. Open up multi_ucd3d.silo 3. Make a Subset plot of "domains(mesh1)"

o The plot is colored by "domains", which normally correspond to a simulation's processors.

4. In the active plots list, find the four interlocking rings and click on it. 5. This will bring up the Subset window. 6. Turn off some domains and click apply

o You will see some of the domains disappear. o (Subsetting works with any plot type.)

7. Turn all the domains back on. 8. Turn off materials 1 and 3.

o You will see material 2 only, colored by domain.

This mechanism is used to expose subsetting for materials, domains, AMR levels, and other custom subsettable parts.

2. Data Analysis This section describes two important abstractions in VisIt: queries and expressions.

Queries

What are queries Queries are the mechanism to do data analysis, to pull out a number or curve that describes the data set.

Page 9: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

Experiment with queries 1. Go to Controls->Query.

Variable-related 1. Change the "Display" in the Query window to be "Variable-related" 2. Go back to the GUI, delete any current plots, open up noise.silo, and

make a Pseudocolor plot of hardyglobal and draw. 3. Highlight MinMax and click "Query".

The result will be displayed in the "Query results". It will tell you the minimum, maximum and their locations.

4. Apply the slice operator to your plot. 5. Do another MinMax query.

It gives you the same results. This is because the Query parameter "Original data" is selected. This means the answer is for what is in the file, not what is on the screen.

6. Change the query parameter to be "Actual data". 7. Do another MinMax.

This time the answer will be the minimum and maximum constrained to the slice.

1. Now highlight Variable Sum and click query

This will sum up all of the values in the data set. 2. Now highlight Weighted Variable Sum and click query

This will sum up all of the values, but it will weight by area (since you have a slice)

For 3D, it will weight by volume For axi-symmetric 2D calculations, it will weight by revolved

volume 3. Note that both queries have options for Time Curves (don't click this

because we don't have a time varying data set). This is for time varying data and will produce a curve in a

separate window.

Page 10: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

1. Now highlight Lineout.

Note that you must have left "project-to-2D" enabled in the Slice operator for this next one to work correctly.

2. Change the start point to "-5 -5 0" and the end point to "5 5 0". 3. Click Query 4. This is a way that you can get exact lineouts. 5. You can also take 3D lineouts this way.

Mesh-related 1. Change the "Display" in the Query window to be "Mesh-related" 2. Experiment with the "2D area", "SpatialExtents", "NumZones", and

"Zone Center" queries For the Zone Center query, you will put the domain as 0. The domain is used for when you have a parallel file, where the

data has been "domain decomposed" for parallel processing.

Pick-related 1. Change the "Display" in the Query window to be "Pick-related" 2. Experiment with:

1. Pick: you give a 3D location and VisIt will tell you about the zone that contains that location. Note that the location is *after* the slice. If this is confusing, then remove the slice operator.

2. NodePick: you give a 3D location and VisIt will tell you about the closest node to that location.

3. PickByNode: you give a node identifier and VisIt tells you about that node.

4. PickByZone: you give a zone identifier and VisIt tells you about that zone.

Page 11: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

Connected-components related 1. If you haven't already removed the slice operator, do that now, so you

have just a Pseudocolor plot of hardyglobal. 2. Apply the isovolume operator. Change the Lower bound of the

Isovolume operator attributes to be "4". 3. You will now see a bunch of blobs in space. 4. Perform the Number of Connected Components query.

It should tell you that there are 15 components. 5. Apply the Clip operator with the default settings. 6. Perform the Number of Connected Components query again.

It should now say there are 14 components. (Operators affect queries.)

Expressions

What are expressions Expressions are the mechanism for creating derived quantities in VisIt. It does not cover all types of derived quantities; it only creates the flavors where data are defined on each and every point or cell on the mesh. So if you want to create a new derived quantity such as, "2*pressure", that is an expression. If you want to create a derived quantity such as, "sum of all pressures", that is not an expression, since it is not on the same mesh.

Experiment with expressions

Your first expression 1. Open up noise.silo. 2. Go to Controls->Expressions 3. Click on "New" in the bottom left. 4. This will create an expression named "unnamed1".

You can leave this name or change it. 5. Type in the definition: "abs(hardyglobal-shepardglobal)"

Page 12: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

TIP: You can spare yourself some typing by using the "Insert Variable" dropdown in the bottom right.

6. Make a Contour plot of unnamed1. This will show the areas of greatest difference.

7. Review the expressions The "Insert Function" drop down has a complete listing of all

expressions, organized by usage. Focus on the most commonly used: Math, Vector, Mesh, Mesh

Quality, & Miscellaneous

Accessing coordinates in the expressions 1. Make the following expressions:

1. (Vector) coord = coord(Mesh) 2. (Scalar) X=abs(10-coord[0]) 3. (Scalar) dist = X*X*coord[1]*coord[2]

2. Make a Pseudocolor plot of dist. 3. Observe that we have created a distance function. 4. Change the Pseudocolor plot's variable to be "hardyglobal" 5. Apply the Isosurface operator. 6. Bring up the Isosurface operator attributes 7. Change the "Select by" to be "Values" and change the text widget to

be "-500 500". 8. Change the variable to be "dist" 9. Apply 10. You will now see a contour based by the distance field, colored by the

hardyglobal variable.

3. Python Scripting

Command line interface (CLI) overview VisIt has a command line interface that is Python based. There are several ways to use the CLI:

1. Launch VisIt in a batch mode and run scripts e.g.: ./visit -nowin -cli -s <script.py>

Page 13: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

2. Launch VisIt so that a visualization window is visible and interactively issue CLI commands

3. Use both the standard graphical user interface (GUI) and CLI simultaneously

Launching the CLI We will focus on the use case where we have the graphical user interface and CLI simultaneously. To launch the CLI from the graphical user interface:

1. Go to Controls->Command 2. The CLI is launched by clicking "Execute"

Stupidly, the Execute button is greyed out unless there is a command to execute.

So type in "dir()" and then click on Execute. 3. This will launch a separate terminal that has the Python interface.

A first action in the CLI 1. Open noise.silo in the standard GUI if it not already open.

You can do this in the CLI, but it requires typing in absolute paths.

2. Type: AddPlot("Pseudocolor", "hardyglobal") You will see the active plots list in the GUI update, since the

CLI and GUI communicate. 3. Type: DrawPlots()

You should see your plot.

Tips about Python 1. Python is whitespace sensitive! This is a pain, especially when you are

cut-n-pasting things. 2. Python has great constructs for control and iteration.

I frequently use: 1. "for i in range(100):" 2. "if (cond):" 3. import sys / sys.exit

Page 14: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

Examples scripts We will be using Python scripts in each of the following sections: You can get them by:

1. Cut-n-paste-ing it into your Python interpreter 2. Or copying it to a separate file and issuing:

Source("/path/to/script/location/script.py") For all of these scripts, make sure noise.silo is currently open. NOTE: the formatting of the scripts below is horrible. This is because Wikis and Python both do different things with whitespace indentation and it is hard to rectify them. It is formatted poorly because this formatting will allow you to cut-n-paste the code from your web browser into the Python interpreter or into another file.

Setting attributes

DeleteAllPlots()

AddPlot("Pseudocolor", "hardyglobal")

DrawPlots()

p = PseudocolorAttributes()

p.minFlag = 1

p.maxFlag = 1

p.min = 3.5

p.max = 7.5

Page 15: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

SetPlotOptions(p)

Animating an isosurface

DeleteAllPlots()

AddPlot("Pseudocolor", "hardyglobal")

iso_atts = IsosurfaceAttributes()

iso_atts.contourMethod = iso_atts.Value

iso_atts.variable = "hardyglobal"

AddOperator("Isosurface")

DrawPlots()

for i in range(30):

iso_atts.contourValue = (2 + 0.1*i)

SetOperatorOptions(iso_atts)

# For moviemaking, you'll need to save off the image

# SaveWindow()

Animating the camera See http://www.visitusers.org/index.php?title=Visit-tutorial-python-fly

Page 16: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

Automating data analysis See http://www.visitusers.org/index.php?title=Visit-tutorial-python-analysis

Learning the CLI Here are some tips to learn the CLI better:

1. You can type "dir()" to see the list of all commands. (Type "dir()")

2. You can learn the syntax of a given method by typing "help(MethodName)" (Type "help(AddPlot)")

3. You can have the GUI translate GUI actions into Python commands by:

1. Bringing up Controls->Commands 2. Pressing "Record" 3. Performing GUI actions 4. Clicking Stop 5. The equivalent Python script will be placed in the Commands

window. Note that the scripts are very verbose and contain some

unnecessary commands, which can be edited out. 4. When you have a Python object, you can see all of its attributes by

entering its name (Type "s = SliceAttributes()", enter, followed by "s" and then

enter again)

Advanced features 1. You can set up your own buttons in the VisIt gui using the CLI.

See http://www.visitusers.org/index.php?title=Visitrc_file. 2. You can set up callbacks in the CLI that get called whenever events

happen in VisiIt. See http://www.visitusers.org/index.php?title=Visitrc_file.

Page 17: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

4. Moviemaking There are two parts to this section:

1. How to make a single image look better. 2. How to animate / make a movie

Setup work

Generate a time varying database VisIt doesn't come with any time varying databases to play with, so we will make some with the Python command language. This is a good exercise with Python, but if you have trouble, we've also made a tarball of the data files available at http://vis.lbl.gov/~hrchilds/HGX.tar.gz Open the file "noise.silo". Then execute the following script:

DefineScalarExpression("X", "coord(Mesh)[0]")

for i in range(20):

DefineScalarExpression("hgx", "hardyglobal*(1+max(0,abs(%d - (X+10))/5))" %(i))

DeleteAllPlots()

AddPlot("Pseudocolor", "hgx")

DrawPlots() e = ExportDBAttributes()

e.db_type = "VTK"

e.variables = ("hgx")

Page 18: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

e.filename = "hgx%02d" %(i)

ExportDatabase(e)

DeleteAllPlots()

DeleteExpression("hgx")

Create a plot We will now create a plot that we will work with for the rest of this wiki page.

1. Open up the "hgx*.vtk database" (the location will be wherever you started VisIt).

2. Make a contour plot of "hgx". 3. Bring up the plot attributes for the Contour plot and chance the Select

By to "N levels" and make the number of levels be 5. 4. Draw plots

Tips on the Contour plot The contour plot does two things:

1. Takes contours (isosurfaces) from your input data set 2. Colors each contour its own color.

There are two primary controls: 1. How to set the isovalues

This is done with "Select by" Nlevels automatically chooses the values for you

based on the minimums and maximums. EXAMPLE: For min=0 and max = 1 and

nLevels = 3, it would choose isovalues of 0.25, 0.5, and 0.75

Percent allows you to specify locations in terms of percentages. You may have multiple values that are space delimited

Page 19: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

EXAMPLE: For min=0 and max = 1 and percent = "20 80", the isovalues would be 0.2 and 0.8

Values allows you to explicity set the values. EXAMPLE: values = "0.2 0.8" would

(obviously) be 0.2 and 0.8. For Nlevels and Percent, you can aritificially set the

minimum and maximum values. 2. How to color each isovalue.

Single: color each isovalue with the same single color. This is best for contours with 2D data sets.

Multiple: give each isovalue its own color and then control the individual colors and opacities separately.

How to make a single image look better

Colors

Contour plot The default colors for the Contour plot are awfully bright. Sometimes adjusting these colors improves the picture quality.

Pseudocolor plot This section is using the Contour plot, but this is a natural place to demonstrate colors with the Pseudocolor plot. So let's take a quick detour...

1. Hide your Contour plot and make a Pseudocolor plot of "hgx". 2. Bring up the Pseudocolor plot attributes. 3. Change the Color table from "hot" to "hot_desaturated".

This is my favorite colormap. 4. Iterate over the rest of the color maps. 5. Now go to Controls->Color table. 6. Rather than creating a new color table, modify the "hot" color table. 7. Change the number of colors to be 6. Move the widgets and change

their colors. 8. Apply

Page 20: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

9. Change the Pseudocolor plot to use "hot" again. Your changes to the color table should be reflected.

10. We're done with our detour. Delete your Pseudocolor plot and unhide your Contour plot.

Lights

Modifying the number of lights, position and intensity Go to Controls->Lighting to do this. You have 8 lights to work with.

(You will never need this many) Most are disabled. When you want to turn on a light, it is important

that you click "Enabled". The three primary controls are direction, brightness, and type.

1. Type = AMBIENT: direction is not used ... everything is lit more brightly

2. Type = CAMERA: the light is like a miner's hat. As the camera rotates, the light rotates with it.

3. Type = POSITION: the light is fixed in one position in space.

Specular lighting This is one of the easiest ways to make your movie look nice. Go to Options->Rendering. Turn on specular lighting. Play with strength & sharpness.

Shadows Shadows are only supported if VisIt's "scalable rendering" mode is on.

1. Go to Options->Rendering 2. Go to the Advanced tab 3. Turn "Use scalable rendering" to "Always" 4. Turn Shadows on. 5. Click apply. 6. You will only see shadows if you have moved the light source.

Page 21: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

If the light source is at direction 0,0,-1, then the light source is coincident with your eye, hence shadows are invisible.

Annotations 1. Go to Controls->Annotations

1. On the General tab, turn off the "Database", and "User information"

2. Go to the 3D tab and look at the options there. The 2D tab has complete controls of tick mark

placement, etc. 2. Go to the Colors tab

1. Change the background style to gradient. 2. Experiment with the gradient styles and colors.

3. Go to the Objects tab. 1. Highlight the Legend object. 2. Turn off "Let VisIt manage legend position" 3. Change the legend position to be "0.8 0.9" and click apply 4. Click on "Time slider" 5. Click OK for the autogenerated name. 6. Change the text label from "Time=$time" to the empty string

The time will be incorrect because we generated this database artificially and each file has the same time.

7. Click on "Text" 8. Again click OK and accept the autogenerated name. 9. Change the text from "2D text annotation" to "This is my first

VisIt movie" or whatever. 10. Change the "Lower left" to be "0.5 0.01" 11. Click apply

Another detour: time animation Now that we have a time varying database, we can use the VCR controls.

1. Go to the VCR controls below the selected files list. 2. Click the right-facing arrow, the one to the right of the square ("stop")

VisIt starts animating in time. 3. Click the square to stop the animation.

Page 22: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

How to animate / make a movie The easy way to animate a movie is with the movie wizard.

You are limited by what you can do with the movie wizard. The simplest is to animate over time You can also use premade movie templates Keyframing is also possible, but is not robust.

The alternate way is to use Python scripting. With Python, you would add "SaveWindow" calls for each

frame. To use the movie wizard:

1. Go to File->Save Movie 2. Select new simple movie 3. Change the format to an image format

MPEG encoding is hard to support. You will get the best results by saving images, then encoding to a movie with a separate tool.

Never select the other movie formats 4. Click on the right arrow and then click next. 5. Click "Next" all the way through until you get to "Finish"

This is a terrible movie ... the isovalues change from time slice to time slice!! Fix this by changing the Contour plot attributes so the min and max are fixed.

5. Comparison There are two flavors of comparison that VisIt supports:

1. Image-based comparisons (side-by-side comparisons) 2. Data-level comparisons

Of course, the data analysis provided by VisIt enables other types of comparison, for example compare the volumes between two data sets.

Image-based comparisons

Page 23: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

Multiple window comparisons In this example, we use a single file, but you should think about using multiple files (for comparison). The reason we use a single file is a dearth of example data in the VisIt download.

1. Make a Pseudocolor plot of hardyglobal. 2. Make the window layout be 1x2.

There are two ways to do this: 1. On the toolbar, find the fifth icon from the left, a

rectangle with a line in the middle, indicating a 1x2 layout. 2. Or, on the gui on the left hand side, go to Windows-

>Layout->1x2. 3. Make window #2 be the active window.

There are two ways to do this: 1. Click on the first icon in the upper left in the toolbar,

which is a picture of window. 2. Right above the active plots list, there is a dropdown

labeled "Active window". Change that from 1 to 2. 4. The active plots list should be empty.

The active plots list always reflects the plots of the active window.

1. Change the active window back to window #1. The plot reappears in the active plots list.

2. Make window #2 active. The active plots list is empty again.

5. Go to Windows->Copy Plots From->Window #1. 6. The active plots list should now have a Pseudocolor plot of

hardyglobal. 7. Use the variable dropdown to change the active variable to

shepardglobal. 8. Draw.

You should now have a picture of hardyglobal on the left and a picture of shepardglobal on the right.

Page 24: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

9. Of course, you can have data from different files in the two windows (or even in the same window).

1. Now, on the toolbar, click on the lock with the eyeball for each

window. The views are now linked. Rotate one and the other rotates with

it. 2. Apply the slice operator to one of the plots. 3. Modify the slice operator attributes to *not* project to 2D. 4. Apply 5. Also click "Make Default" 6. Make the other window be active and apply the Slice operator.

It will also not project to 2D because you clicked "Make Default".

7. For both windows, click on the toolbar where there is a lock with two red squares connected by a green line. This will lock tools.

8. Turn on the plane tool in one of the visualization windows. Do this by clicking on the toolbar icon of a blue "plane", which

is to the left of a blue ball and to the right of a blue line. 9. You will now see red hotspots in the visualization window.

You can click in these hotspots and drag to adjust the slice plane.

Since the tools are locked, the slice in the other window will also update.

If you look at the Slice operator attributes window, you will see that the plane has updated to be consistent with the tool.

1. Make the window that does *not* have the plane tool up be active. 2. Modify the slice operator attributes so it *does* project to 2D. 3. Go back to the window with the plane tool. 4. Modify the plane.

The other window gets the new plane, but it is still projected.

Page 25: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

1. Go to File->Set Save Options 2. Turn "Save tiled" to be on and save. 3. The result will be an image that has both windows in it.

Single window comparisons If you want to look at two files in the same visualization window, you can do that as well, even if they occupy the same region of space.

1. Open curv3d.silo. 2. Make a Pseudocolor plot of "d" 3. Draw. 4. Open multi_ucd3d.silo. 5. Make a Pseudocolor plot "u" 6. Draw 7. The two plots are on top of each other, at least partially, as they do not

overlap perfectly. 8. Turn off the button "Apply operators to all plots" located under the

active plots list. VisIt by default will apply the same operators to all plots. This

button disables that behavior. 9. Apply the Reflect operator to the second Pseudocolor plot, the one

from multi_ucd3d.silo. You can tell that this plot comes from multi_ucd3d.silo,

because there is a number next to the plot (mine says 11:Pseudocolor(u)) and that number (11) corresponds to the file multi_ucd3d.silo in the file list.

Some materials may be turned off for multi_ucd3d.silo, if so, click on the interlocking rings to bring up the Subset window and turn the materials back on.

10. Bring up the Reflect operator attributes. 11. Modify the attributes so that:

1. Input mode is 3D

Page 26: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

2. The purple circle is clicked and turned off (turning it grey) and the square below it is still green.

3. Apply 12. You will now see the multi_ucd3d.silo plot of u below the curv3d.silo

plot of d.

Data level comparisons Data-level comparisons are done with "cross mesh field evaluations" ("CMFEs") which are documented extensively on visitusers.org. CMFEs are deployed through the expression language, which allows for flexible applications.

1. Open curv3d.silo 2. Bring up the window under Controls->Expressions 3. Make a new scalar expression, named "d_multi_ucd3d" 4. Define it as: pos_cmfe(</Users/childs3/visit/data/multi_ucd3d.silo:d>,

curvmesh3d, -10.) These arguments mean:

pos_cmfe: Take a "CMFE" and evaluate every point on the target mesh by finding the value at the same location from the donor mesh.

</Users/childs3/visit/data/multi_ucd3d.silo:d>: the path to the data. This is most robust when the full path is given. Obviously you will need to change the path to fit

your machine. We know this is a terrible interface.

curvmesh3d: the mesh to evaluate multi_ucd3d.silo's "d" variable onto. This is explicitly specified to handle the case when

there are multiple meshes in a file. -10: the value to use in regions that don't overlap.

5. Make a Pseudocolor plot of d_multi_ucd3d

Page 27: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

You will see that there are some regions of -10 and some regions that have real values.

6. Make a new scalar expression, d_diff: d - d_multi_ucd3d 7. Change your variable so you are plotting this.

The "-10s" are now "+10s" 8. Let's refine:

d_diff2 = if(ge(d_multi_ucd3d, 0), d-d_multi_ucd3d, 0) Read as: if (d_multi_ucd3d > 0) then "d-d_multi_ucd3d"

else "0" 9. VisIt complains when you try to plot this. It says that the centerings

are different. 1. Go to File->File Information.

"d" is zone-centered for curv3d.silo 2. Activate multi_ucd3d.silo.

File->File information updates automatically "d" is node-centered for multi_ucd3d.silo.

REGARDLESS: VisIt should handle this issue. This is a bug. 10. Redefine d_diff2 as:

d_diff2 = if(ge(recenter(d_multi_ucd3d)), 0), d-d_multi_ucd3d, 0)

11. You now get the right answer.

1. Delete your Pseudocolor plot. 2. Add a Histogram plot of d_diff2. 3. Modify the Histogram plot attributes so the bin contribution is by

frequency. 4. Click draw. 5. You now have a histogram of the differences between the two data

sets.

6.Data Representations

Page 28: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

VisIt supports some analysis and visualization methods that are alternate representations for data. This tutorial walks through three of them: Scatter Plots Parallel coordinates Equivalence Class Functions

Scatterplots

What are Scatter Plots?

Simple scatter plot of hardyglobal vs. shepardglobal.

Scatter Plots are plots of data that show the correlation between variables by

mapping them directly to the axes of a 2D or 3D plot. For example, it might

be useful to generate a scatterplot of temperature versus pressure. The image

to the right is a simple Scatter Plot of two variables from the noise.silo

dataset.

Page 29: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

Scatter Plots in VisIt can extend into 3D to show the corellation between three independent variables. And finally, VisIt can use color to encode yet a fourth variable in the image. Color can also be added to a 2D Scatter Plot to add a third dimension.

Experiment with Scatter Plots

Your first Scatter Plot

Scatter Plot wizard 1. Open the noise.silo dataset. 2. From the Plots menu, select "Scatter" and then "hardyglobal".

A Scatter Plot "wizard" appears, allowing easy creation of the plot. Follow the prompts.

1. From the Variable menu on the right of the wizard, select Scalars->shepardglobal and "Next".

2. Select the "No" radio button for the Z coordinate and hit "Next". 3. Select the "No" radio button for color and hit "Next". 4. Press the "Finish" button.

You now have a Scatter Plot in the Active plots list ready to be drawn. 1. Hit Draw

You should get the simple picture at the top right of the page (though likely in reverse colors – I like black backgrounds.)

Play with the Plot options There are a lot of options available for the Scatter Plot. Let's try some of them.

1. Double-click the plot in the Active plots list to bring up the attributes window.

Page 30: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

There are two primary tabs to manipulate the plot, Inputs and Appearance. Let's try changing the inputs to create a more complex Scatter Plot. First note that a summary of all of your input settings are summarized near the bottom of the window for quick reference.

1. Click "Input 3". 2. Change the Variable from "default" to "grad_magnitude" 3. Change the Role from "None" to "Z coordinate". 4. Click Apply and watch the plot change. Rotate it around to get a sense

of the multivariate correllation. Okay plot, but a bit hard to see. Scatter Plots are best interacted with when

"Navigate bbox" mode is turned off. Hit the button up in the toolbar to

make it look like . Interaction will be much nicer now.

3d colored scatter plot

# Click "Input 4". 1. Change the Variable from from "default" to "chromeVf". 2. Change the Role from "None" to "Color". 3. Click Apply and watch the plot.

Interesting plot. Let's try changing the appearance. 1. Click the "Appearance" tab at the top. 2. Change the "Point Type" to "Sphere". 3. Change the "Point size (pixels)" to 10.

Page 31: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

4. Change the "Color table" to "difference" 5. Click Apply.

Now the 3D relationship between the points should be more clear.

Parallel coordinates Parallel coordinates plots have traditionally been used in the field of Information Visualization (or "Info Vis") to display data with a high number of dimensions. We have incorporated parallel coordinates plots into VisIt in a way that allows for the summary of very large data yet still allowing the exploration of individual data points. See Parallel Coordinates Introduction (http://www.visitusers.org/index.php?title=Parallel_Coordinates_Introduction) for a pictoral introduction to parallel coordinates in VisIt.

Experiment with Parallel Coordinates

Simple plot

Parallel Coordinates Wizard 1. Open noise.silo 2. Create a Parallel Coordinates plot and select "hardyglobal". 3. In the wizard that appears, select "shepardglobal" as the 2nd variable. 4. If you feel like it, continue to add variables. The set of valid point

variables in the noise.silo dataset are: hardyglobal, shepardglobal, airVf, airVfGradient_magnitude, chromeVf, grad_magnitude, radial, and x.

5. Hit Draw. You should have a decent looking parallel coordinates plot drawn.

Page 32: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

Data restriction With the plot from the prior exercise, let's try restricting the data to focus on features of interest.

Hit the Axis Restriction tool button at the top of the visualization window. Red arrows will appear at the bottom and top of each of your

axes . If you drag any of these into your data, the appearance will change. The context (density) is still shown in the background, but individual data lines are drawn over the top.

1. Continue playing with the axis restriction tool to better understand the

trends that you're seeing.

[edit]Using Parallel Coordinates to do data subsetting The Axis Restriction tool can be linked to data subsets in other windows. Let's use your existing Parallel Coordinates plot to restrict a Pseudocolor Plot in a second window.

1. Open second window 2. Create Pseudocolor Plot of hardyglobal.

Page 33: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

3. Apply a Threshold Operator 4. To the Threshold Operator, add the variables that you have in the

Parallel Coordinates plot in the first window. (You only need to add the variables that you are going to restrict.)

Lock Tools menu You might want to lay the windows out so that they don't overlap each other so that changes in one window can be seen quickly in the other window.

1. In both windows, enable the Lock Tools button . You can also enable it through the Windows->Lock->Tools option, as shown to the right.

Now, when you manipulate the data selection in your Parallel Coordinates plot, the Threshold operator in the other windows changes to reflect your selection.

Page 34: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

Equivalence Class Functions (ECFs) There's a good online introduction to Equivalence Class Functions (Derived Data Functions) at the VisIt Users wiki: DDFs in VisIt is note: We implemented the functionality of statistical binning in VisIt and called them Derived Data Functions, or DDFs. Only later did we learn that this concept is traditionally known as Equivalence Class Functions, or ECFs, in statistics. We have yet to rename the functionality in VisIt, so you will find us alternately using both terms.

Overview Equivalence Class Functions allow to do binning of your data across as many axes as you like. You can use spatial coordinates, mesh variables, and time as your axes. Once you've defined your bins, you can declare a statistical operation to take on any data values that land in each bin. The available operators are: Average, Minimum, Maximum, StandardDeviation, Variance, Sum, and Count.

Page 35: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

2D Histogram Example Let's use ECFs to create a 2D histogram of data we explored in the Scatter Plot tutorial.

1. Open up a Python window from inside VisIt. 2. Make sure that "noise.silo" is opened. 3. Put a PseudoColor plot of "hardyglobal" up. (It's not too important

what the plot is, just that there's a pipeline active in VisIt.) 4. Enter and execute the following code:

c = ConstructDDFAttributes()

c.ddfName = "hist"

c.varnames = ("hardyglobal", "shepardglobal")

c.ranges = (2, 5, 2, 5)

c.numSamples = (128, 128)

c.codomainName = "hardyglobal" # Not used when doing "Count" operator

c.statisticalOperator = c.Count

ConstructDDF(c)

A file called "hist.vtk" will be created in your current working directory. 1. Open hist.vtk in VisIt. 2. Do a PseudoColor plot of "hardyglobal".

You are directly viewing the ECF. Since we used the Count operator, this is a 2D histogram of hardyglobal vs. shepardglobal. You'll note that it looks rather similar to the Scatter Plot of hardyglobal vs. shepardglobal that you made in an earlier exercise. Only this now has quantitative information about the density of the correlation.

Page 36: 1. VisIt basics - Interdisciplinary | Innovativekorobkin/tmp/SC10/... · 1. VisIt basics 2. Data analysis 3. Python scripting 4. Moviemaking 5. Comparison 6. Data representations

Deviation from Average Now we're going to create an ECF that is a localized average. We're then going to apply this ECF back to the original dataset, using an expression, to calculate how values differ from the local average.