PythonInterface1 4 1
PythonInterface1 4 1
PythonInterface1 4 1
L
L aw
N ive re
La ati rm nc
bo on or e
ra al e
to
ry
Version 1.4.1
ii
DISCLAIMER
This document was prepared as an account of work sponsored by an agency of the United States Government. Neither
the United States Government nor the University of California nor any of their employees, makes any warranty,
express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of
any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately
owned rights. Reference herein to any specific commercial product, process, or service by trade name, trademark,
manufacturer, or otherwise, does not necessarily constitute or imply its endorsement, recommendation, or favoring by
the United States Government or the University of California. The views and opinions of authors expressed herein do
not necessarily state or reflect those of the United States Government or the University of California, and shall not be
used for advertising or product endorsement purposes.
Work performed under the auspices of the U.S. Department of Energy by Lawrence Livermore National Laboratory
under Contract W-7405-ENG-48.
iii
iv
Introduction to VisIt
Manual chapters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Understanding how VisIt works . . . . . . . . . . . . . . . . . . . . . 2
Starting VisIt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Getting started. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Python
Indentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Data types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Control flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Quick Recipes
Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Function Reference
Overview. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
AddArgument . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Close . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Launch. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
LocalNamespace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
DebugLevel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Version . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
ActivateDatabase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
AddOperator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
AddPlot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
AddWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
AlterDatabaseCorrelation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
ChangeActivePlotsVar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
CheckForNewStates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
ChooseCenterOfRotation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
ClearCache . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Clear . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
ClearPickPoints. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
ClearReferenceLines. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
ClearViewKeyframes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
CloneWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
CloseComputeEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
CloseDatabase. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
ColorTableNames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
CreateAnnotationObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
CreateDatabaseCorrelation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
DefineExpression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
DeIconifyAllWindows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
DeletePlots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
DeleteDatabaseCorrelation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
DeleteExpression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
DeletePlotDatabaseKeyframe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58
DeletePlotKeyframe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
DeleteViewKeyframe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
DeleteWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
DemoteOperator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
DisableRedraw . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
DrawPlots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
EnableTool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
EvalCubic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
EvalCubicSpline . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
EvalLinear. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
EvalQuadratic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
GetActiveColorTable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
GetActiveTimeSlider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
GetAnimationTimeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
GetAnimationNumStates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
GetAnnotationAttributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
GetAnnotationObject . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
GetDatabaseNStates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
GetDomains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
GetEngineList . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
GetGlobalAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
GetGlobalLineoutAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
GetInteractorAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
GetKeyframeAttributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
GetLastError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
GetLight . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
GetLocalName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
GetMaterialAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
GetMaterials . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
GetNumPlots. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
GetPickAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
GetPickOutput. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
vi
GetPipelineCachingMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
GetQueryOutput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
GetQueryOverTimeAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
GetRenderingAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
GetSaveWindowAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
GetTimeSliders . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
GetView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
GetWindowInformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
HideActivePlots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
HideToolbars. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102
IconifyAllWindows. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
InvertBackgroundColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Lineout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
ListPlots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
LongFileName . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
MovePlotDatabaseKeyframe . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
MovePlotKeyframe. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
MoveViewKeyframe. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
NodePick. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
NumColorTableNames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
NumOperatorPlugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
NumPlotPlugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
OpenComputeEngine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
OpenDatabase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
OpenMDServer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
OperatorPlugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
OverlayDatabase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Pick . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
PickByGlobalNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
PickByGlobalZone . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
PickByNode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
PickByZone. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
PlotPlugins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
PrintWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
PromoteOperator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
QueriesOverTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Query. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
QueryOverTime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
RecenterView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
RedrawWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
RemoveOperator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 136
ReOpenDatabase. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
ReplaceDatabase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
vii
ResetLineoutColor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
ResetOperatorOptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
ResetPickLetter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
ResetPlotOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
ResetView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
RestoreSession . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
SaveSession. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
SaveWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
SetActiveColorTable. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
SetActivePlots. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
SetActiveTimeSlider. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
SetActiveWindow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
SetAnimationTimeout. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
SetAnnotationAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
SetCenterOfRotation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
SetDatabaseCorrelationOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
SetGlobalLineoutAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
SetInteractorAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
SetKeyframeAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
SetLight. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
SetMaterialAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
SetOperatorOptions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
SetPickAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
SetPipelineCachingMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
SetPlotDatabaseState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
SetPlotFrameRange. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
SetPlotOptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166
SetPlotSILRestriction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
SetPrinterAttributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
SetQueryOverTimeAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
SetRenderingAttributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
SetSaveWindowAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
SetTimeSliderState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
SetView. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
SetViewExtentsType. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
SetViewKeyframe. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
SetWindowArea . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
SetWindowLayout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
SetWindowMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
ShowAllWindows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
ShowToolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
TimeSliderGetNStates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
TimeSliderNextState. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
TimeSliderPrevState . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
ToggleMode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
viii
Turn. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
UndoView . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
WriteConfigFile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Object Reference I
Functions and Objects. . . . . . . . . . . . . . . . . . . . . . . . . . . 191
AnnotationAttributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
GlobalAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196
LightAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
MaterialAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
PrinterAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
RenderingAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
SaveWindowAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
SILRestriction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
ViewCurveAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
View2DAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
View3DAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
WindowInformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
ix
IndexSelectAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
InverseGhostZoneAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
IsosurfaceAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
IsovolumeAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
LineoutAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
OnionPeelAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
ProjectAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
ReflectAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
RevolveAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253
SliceAttributes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
SphereSliceAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
ThreeSliceAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
ThresholdAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257
TransformAttributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
Chapter 1
1.0
Introduction to VisIt
Overview
VisIt is a distributed, parallel, visualization tool for visualizing data defined on two and
three-dimensional structured and unstructured meshes. VisIts distributed architecture
allows it to leverage both the compute power of a large parallel computer and the graphics
acceleration hardware of a local workstation. Another benefit of the distributed
architecture is that VisIt can visualize the data where it is generated, eliminating the need
to move data. VisIt can be controlled by a Graphical User Interface (GUI) or through the
Python scripting language. More information about VisIts Graphical User Interface can
be found in the VisIt Users Manual.
2.0
Manual chapters
This manual is broken down into the following chapters:
Overview
Chapter title
Chapter description
Introduction to VisIt
This chapter.
Python
Quick Recipes
Function Reference
Object Reference I
Introduction to VisIt
3.0
Appendix A
Introduction to VisIt
Python Interface is built-in. The CLI is provided to simplify the process of running VisIt
Python scripts.
Scripts
Python
interpreter
VisIt module
Local computer
Remote computer
Database server
VCL
4.0
Starting VisIt
You can invoke VisIts command line interface from the command line by typing: visit -cli
For a complete list of the command line options, see Appe ndix A on page 259. It is best
to have VisIt in your default search path instead of specifying the absolute path to VisIt
when starting it. This isnt important when VisIt is run locally, but VisIt may not run
properly in a distributed manner if it isnt in your default search path on all the machines
on which you plan to run VisIt.
Introduction to VisIt
5.0
Getting started
VisIt is a tool for visualizing 2D and 3D scientific databases. The first thing to do when
running VisIt is select databases to visualize. To select a database, you must first open the
database using the OpenDatabase function. After a window has an open database, any
number of plots and operators can be added. To create a plot, use the AddPlot function.
After adding a plot, call the DrawPlots function to make sure that all of the new plots are
drawn.
Example:
OpenDatabase(/usr/gapps/visit/data/multi_curv3d.silo)
AddPlot(Pseudocolor, u)
DrawPlots()
To see a list of the available plots and operators when you use the VisIt Python Interface,
use the OperatorPlugins and PlotPlugins functions. Each of those functions returns a tuple
of strings that contain the names of the currently loaded plot or operator plugins. Each plot
and operator plugin provides a function for creating an attributes object to set the plot or
operator attributes. The name of the function is the name of the plugin in the tuple returned
by the OperatorPlugins or PlotPlugins functions plus the word Attributes. For example,
the Pseudocolor plot provides a function called PseudocolorAttributes.
To set the plot attributes or the operator attributes, first use the attributes creation function
to create an attributes object. Assign the newly created object to a variable name and set
the fields in the object. Each object has its own set of fields. To see the available fields in
an object, print the name of the variable at the Python prompt and press the Enter key. This
will print the contents of the object so you can see the fields contained by the object. After
setting the appropriate fields, pass the object to either the SetPlotOptions function or the
SetOperatorAttributes function.
Example:
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
AddOperator(Slice)
p = PseudocolorAttributes()
p.colorTableName = rainbow
p.opacity = 0.5
SetPlotOptions(p)
a = SliceAttributes()
a.originType = a.Point
a.normal, a.upAxis = (1,1,1), (-1,1,-1)
SetOperatorOptions(a)
DrawPlots()
Thats all there is to creating a plot using VisIts Python Interface. For more information
on creating plots and performing specific actions in VisIt, refer to the documentation for
each function later in this manual.
Chapter 2
1.0
Python
Overview
Python is a general purpose, interpreted, extensible, object-oriented scripting language
that was chosen for VisIts scripting language due to its ease of use and flexibility. VisIts
Python interface was implemented as Python module and it allows you to enhance your
Python scripts with coding to control VisIt. This chapter explains some of Pythons syntax
so it will be more familiar when you examine the examples found in this document. For
more information on programming in Python, there are a number of good references,
including on the Internet at http://www.python.org.
2.0
Indentation
One of the most obvious features of Python is its use of indentation for new scopes. You
must take special care to indent all program logic consistently or else the Python
interpreter may halt with an error, or worse, not do what you intended. You must increase
indentation levels when you define a function, use an if/elif/else statement, or use any loop
construct.
Note the different levels of indentation:
def example_function(n):
v = 0
if n > 2:
print n greater than 2.
else:
v = n * n
return v
Overview
Python
3.0
Comments
Like all good programming languages, Python supports the addition of comments in the
code. Comments begin with a pound character (#) and continue to the end of the line.
# This is a comment
a = 5 * 5
4.0
Identifiers
The Python interpreter accepts any identifier that contains letters A-Z, a-z and
numbers 09 as long as the identifier does not begin with a number. The Python
interpreter is case-sensitive so the identifier case would not be the same identifier as
CASE. Be sure to case consistently throughout your Python code since the Python
interpreter will instantiate any identifier that it has not seen before and mixing case would
cause the interpreter to use multiple identifiers and cause problems that you might not
expect. Identifiers can be used to refer to any type of object since Python is flexible in its
treatment of types.
5.0
Data types
Python supports a wide variety of data types and allows you to define your own data types
readily. Most types are created from a handful of building-block types such as integers,
floats, strings, tuples, lists, and dictionaries.
5.1
Strings
Python has built-in support for strings and you can create them using single quotes or
double quotes. You can even use both types of quotes so you can create strings that include
quotes in case quotes are desired in the output. Strings are sequence objects and support
operations that can break them down into characters.
s = using single quotes
s2 = using double quotes
s3 = nesting the spiffy double quotes
5.2
Tuples
Python supports tuples, which can be thought of as a read-only set of objects. The
members of a tuple can be of different types. Tuples are commonly used to group multiple
related items into a single object that can be passed around more easily. Tuples support a
number of operations. You can subscript a tuple like an array to access its individual
members. You can easily determine whether an object is a member of a tuple. You can
Python
iterate over a tuple. There are many more uses for tuples. You can create tuples by
enclosing a comma-separated list of objects in parenthesis.
# Create a tuple
a = (1,2,3,4,5)
print The first value in a is:, a[0]
# See if 3 is in a using the in operator.
print 3 is in a:, 3 in a
# Create another tuple and add it to the first one to create c.
b = (6,7,8,9)
c = a + b
# Iterate over the items in the tuple
for value in c:
print value is: , value
5.3
Lists
Lists are just like tuples except they are not read-only and they use square brackets [] to
enclose the items in the list instead of using parenthesis.
# Start with an empty list.
L = []
for i in range(10):
# Add i to the list L
L = L + [i]
print L
# Assign a value into element 6
L[5] = 1000
print L
5.4
Dictionaries
Dictionaries are Python containers that allow you to store a value that is associated with a
key. Dictionaries are convenient for mapping 1 set to another set since they allow you to
perform easy lookups of values. Dictionaries are declared using curly braces {} and each
item in the dictionary consists of a key:value pair with the key and values being separated
by a colon. To perform a lookup using a dictionary, provide the key whose value you want
to look up to the subscript [] operator.
colors = {red : rouge, orange : orange, \
yellow : jaune, green : vert, blue : bleu}
# Perform lookups using the keys.
for c in colors.keys():
print %s in French is: %s % (c, colors[c])
6.0
Control flow
Python, like other general-purpose programming languages provides keywords that
implement control flow. Control flow is an important feature to have in a programming
Python
if/elif/else
Python provides if/elif/else for conditional branching. The if statement takes any
expression that evaluates to an integer and it takes the if branch if the integer value is 1
other wise it takes the else branch if it is present.
# Example 1
if condition:
do_something()
# Example 2
if condition:
do_something()
else:
do_something_else()
# Example 3
if condition:
do_domething()
elif conditionn:
do_something_n()
...
else:
do_something_else()
6.2
For loop
Python provides a for loop that allows you to iterate over all items stored in a sequence
object (tuples, lists, strings). The body of the for loop executes once for each item in the
sequence object and allows you to specify the name of an identifier to use in order to
reference the current item.
# Iterating through the characters of a string
for c in characters:
print c
# Iterating through a tuple
for value in (VisIt, is, coolness, times, 100):
print value
# Iterating through a list
for value in [VisIt, is, coolness, times, 100):
print value
# Iterating through a range of numbers [0,N) created with range(N).
N = 100
for i in range(N):
print i, i*i
Python
6.3
While loop
Python provides a while loop that allows you to execute a loop body indefinitely based on
some condition. The while loop can be used for iteration but can also be used to execute
more complex types of loops.
token = get_next_token()
while token != :
do_something(token)
token = get_next_token()
7.0
Functions
Python comes with many built-in functions and modules that implement additional
functions. Functions can be used to execute bodies of code that are meant to be re-used.
Functions can optionally take arguments and can optionally return values. Python provides
the def keyword, which allows you to define a function. The def keyword is followed by
the name of the function and its arguments, which should appear as a tuple next to the
name of the function.
# Define a function with no arguments and no return value.
def my_function():
print my function prints this...
# Define a function with arguments and a return value.
def n_to_the_d_power(n, d):
value = 1
if d > 0:
for i in range(d):
value = value * n
elif d < 0:
value = 1. / float(n_to_the_d_power(n, -d))
return value
Python
10
Chapter 3
1.0
Quick Recipes
Overview
This manual contains documentation for over two hundred functions and several dozen
extension object types. Learning to combine the right functions in order to accomplish a
visualization task without guidance would involve hours of trial and error. To maximize
productivity and start creating visualizations using Visits Python Interface as fast as
possible, this chapter provides some common patterns, or quick recipes that you can
combine to quickly create complex scripts.
2.0
Patterns
This section contains short various code snippets that illustrate various concepts. Each bit
of code is targetted at performing a specific visualization action and contains the VisIt
scripting commands that are required to complete that action. You can combine one or
more of these sections of code to build up more complex scripts.
2.1
VisIts session files contain all of the information required to recreate plots that have been
set up in previous interactive VisIt sessions. Since session files contain all of the
information about plots, etc., they are natural candidates to make scripting easier since
they can be used to do the hard part of setting up the complex visualization, leaving the
bulk of the script to animate through time or alter the plots in some way. To use session
files within a script, use the RestoreSession function, documented on page 144.
# Import a session file from the current working directory.
RestoreSesssion(my_visualization.session, 0)
# Now that VisIt has restored the session, animate through time.
11
Quick Recipes
2.2
If you dont want to use a session file to begin the setup for your visualization then you
will have to dive into opening databases, creating plots, and animating through time. This
is where all of hand-crafted scripts begin. The first step in creating a visualization is
opening a database. VisIt provides the OpenDatabase function (see page 118) to open a
database. Once a database has been opened, you can create plots from its variables using
the AddPlot function (see page 34). The AddPlot function takes a plot plugin name and
the name of a variable from the open database. Once youve added a plot, it is in the new
state, which means that it has not yet been submitted to the compute engine for processing.
To make sure that the plot gets drawn, call the DrawPlots function.
# Step 1: Open a database
OpenDatabase(/usr/gapps/visit/data/wave.visit)
# Step 2: Add plots
AddPlot(Pseudocolor, pressure)
AddPlot(Mesh, quadmesh)
# Step 3: Draw the plots
DrawPlots()
# Step 4: Animate through time and save images
for states in range(TimeSliderGetNStates()):
SetTimeSliderState(state)
SaveWindow()
2.3
Saving images
Much of the time, the entire purpose of using VisIts Python Interface is to create a script
that can save out images of a time-varying database for the purpose of making movies.
Saving images using VisIts Python Interface is a straight-forward process, involving just a
few functions.
2.3.1
VisIt provides a number of options for saving files, including: file format, filename, image
size, to name a few. These attributes are grouped into the SaveWindowAttributes object.
To set the options that VisIt uses to save files, you must create a SaveWindowAttributes
object, change the necessary attributes, and call the SetSaveWindowAttributes function.
Note that if you want to create images using a specific image resolution, the best way is to
use the -geometry command line argument with VisIts Command Line Interface and tell
VisIt to use screen capture. If you instead require your script to be capable of saving
12
Quick Recipes
several different image sizes then you can turn off screen capture and set the image
resolution in the SaveWindowAttributes object.
# Save a BMP file at 1024x768 resolution
s = SaveWindowAttributes()
s.format = s.BMP
s.fileName = mybmpfile
s.width, s.height = 1024,768
s.screenCapture = 0
SetSaveWindowAttributes(s)
2.3.2
Saving an image
Once you have set the SaveWindowAttributes to your liking, you can call the
SaveWindow function to save an image. The SaveWindow function returns the name of
the image that is saved so you can use that for other purposes in your script.
# Save images of all time steps and add each image filename to a list.
names = []
for state in range(TimeSliderGetNStates()):
SetTimeSliderState(state)
# Save the image
n = SaveWindow()
names = names + [n]
print names
2.4
VisIt allows you to open a wide array of databases both in terms of supported file formats
and in terms how databases treat time. Databases can have a single time state or can have
multiple time states. Databases can natively support multiple time states or sets of single
time states files can be grouped into time-varying databases using .visit files or using
virtual databases. Working with databases gets even trickier if you are using VisIt to
visualize a database that is still being generated by a simulation. This section describes
how to interact with databases.
2.4.1
Opening a database
Opening a database is a relatively simple operation - most complexities arise in how the
database treats time. If you only want to visualize a single time state or if your database
format natively supports multiple time states per file then opening a database requires just
a single call to the OpenDatabase function.
# Open a database at time state 0
OpenDatabase(/usr/gapps/visit/data/allinone00.pdb)
2.4.2
Opening a database at a later time state is done just the same as opening a database at time
state zero except that you must specify the time state at which you want to open the
13
Quick Recipes
database. There are a number of reasons for opening a database at a later time state. The
most common reason for doing so, as opposed to just changing time states later, is that
VisIt uses the metadata from the first opened time state to describe the contents of the
database for all time states (except for certain file formats that dont do this i.e. SAMRAI).
This means that the list of variables found for the first time state that you open is used for
all time states. If your database contains a variable at a later time state that does not exist at
earlier time states, you must open the database at a later time state to gain access to the
transient variable.
# Open a database at a later time state to pick up transient variables
OpenDatabase(/usr/gapps/visit/data/wave.visit, 17)
2.4.3
VisIt provides two ways for accessing a set of single time-state files as a single timevarying database. The first method is a .visit file, which is a simple text file that contains
the names of each file to be used as a time state in the time-varying database. The second
method uses virtual databases, which allow VisIt to exploit the file naming conventions
that are often employed by simulation codes when they create their dumps. In many cases,
VisIt can scan a specified directory and determine which filenames look related. Filenames
with close matches are grouped as individual time states into a virtual database whose
name is based on the more abstract pattern used to create the filenames.
# Opening first file in series wave0000.silo, wave0010.silo, ...
OpenDatabase(/usr/gapps/visit/data/wave0000.silo)
# Opening a virtual database representing all wave*.silo files.
OpenDatabase(/usr/gapps/visit/data/wave*.silo database)
2.4.4
VisIt supports running the client on a local computer while also allowing you to process
data in parallel on a remote computer. If you want to access databases on a remote
computer using VisIts Python Interface, the only difference to accessing a database on a
local computer is that you must specify a host name as part of the database name.
# Opening a file on a remote computer by giving a host name
OpenDatabase(thunder:/usr/gapps/visit/data/wave.visit, 17)
2.4.5
14
Quick Recipes
of the host on which to run the compute engine and any arguments that must be used to
launch the engine such as the number of processors.
# Open a remote, parallel compute engine before opening a database
OpenComputeEngine(mcr, (-np, 4, -nn, 2))
OpenDatabase(mcr:/usr/gapps/visit/data/multi_ucd3d.silo)
2.5
Plots are viewable objects, created from a database, that can be displayed in a visualization
window. VisIt provides several types of plots and each plot allows you to view data using
different visualization techniques. For example, the Pseudocolor plot allows you to see the
general shape of a simulated object while painting colors on it according to the values
stored in a variables scalar field. The most important functions for interacting with plots
are covered in this section.
2.5.1
Creating a plot
The function for adding a plot in VisIt is: AddPlot. The AddPlot function takes the name
of a plot type and the name of a variable that is to be plotted and creates a new plot and
adds it to the plot list. The name of the plot to be created corresponds to the name of one of
VisIts plot plugins, which can be queried using the PlotPlugins function. The variable that
you pass to the AddPlot function must be a valid variable for the open database. New plots
are not realized, meaning that they have not been submitted to the compute engine for
processing. If you want to force VisIt to process the new plot you must call the DrawPlots
function.
# Names of all available plot plugins
print PlotPlugins()
# Create plots
AddPlot(Pseudocolor, pressure)
AddPlot(Mesh, quadmesh)
# Draw the plots
DrawPlots()
2.5.2
Plotting materials
Each plot type has an attributes object that controls how the plot generates its data or how
it looks in the visualization window. The attributes object for each plot contains different
fields. You can view the individual object fields by printing the object to the console. Each
VisIt Python Interface Manual
15
Quick Recipes
plot type provides a function that creates a new instance of one of its attribute objects. The
function name is always of the form: plotname + Attributes. For example, the attributes
object creation function for the Pseudocolor plot would be: PseudocolorAttributes. To
change the attributes for a plot, you create an attributes object using the appropriate
function, set the properties in the returned object, and tell VisIt to use the new plot
attributes by passing the object to the SetPlotOptions function (see page 166). Note that
you should set a plots attributes before calling the DrawPlots method to realize the plot
since setting a plots attributes can cause the compute engine to recalculate the plot.
# Creating a Pseudocolor plot and setting min/max values.
AddPlot(Pseudocolor, pressure)
p = PseudocolorAttributes()
# Look in the object
print p
# Set the min/max values
p.min, p.minFlag = 1, 0.0
p.max, p.maxFlag = 1, 10.0
SetPlotOptions(p)
2.5.4
When you work with more than one plot, it is sometimes necessary to set the active plots
because some of VisIts functions apply to all of the active plots. The active plot is usually
the last plot that was created unless youve changed the list of active plots. Changing
which plots are active is useful when you want to delete or hide certain plots or set their
plot attributes independently. When you want to set which plots are active, use the
SetActivePlots function. If you want to list the plots that youve created, call the ListPlots
function.
# Create more than 1 plot of the same type
AddPlot(Pseudocolor, pressure)
AddPlot(Pseudocolor, density)
# List the plots. The second plot should be active.
ListPlots()
# Draw the plots
DrawPlots()
# Hide the first plot
SetActivePlots(0)
HideActivePlots()
# Set both plots color table to hot
p = PseudocolorAttributes()
p.colorTableName = hot
SetActivePlots((0,1))
SetPlotOptions(p)
# Show the first plot again.
SetActivePlots(0)
HideActivePlots()
16
Quick Recipes
When VisIts compute engine cannot process a plot, the plot is put into the error state.
Once a plot is in the error state, it no longer is displayed in the visualization window. If
you are generating a movie, plots entering the error state can be a serious problem because
you most often want all of the plots that you have created to animate through time and not
disappear in the middle of the animation. You can add extra code to your script to prevent
plots from disappearing (most of the time) due to error conditions by adding a call to the
DrawPlots function.
# Save an image and take care of plots that entered the error state.
drawThePlots = 0
for state in range(TimeSliderGetNStates()):
if SetTimeSliderState(state) == 0:
drawThePlots = 1
if drawThePlots == 1:
if DrawPlots() == 0:
print VisIt could not draw plots for state: %d % state
else:
drawThePlots = 0
SaveWindow()
2.6
Operators
Operators are filters that are applied to database variables before the compute engine uses
them to create plots. Operators can be linked one after the other to form chains of
operators that can drastically transform the data before plotting it.
2.6.1
Adding operators
Adding an operator is similar to adding a plot in that you call a function with the name of
the operator to be added. The list of available operators is returned by the OperatorPlugins
function. Any of the names returned in that plugin can be used to add an operator using the
AddOperator function. Operators are added to the active plots by default but you can also
force VisIt to add them to all plots in the plot list.
# Print available operators
print OperatorPlugins()
# Create a plot
AddPlot(Pseudocolor)
# Add an Isovolume operator and a Slice operator
AddOperator(Isovolume)
17
Quick Recipes
AddOperator(Slice)
DrawPlots()
2.6.2
Each plot gets its own instance of an operator which means that you can set each plots
operator attributes independently. Like plots, operators use objects to set their attributes.
These objects are returned by functions whose names are of the form: operatorname +
Attributes. Once you have created an operator attributes object, you can pass it to the
SetOperatorOptions to set the options for an operator. Note that setting the attributes for an
operator nearly always causes the compute engine to recalculate the operator. You can use
the power of VisIts Python Interface to create complex operator behavior such as in the
following code example, which moves slice planes through a Pseudocolor plot.
# Moving slice planes
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Pseudocolor, hardyglobal)
AddOperator(Slice)
s = SliceAttributes()
s.originType = s.Percent
s.project2d = 0
SetOperatorOptions(s)
DrawPlots()
nSteps = 20
for axis in (0,1,2):
s.axisType = axis
for step in range(nSteps):
t = float(step) / float(nSteps - 1)
s.originPercent = t * 100.
SetOperatorOptions(s)
SaveWindow()
2.7
Quantitative operations
This section focuses on some of the operations that allow you to examine your data more
quantitatively.
2.7.1
Defining expressions
VisIt allows you to create derived variables using its powerful expressions language. You
can plot or query variables created using expressions just as you would if they were read
from a database. VisIts Python Interface allows you to create new scalar, vector, tensor
variables using the DefineScalarExpression, DefineVectorExpression, and
DefineTensorExpression functions.
# Creating a new expression
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Pseudocolor, hardyglobal)
DrawPlots()
18
Quick Recipes
DefineScalarExpression(newvar, sin(hardyglobal) + \
cos(shepardglobal)
ChangeActivePlotsVar(newvar)
2.7.2
Pick
VisIt allows you to pick on cells, nodes, and points within a database and reutrn
information for the item of interest. To that end, VisIt provides several pick functions.
Once a pick function has been called, you can call the GetPickOutput function to get a
string that contains the pick information. The information in the string could be used for a
multitude of uses such as building a test suite for a simulation code.
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Pseudocolor, hgslice)
DrawPlots()
s = []
# Pick by a node id
PickbyNode(300)
s = s + [GetPickOutput()]
# Pick by a cell id
PickByZone(250)
s = s + [GetPickOutput()]
# Pick on a cell using a 3d point
Pick((-2., 2., 0.))
s = s + [GetPickOutput()]
# Pick on the node closest to (-2,2,0)
NodePick((-2,2,0))
s = s + [GetPickOutput()]
# Print all pick results
print s
2.7.3
Lineout
VisIt allows you to extract data along a line, called a lineout, and plot the data using a
Curve plot.
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Pseudocolor, hgslice)
DrawPlots()
Lineout((-5,-3), (5,8))
# Specify a number of sample points
Lineout((-5,-4), (5,7))
2.7.4
Query
VisIt can perform a number of different queries based on values calculated about plots or
their originating database.
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Pseudocolor, hardyglobal)
DrawPlots()
Query(NumNodes)
print The float value is: %g % GetQueryOutputValue()
19
Quick Recipes
Query(NumNodes)
2.7.5
A common operation in debugging a simulation code is examining the min and max
values. Here is a pattern that allows you to print out the min and the max values and their
locations in the database and also see them visually.
# Define a helper function to get the ids of the MinMax query.
def GetMinMaxIds():
Query(MinMax)
import string
s = string.split(GetQueryOutputString(), )
retval = []
nextGood = 0
idType = 0
for token in s:
if token == (zone or token == (cell:
idType = 1
nextGood = 1
continue
elif token == (node:
idType = 0
nextGood = 1
continue
if nextGood == 1:
nextGood = 0
retval = retval + [(idType, int(token))]
return retval
# Set up a plot
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Pseudocolor, hgslice)
DrawPlots()
# Do picks on the ids that were returned by MinMax.
for ids in GetMinMaxIds():
idType = ids[0]
id = ids[1]
if idType == 0:
PickByNode(id)
else:
PickByZone(id)
2.8
Subsetting
VisIt allows the user to turn off subsets of the visualization using a number of different
methods. Databases can be divided up any number of ways: domains, materials, etc. This
section provides some details on how to remove materials and domains from your
visualization.
20
Quick Recipes
2.8.1
2.9
View
Setting up the view in your Python script is one of the most important things you can do to
ensure the quality of your visualization because the view concentrates attention on an
object or inferest. VisIt provides different methods for setting the view, depending on the
dimensionality of the plots in the visualization window but despite differences in how the
view is set, the general procedure is basically the same.
2.9.1
21
Quick Recipes
The 3D view is much more complex than the 2D view. For information on the actual
meaning of the fields in the View3DAttributes object, refer to page 210 or the VisIt Users
Manual. VisIt automatically computes a suitable view for 3D objects and it is best to
initialize new View3DAttributes objects using the GetView3D function so most of the
fields will already be initialized. The best way to get new views to use in a script is to
interactively create the plot and repeatedly call GetView3D() after you finish rotating the
plots with the mouse. You can paste the printed view information into your script and
modify it slightly to create sophisticated view transitions.
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Pseudocolor, hardyglobal)
AddPlot(Mesh, Mesh)
DrawPlots()
v = GetView3D()
print The view is: , v
v.viewNormal = (-0.571619, 0.405393, 0.713378)
v.viewUp = (0.308049, 0.911853, -0.271346)
SetView3D(v)
2.9.3
Flying around plots is a commonly requested feature when making movies. Fortunately,
this is easy to script. The basic method used for flying around plots is interpolating the
view. VisIt provides a number of functions that can interpolate View2DAttributes and
View3DAttributes objects. The most useful of these functions is the EvalCubicSpline
function. The EvalCubicSpline function uses piece-wise cubic polynomials to smoothly
interpolate between a tuple of N like items. Scripting smooth view changes using
EvalCubicSpline is rather like keyframing in that you have a set of views that are mapped
to some distance along the parameterized space [0., 1.]. When the parameterized space is
sampled with some number of samples, VisIt calculates the view for the specified
parameter value and returns a smoothly interpolated view. One benefit over keyframing, in
this case, is that you can use cubic interpolation whereas VisIts keyframing mode
currently uses linear interpolation.
# Do a pseudocolor plot of u.
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
DrawPlots()
# Create the control points for the views.
c0 = View3DAttributes()
c0.viewNormal = (0, 0, 1)
c0.focus = (0, 0, 0)
c0.viewUp = (0, 1, 0)
22
Quick Recipes
c0.viewAngle = 30
c0.parallelScale = 17.3205
c0.nearPlane = 17.3205
c0.farPlane = 81.9615
c0.perspective = 1
c1 = View3DAttributes()
c1.viewNormal = (-0.499159, 0.475135, 0.724629)
c1.focus = (0, 0, 0)
c1.viewUp = (0.196284, 0.876524, -0.439521)
c1.viewAngle = 30
c1.parallelScale = 14.0932
c1.nearPlane = 15.276
c1.farPlane = 69.917
c1.perspective = 1
c2 = View3DAttributes()
c2.viewNormal = (-0.522881, 0.831168, -0.189092)
c2.focus = (0, 0, 0)
c2.viewUp = (0.783763, 0.556011, 0.27671)
c2.viewAngle = 30
c2.parallelScale = 11.3107
c2.nearPlane = 14.8914
c2.farPlane = 59.5324
c2.perspective = 1
c3 = View3DAttributes()
c3.viewNormal = (-0.438771, 0.523661, -0.730246)
c3.focus = (0, 0, 0)
c3.viewUp = (-0.0199911, 0.80676, 0.590541)
c3.viewAngle = 30
c3.parallelScale = 8.28257
c3.nearPlane = 3.5905
c3.farPlane = 48.2315
c3.perspective = 1
c4 = View3DAttributes()
c4.viewNormal = (0.286142, -0.342802, -0.894768)
c4.focus = (0, 0, 0)
c4.viewUp = (-0.0382056, 0.928989, -0.36813)
c4.viewAngle = 30
c4.parallelScale = 10.4152
c4.nearPlane = 1.5495
c4.farPlane = 56.1905
c4.perspective = 1
c5 = View3DAttributes()
c5.viewNormal = (0.974296, -0.223599, -0.0274086)
c5.focus = (0, 0, 0)
c5.viewUp = (0.222245, 0.97394, -0.0452541)
c5.viewAngle = 30
c5.parallelScale = 1.1052
c5.nearPlane = 24.1248
c5.farPlane = 58.7658
23
Quick Recipes
c5.perspective = 1
c6 = c0
# Create a tuple of camera values and x values. The x values
# determine where in [0,1] the control points occur.
cpts = (c0, c1, c2, c3, c4, c5, c6)
x=[]
for i in range(7):
x = x + [float(i) / float(6.)]
# Animate the view using EvalCubicSpline.
nsteps = 100
for i in range(nsteps):
t = float(i) / float(nsteps - 1)
c = EvalCubicSpline(t, x, cpts)
c.nearPlane = -34.461
c.farPlane = 34.461
SetView3D(c)
24
Chapter 4
3.0
Function Reference
Overview
This chapter describes all of the non-plugin functions that are built into the VisIt Python
interface. Functions that are added by plugins and functions that exist only to create
extension objects are covered in the later object references; not this chapter.
There are many functions in the VisIt Python Interface because VisIt provides a lot of
capabilities for visualizing data. Each function is described in detail so you will know
what each function does and also what arguments to pass. Most functions also include a
brief Python script that demonstrates how to use the function in context.
VisIts Python Interface is implemented as a Python extension module, which is a library
that can be loaded by the Python interpreter at runtime. All of the functions in this chapter
are part of the visit module namespace since modules all have their own namespace. If
you use the Python import directive to import the VisIt module into a Python interpreter,
you must preface each call to a VisIt function with the module name. For example, if you
wanted to call the OpenDatabase function, you would type:
visit.OpenDatabase(mydatabase). If you use the VisIt Command Line Interface (CLI),
which can be invoked by typing visit -cli on the command line, all of the functions are
added to the global namespace and prefacing functions with the name of the visit module
is not necessary.
The first functions descibed in this chapter are most directly related to importing the VisIt
module into a Python interpreter. The functions allow you to specify the debug level, add
arguments, launch, and close the modules connection to VisIts viewer. If you intend to
always use VisIt functions from within VisIts CLI, then you can skip to page 32 to see the
first function that is not associated with setting properties for the VisIt module.
25
AddArgument
A string object that is added to the viewers command line argument list.
Returns:
AddArgument does not return a value.
Description:
The AddArgument function is used to add extra command line arguments to VisIts viewer. This is
only useful when VisIts Python interface is imported into a stand-alone Python interpreter
because the AddArgument function must be called before the viewer is launched. The AddArgument function has no effect when used in VisIts cli program because the viewer is automatically
launched before any commands are processed.
Example:
import visit
visit.AddArgument(-nowin) # Add the -nowin argument to the viewer.
26
Close
27
Launch
Example 2:
import visit
visit.AddArgument(-nowin)
visit.Launch()
28
LocalNamespace
LocalNamespaceTells the VisIt module to import plugins into the global namespace.
Synopsis:
LocalNamespace()
Arguments:
none
Returns:
The LocalNamespace function does not return a value.
Description:
The LocalNamespace function tells the VisIt module to add plugin functions to the global
namespace when the VisIt module is imported into a stand-alone Python interpreter. This is the
default behavior when using VisIts cli program.
Example:
import visit
visit.LocalNamespace()
visit.Launch()
29
DebugLevel
An integer in the range [1,5]. A value of 1 is a low debug level, which should be
used to produce little output while a value of 5 should produce a lot of debug
output.
Returns:
The GetDebugLevel function returns the debug level of the VisIt module.
Description:
The GetDebugLevel and SetDebugLevel functions are used when debugging VisIt Python scripts.
The SetDebugLevel function sets the debug level for VisIts viewer thus it must be called before a
Launch method. The debug level determines how much detail is written to VisIts execution logs
when it executes. The GetDebugLevel function can be used in Python scripts to alter the behavior
of the script. For instance, the debug level can be used to selectively print values to the console.
Example:
% visit -cli -debug 2
print VisIts debug level is: %d % GetDebugLevel()
30
Version
31
ActivateDatabase
Returns:
ActivateDatabase returns 1 on success and 0 on failure.
Description:
The ActivateDatabase function is used to set the active database to a database that has been previously opened. The ActivateDatabase function only works when you are using it to activate a database that you have previously opened. You do not need to use this function unless you frequently
toggle between more than one database when making plots or changing time states. While the
OpenDatabase function on page 117 can also be used to set the active database, the ActivateDatabase function does not have any side effects that would cause the time state for the new active database to be changed.
Example:
% visit -cli
dbs = (/usr/gapps/visit/data/wave.visit, \
/usr/gapps/visit/data/curv3d.silo)
OpenDatabase(dbs[0], 17)
AddPlot(Pseudocolor, u)
DrawPlots()
OpenDatabase(dbs[1])
AddPlot(Pseudocolor, u)
DrawPlots()
# Lets add another plot from the first database.
ActivateDatabase(dbs[0])
AddPlot(Mesh, quadmesh)
DrawPlots()
32
AddOperator
all
This is an optional integer argument that applies the operator to all plots if the
value of the argument is not zero.
Returns:
The AddOperator function returns an integer value of 1 for success and 0 for failure.
Description:
The AddOperator function adds a VisIt operator to the selected plots. The operator argument is a
string containing the name of the operator to be added to the selected plots. The operatore name
must be a valid operator plugin name that is a member of the tuple returned by the OperatorPlugins
function (see page 120). The all argument is an integer that determines whether or not the operator
is applied to all plots. If the all argument is not provided, the operator is only added to selected
plots. Once the AddOperator function is called, the desired operator is added to all selected plots
unless the all argument is a non-zero value. When the all argument is a non-zero value, the operator is applied to all plots regardless of whether or not they are selected. Operator attributes are set
through the SetOperatorOptions function.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
AddPlot(Mesh, mesh1)
AddOperator(Slice, 1) # Slice both plots
DrawPlots()
33
AddPlot
variableName This is a string containing a valid variable name for the open database.
Returns:
The AddPlot function returns an integer value of 1 for success and 0 for failure.
Description:
The AddPlot function creates a new plot of the specified type using a variable from the open database. The plotType argument is a string that contains the name of a valid plot plugin type which
must be a member of the string tuple that is returned by the PlotPlugins function (see page 127).
The variableName argument is a string that contains the name of a variable in the open database.
After the AddPlot function is called, a new plot is created and it is made the sole active plot.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Subset, mat1) # Create a subset plot
DrawPlots()
34
AddWindow
35
AlterDatabaseCorrelation
The name argument must be a string object containing the name of the database
correlation to be altered.
databases
The databases argument must be a tuple or list of strings containing the fully
qualified database names to be used in the database correlation.
method
Returns:
The AlterDatabaseCorrelation function returns 1 on success and 0 on failure.
Description:
The AlterDatabaseCorrelation method alters an existing database correlation. A database correlation is a VisIt construct that relates the time states for two or more databases in some way. You
would use the AlterDatabaseCorrelation function if you wanted to change the list of databases
used in a database correlation or if you wanted to change how the databases are related - the correlation method. The name argument is a string that is the name of the database correlation to be
altered. If the name that you pass is not a valid database correlation then the AlterDatabaseCorrelation function fails. The databases argument is a list or tuple of string objects containing the fullyqualified (host:/path/filename) names of the databases to be involved in the database query. The
method argument allows you to specify a database correlation method.
Correlation method
Value
IndexForIndexCorrelation
StretchedIndexCorrelation
TimeCorrelation
CycleCorrelation
dbs = (/usr/gapps/visit/data/wave.visit, \
/usr/gapps/visit/data/wave*.silo database)
OpenDatabase(dbs[0])
AddPlot(Pseudocolor, pressure)
OpenDatabase(dbs[1])
AddPlot(Pseudocolor, d)
# VisIt created an index for index database correlation but we
# want a cycle correlation.
AlterDatabaseCorrelation(Correlation01, dbs, 3)
36
ChangeActivePlotsVar
37
CheckForNewStates
The name argument must be a string that contains the name of a database that
has been opened previously.
Returns:
The CheckForNewStates function returns 1 for success and 0 for failure.
Description:
Calculations are often run at the same time as some of the preliminary visualization work is being
performed. That said, you might be visualizing the leading time states of a database that is still
being created. If you want to force VisIt to add any new time states that were added since you
opened the database, you can use the CheckForNewStates function. The name argument must contain the name of a database that has been opened before.
Example:
% visit -cli
db = /usr/gapps/visit/data/wave*.silo database
OpenDatabase(db)
AddPlot(Pseudocolor, pressure)
DrawPlots()
SetTimeSliderState(TimeSliderGetNStates() - 1)
# More files appear on disk
CheckForNewStates(db)
SetTimeSliderState(TimeSliderGetNStates() - 1)
38
ChooseCenterOfRotation
screenY
Returns:
The ChooseCenterOfRotation function returns 1 if successful and 0 if it fails.
Description:
The ChooseCenterOfRotation function allows you to pick a new center of rotation, which is the
point about which plots are rotated when you interactively rotate plots. The function can either
take zero arguments, in which case you must interactively pick on plots, or it can take two arguments that correspond to the X and Y coordinates of the desired pick point in normalized screen
space. When using the two argument version of the ChooseCenterOfRotation function, the X and
Y values are floating point values in the range [0,1]. If the ChooseCenterOfRotation function is
able to actually pick on plots, yes there must be plots in the vis window, then the center of rotation
is updated and the new value is printed to the console.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlots(Pseudocolor, u)
DrawPlots()
# Interactively choose the center of rotation
ChooseCenterOfRotation()
# Choose a center of rotation using normalized screen
# coordinates and print the value.
ResetView()
ChooseCenterOfRotation(0.5, 0.3)
print The new center of rotation is:, GetView3D().centerOfRotation
39
ClearCache
simulation
Returns:
The ClearCache and ClearCacheForAllEngines functions return 1 on success and 0 on failure.
Description:
Sometimes during extended VisIt runs, you might want to periodically clear the compute engines
network cache to reduce the amount of memory being used by the compute engine. Clearing the
network cache is also useful when you want to change what the compute engine is working on. For
example, you might process a large database and then decide to process another large database.
Clearing the network cache beforehand will free up more resources for the compute engine so it
can more efficiently process the new database. The host argument is a string object containing the
name of the computer on which the compute engine is running. The simulation argument is
optional and only applies to when you want to instruct a simulation that is acting as a VisIt compute engine to clear its network cache. If you want to tell more than one compute engine to clear
its cache without having to call ClearCache multiple times, you can use the ClearCacheForAllEngines function.
Example:
%visit -cli
OpenDatabase(localhost:very_large_database)
# Do a lot of work
ClearCache(localhost)
OpenDatabase(localhost:another_large_database)
# Do more work
OpenDatabase(remotehost:yet_another_database)
# Do more work
ClearCacheForAllEngines()
40
Clear
41
ClearPickPoints
42
ClearReferenceLines
43
ClearViewKeyframes
44
CloneWindow
CloneWindowCreates a new window that has the same plots, annotations, lights, and view
as the active window.
Synopsis:
CloneWindow() -> integer
Returns:
The CloneWindow function returns an integer value of 1 for success and 0 for failure.
Description:
The CloneWindow function tells the viewer to create a new window, based on the active window,
that contains the same plots, annotations, lights, and view as the active window. This function is
useful for when you have a window set up like you want and then want to do the same thing in
another window using a different database. You can first clone the window and then replace the
database.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
DrawPlots()
v = ViewAttributes()
v.camera = (-0.505893, 0.32034, 0.800909)
v.viewUp = (0.1314, 0.946269, -0.295482)
v.parallelScale = 14.5472
v.nearPlane = -34.641
v.farPlane = 34.641
v.perspective = 1
SetView3D() # Set the view
a = AnnotationAttributes()
a.backgroundColor = (0, 0, 255, 255)
SetAnnotationAttributes(a) # Set the annotation properties
CloneWindow() # Create a clone of the active window
DrawPlots() # Make the new window draw its plots
45
CloseComputeEngine
simulation
Returns:
The CloseComputeEngine function returns an integer value of 1 for success and 0 for failure.
Description:
The CloseComputeEngine function tells the viewer to close the compute engine running a specified host. The hostName argument is a string that contains the name of the computer where the
compute engine is running. The hostName argument can also be the name localhost if you want
to close the compute engine on the local machine without having to specify its name. It is not necessary to provide the hostName argument. If the argument is omitted, the first compute engine in
the engine list will be closed. The simulation argument can be provided if you want to close a connection to a simulation that is acting as a VisIt compute engine. A compute engine can be launched
again by creating a plot or by calling the OpenComputeEngine function.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo) # Launches an engine
AddPlot(Pseudocolor, u)
DrawPlots()
CloseComputeEngine() # Close the compute engine
46
CloseDatabase
CloseDatabaseCloses the specified database and frees up resources associated with it.
Synopsis:
CloseDatabase(name) -> integer
Arguments:
name
Returns:
The CloseDatabase function returns 1 on success and 0 on failure.
Description:
The CloseDatabase function is used to close a specified database and free all resources that were
devoted to keeping the database open. This function has an effect similar to ClearCache (see
page 40) but it does more in that in addition to clearing the compute engines cache, which it only
does for the specified database, it also removes all references to the specified database from tables
of cached metadata, etc. Note that the CloseDatabase function will fail and the database will not be
closed if any plots reference the specified database.
Example:
% visit -cli
db = /usr/gapps/visit/data/globe.silo
OpenDatabase(db)
AddPlot(Pseudocolor, u)
DrawPlots()
print This wont work: retval = %d % CloseDatabase(db)
DeleteAllPlots()
print Now it works: retval = %d % CloseDatabase(db)
47
ColorTableNames
48
Copy
dest
Returns:
The Copy functions return an integer value of 1 for success and 0 for failure.
Description:
The Copy functions copy attributes from one visualization window to another visualization window. The CopyAnnotationsToWindow function copies the annotations from a source visualization
window to a destination visualization window while the CopyLightingAttributes function copies
lighting and the CopyViewToWindow function copies the view. The CopyPlotsToWindow function copies the plots from one visualization window to another visualization window but does not
also force plots to generate so after copying plots with the CopyPlotsToWindow function, you
should also call the DrawPlots function.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
DrawPlots()
AddWindow()
SetActiveWindow(2)
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Mesh, mesh1)
# Copy window 1s Pseudocolor plot to window 2.
CopyPlotsToWindow(1, 2)
DrawPlots() # Window 2 will have 2 plots
# Spin the plots around in window 2 using the mouse.
CopyViewToWindow(2, 1) # Copy window 2s view to window 1.
49
CreateAnnotationObject
Returns:
CreateAnnotationObject is a factory function that creates annotation objects of different types. The
return value, if a valid annotation type is provided, is an annotation object. If the function fails,
VisItException is raised.
Description:
CreateAnnotationObject is a factory function that creates different kinds of annotation objects.
The annotType argument is a string containing the name of the type of annotation object to create.
Each type of annotation object has different properties that can be set. Setting the different properties of an Annotation objects directly modifes annotations in the vis window. Currently there are 2
types of annotation objects:
Annotation type
String
2D text annotation
Text2D
TimeSlid
er
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/wave.visit, 17)
AddPlot(Pseudocolor, pressure)
DrawPlots()
slider = CreateAnnotationObject(TimeSlider)
print slider
slider.startColor = (255,0,0,255)
slider.endColor = (255,255,0,255)
50
CreateDatabaseCorrelation
databases
Tuple or list of string objects containing the names of the databases to involve in
the database correlation.
method
Returns:
The CreateDatabaseCorrelation function returns 1 on success and 0 on failure.
Description:
The CreateDatabaseCorrelation function creates a database correlation, which is a VisIt construct
that relates the time states for two or more databases in some way. You would use the CreateDatabaseCorrelation function if you wanted to put plots from more than one time-varying database in
the same vis window and then move them both through time in some synchronized way. The name
argument is a string that is the name of the database correlation to be created. You will use the
name of the database correlation to set the active time slider later so that you can change time
states. The databases argument is a list or tuple of string objects containing the fully-qualified
(host:/path/filename) names of the databases to be involved in the database query. The method
argument allows you to specify a database correlation method.
Correlation method
Value
IndexForIndexCorrelation
StretchedIndexCorrelation
TimeCorrelation
CycleCorrelation
Each database correlation has its own time slider that can be used to set the time state of databases
that are part of a database correlation. Individual time-varying databases have their own trivial
database correlation, consisting of only 1 database. When you call the CreateDatabaseCorrelation
function, VisIt creates a new time slider with the same name as the database correlation and makes
it be the active time slider.
Example:
% visit -cli
dbs = (/usr/gapps/visit/data/dbA00.pdb,
/usr/gapps/visit/data/dbB00.pdb)
OpenDatabase(dbs[0])
51
CreateDatabaseCorrelation
AddPlot(FilledBoundary, material(mesh))
OpenDatabase(dbs[1])
AddPlot(FilledBoundary, material(mesh))
DrawPlots()
CreateDatabaseCorrelation(common, dbs, 1)
# Creating a new database correlation also creates a new time
# slider and makes it be active.
w = GetWindowInformation()
print Active time slider: %s % w.timeSliders[w.activeTimeSlider]
# Animate through time using the common database correlations
# time slider.
for i in range(TimeSliderGetNStates()):
SetTimeSliderState(i)
52
DefineExpression
Returns:
The DefineExpression functions do not return a value.
Description:
The DefineScalarExpression function creates a new scalar variable based on other variables from
the open database. Likewise, the DefineMaterialExpression function creates new material variables, DefineMeshExpression creates new mesh variables, DefineSpeciesExpression creates new
species variables, and DefineVectorExpression creates new vector variables. Expression variables
can be plotted like any other variable. The variableName argument is a string that contains the
name of the new variable. The expression argument is a string that contains the definition of the
new variable in terms of math operators and pre-existing variable names. Reference the VisIt
Users Manual if you want more information on creating expressions, such as expression syntax,
or a list of built-in expression functions.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
DefineScalarExpression(myvar, sin(u) + cos(w))
# Plot the scalar expression variable.
AddPlot(Pseudocolor, myvar)
DrawPlots()
# Plot a vector expression variable.
DefineVectorExpression(myvec, {u,v,w})
AddPlot(Vector, myvec)
DrawPlots()
53
DeIconifyAllWindows
54
Delete
55
DeleteDatabaseCorrelation
Returns:
The DeleteDatabaseCorrelation function returns 1 on success and 0 on failure.
Description:
The DeleteDatabaseCorrelation function deletes a specific database correlation and its associated
time slider. If you delete a database correlation whose time slider is being used for the current time
slider, the time slider will be reset to the time slider of the next best suited database correlation.
You can use the DeleteDatabaseCorrelation function to remove database correlations that you no
longer need such as when you choose to examine databases that have nothing to do with your current databases.
Example:
% visit -cli
dbs = (dbA00.pdb, dbB00.pdb)
OpenDatabase(dbs[0])
AddPlot(FilledBoundary, material(mesh))
OpenDatabase(dbs[1])
AddPlot(FilledBoundary, material(mesh))
DrawPlots()
CreateDatabaseCorrelation(common, dbs, 1)
SetTimeSliderState(10)
DeleteAllPlots()
DeleteDatabaseCorrelation(common)
CloseDatabase(dbs[0])
CloseDatabase(dbs[1])
56
DeleteExpression
57
DeletePlotDatabaseKeyframe
frame
Returns:
DeletePlotDatabaseKeyframe does not return a value.
Description:
The DeletePlotDatabaseKeyframe function removes a database keyframe from a specific plot. A
database keyframe represents the database time state that will be used at a given animation frame
when VisIts keyframing mode is enabled. The plotIndex argument is a zero-based integer that is
used to identify a plot in the plot list. The frame argument is a zero-based integer that is used to
identify the frame at which a database keyframe is to be removed for the specified plot.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/wave.visit)
k = GetKeyframeAttributes()
k.enabled,k.nFrames,k.nFramesWasUserSet = 1,20,1
SetKeyframeAttributes(k)
AddPlot(Pseudocolor, pressure)
SetPlotDatabaseState(0, 0, 60)
# Repeat time state 60 for the first few animation frames by adding a
keyframe at frame 3.
SetPlotDatabaseState(0, 3, 60)
SetPlotDatabaseState(0, 19, 0)
DrawPlots()
ListPlots()
# Delete the database keyframe at frame 3.
DeletePlotDatabaseKeyframe(0, 3)
ListPlots()
58
DeletePlotKeyframe
frame
Returns:
DeletePlotKeyframe does not return a value.
Description:
The DeletePlotKeyframe function removes a plot keyframe from a specific plot. A plot keyframe is
the set of plot attributes at a specified frame. Plot keyframes are used to determine what plot
attributes will be used at a given animation frame when VisIts keyframing mode is enabled. The
plotIndex argument is a zero-based integer that is used to identify a plot in the plot list. The frame
argument is a zero-based integer that is used to identify the frame at which a keyframe is to be
removed.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/wave.visit)
k = GetKeyframeAttributes()
k.enabled,k.nFrames,k.nFramesWasUserSet = 1,20,1
SetKeyframeAttributes(k)
AddPlot(Pseudocolor, pressure)
# Set up plot keyframes so the Pseudocolor plots min will change
# over time.
p0 = PseudocolorAttributes()
p0.minFlag,p0.min = 1,0.0
p1 = PseudocolorAttributes()
p1.minFlag,p1.min = 1, 0.5
SetPlotOptions(p0)
SetTimeSliderState(19)
SetPlotOptions(p1)
SetTimeSliderState(0)
DrawPlots()
ListPlots()
# Iterate over all animation frames and wrap around to the first one.
for i in list(range(TimeSliderGetNStates())) + [0]:
SetTimeSliderState(i)
# Delete the plot keyframe at frame 19 so the min wont
59
DeletePlotKeyframe
# change anymore.
DeletePlotKeyframe(19)
ListPlots()
SetTimeSliderState(10)
60
DeleteViewKeyframe
Returns:
DeleteViewKeyframe returns 1 on success and 0 on failure.
Description:
The DeleteViewKeyframe function removes a view keyframe at a specified frame. View keyframes
are used to determine what view will be used at a given animation frame when VisIts keyframing
mode is enabled. The frame argument is a zero-based integer that is used to identify the frame at
which a keyframe is to be removed.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
k = KeyframeAttributes()
k.enabled, k.nFrames, k.nFramesWasUserSet = 1,10,1
SetKeyframeAttributes(k)
AddPlot(Pseudocolor, u)
DrawPlots()
# Set some view keyframes
SetViewKeyframe()
v1 = GetView3D()
v1.viewNormal = (-0.66609, 0.337227, 0.665283)
v1.viewUp = (0.157431, 0.935425, -0.316537)
SetView3D(v1)
SetTimeSliderState(9)
SetViewKeyframe()
ToggleCameraViewMode()
# Iterate over the animation frames to watch the view change.
for i in list(range(10)) + [0]:
SetTimeSliderState(i)
# Delete the last view keyframe, which is on frame 9.
DeleteViewKeyframe(9)
# Iterate over the animation frames again. The view should stay
# the same.
for i in range(10):
SetTimeSliderState(i)
61
DeleteWindow
62
DemoteOperator
applyAll
An integer flag that causes all plots in the plot list to be affected when it is nonzero.
Returns:
DemoteOperator returns 1 on success and 0 on failure.
Description:
The DemoteOperator function moves an operator closer to the database in the visualization pipeline. This allows you to change the order of operators that have been applied to a plot without having to remove them from the plot. For example, consider moving a Slice to before a Reflect
operator when it had been the other way around. Changing the order of operators can result in
vastly different results for a plot. The opposite function is PromoteOperator (see page 129).
Example:
% visit -cli
OpenDatabase("/usr/gapps/visit/data/noise.silo")
AddPlot("Pseudocolor", "hardyglobal")
AddOperator(Slice)
s = SliceAttributes()
s.project2d = 0
s.originPoint = (0,5,0)
s.originType=s.Point
s.normal = (0,1,0)
s.upAxis = (-1,0,0)
SetOperatorOptions(s)
AddOperator("Reflect")
DrawPlots()
# Now reflect before slicing. Well only get 1 slice plane
# instead of 2.
DemoteOperator(1)
DrawPlots()
63
DisableRedraw
64
DrawPlots
65
EnableTool
EnableToolSets the enabled state of an interactive tool in the active visualization window.
Synopsis:
EnabledTool(toolIndex, activeFlag)
Arguments:
toolIndex
activeFlag
Returns:
The EnableTool function returns 1 on success and 0 on failure.
Description:
The EnableTool function is used to set the enabled state of an interactive tool in the active visualization window. The toolIndex argument is an integer index that corresponds to a certain tool. The
activeFlag argument is an integer value (0 or 1) that indicates whether to turn the tool on or off.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
DrawPlots()
EnableTool(0, 1) # Turn on the line tool.
EnableTool(1,1) # Turn on the plane tool.
EnableTool(2,1) # Turn on the sphere tool.
EnableTool(2,0) # Turn off the sphere tool.
66
EvalCubic
A floating point number in the range [0., 1.] that represents the distance from c0
to c3.
c0
The first control point. f(0) = c0. Any object that can be used in an arithmetic
expression can be passed for c0.
c1
The second control point. Any object that can be used in an arithmetic
expression can be passed for c1.
c2
The third control point. Any object that can be used in an arithmetic expression
can be passed for c2.
c3
The last control point. f(1) = c3. Any object that can be used in an arithmetic
expression can be passed for c3.
Returns:
The EvalCubic function returns the interpolated value for t taking into account the control points
that were passed in.
Description:
The EvalCubic function takes in four objects and blends them using a cubic polynomial and
returns the blended value.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
DrawPlots()
v0 = GetView3D()
# rotate the plots
v1 = GetView3D()
# rotate the plots again.
v2 = GetView3D()
# rotate the plots one last time.
v3 = GetView3D()
# Fly around the plots using the views that have been specified.
nSteps = 100
for i in range(nSteps):
t = float(i) / float(nSteps - 1)
newView = EvalCubic(t, v0, v1, v2, v3)
SetView3D(newView)
67
EvalCubicSpline
A floating point value in the range [0., 1.] that represents the distance from the
first control point to the last control point.
weights
A tuple of N floating point values in the range [0., 1.] that represent how far
along in parameterized space, the values will be located.
values
Returns:
The EvalCubicSpline function returns the interpolated value for t considering the objects that were
passed in.
Description:
The EvalCubicSpline function takes in N objects to be blended and blends them using piece-wise
cubic polynomials and returns the blended value. For an example, see page 22.
68
EvalLinear
A floating point value in the range [0., 1.] that represents the distance between
the first and last control point in parameterized space.
value1
value2
Returns:
The EvalLinear function returns an interpolated value for t based on the objects that were passed
in.
Description:
The EvalLinear function linearly interpolates between two values and returns the result.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
DrawPlots()
c0 = GetView3D()
c1 = GetView3D()
c1.viewNormal = (-0.499159, 0.475135, 0.724629)
c1.viewUp = (0.196284, 0.876524, -0.439521)
nSteps = 100
for i in range(nSteps):
t = float(i) / float(nSteps - 1)
v = EvalLinear(t, c0, c1)
SetView3D(v)
69
EvalQuadratic
A floating point number in the range [0., 1.] that represents the distance from c0
to c3.
c0
The first control point. f(0) = c0. Any object that can be used in an arithmetic
expression can be passed for c0.
c1
The second control point. Any object that can be used in an arithmetic
expression can be passed for c1.
c2
The last control point. f(1) = c2. Any object that can be used in an arithmetic
expression can be passed for c2.
Returns:
The EvalQuadratic function returns the interpolated value for t taking into account the control
points that were passed in.
Description:
The EvalQuadratic function takes in four objects and blends them using a cubic polynomial and
returns the blended value.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
DrawPlots()
v0 = GetView3D()
# rotate the plots
v1 = GetView3D()
# rotate the plots one last time.
v2 = GetView3D()
# Fly around the plots using the views that have been specified.
nSteps = 100
for i in range(nSteps):
t = float(i) / float(nSteps - 1)
newView = EvalQuadratic(t, v0, v1, v2)
SetView3D(newView)
70
Expressions
71
GetActiveColorTable
72
GetActiveTimeSlider
73
GetAnimationTimeout
74
GetAnimationNumStates
75
GetAnnotationAttributes
76
GetAnnotationObject
Returns:
GetAnnotationObject returns a reference to an annotation object that was created using the CreateAnnotationObject function.
Description:
GetAnnotationObject returns a reference to an annotation object that was created using the CreateAnnotationObject function (see page 50). The index argument is a zero-based integer that specifies
the index of the object for which we want to return another reference. This function is not currently
necessary unless the annotation object that you used to create an annotation has gone out of scope
and you need to create another reference to the object to set its properties.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/wave.visit)
AddPlot(Pseudocolor, pressure)
DrawPlots()
a = CreateAnnotationObject(TimeSlider)
ref = GetAnnotationObject(0)
print ref
77
GetDatabaseNStates
78
GetDomains
GetDomainsReturns a tuple containing the names of all of the domain subsets for the
active plot.
Synopsis:
GetDomains() -> tuple of strings
Returns:
GetDomains returns a tuple of strings.
Description:
GetDomains returns a tuple containing the names of all of the domain subsets for a plot that was
created using a database with multiple domains. This function can be used in specialized logic that
iterates over domains to turn them on or off in some programmed way.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/multi_ucd3d.silo)
AddPlot(Pseudocolor, u)
DrawPlots()
doms = GetDomains()
print doms
# Turn off all but the last domain, one after the other.
for d in doms[:-1]:
TurnDomainsOff(d)
79
GetEngineList
80
GetGlobalAttributes
81
GetGlobalLineoutAttributes
82
GetInteractorAttributes
83
GetKeyframeAttributes
84
GetLastError
GetLastErrorReturns a string containing the last error message that VisIt issued.
Synopsis:
GetLastError() -> string
Returns:
GetLastError returns a string containing the last error message that VisIt issued.
Description:
The GetLastError function returns a string containing the last error message that VisIt issued.
Example:
% visit -cli
OpenDatabase(/this/database/does/not/exist)
print VisIt Error: %s % GetLastError()
85
GetLight
A zero-based integer index into the light list. Index can be in the range [0,7].
Returns:
GetLight returns a LightAttributes object.
Description:
The GetLight function returns a LightAttributes object containing the attributes for a specific light.
You can use the LightAttributes object that GetLight returns to set light properties and then you
can pass the object to SetLight to make VisIt use the light properties that youve set.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot("Pseudocolor", "w")
p = PseudocolorAttributes()
p.colorTableName = xray
SetPlotOptions(p)
DrawPlots()
InvertBackgroundColor()
light = GetLight(0)
print light
light.enabledFlag = 1
light.direction = (0,-1,0)
light.color = (255,0,0,255)
SetLight(0, light)
light.color,light.direction = (0,255,0,255), (-1,0,0)
SetLight(1, light)
86
GetLocal
87
GetMaterialAttributes
88
GetMaterials
GetMaterialsReturns a string tuple of material names for the current plots database.
Synopsis:
GetMaterials() -> tuple of strings
Returns:
The GetMaterials function returns a tuple of strings.
Description:
The GetMaterials function returns a tuple of strings containing the names of the available materials
for the current plots database. Note that the active plots database must have materials for this
function to return a tuple that has any string objects in it. Also, you must have at least one plot. You
can use the materials returned by the GetMaterials function for a variety of purposes including
turning materials on or off.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/allinone00.pdb)
AddPlot(Pseudocolor, mesh/mixvar)
DrawPlots()
mats = GetMaterials()
for m in mats[:-1]:
TurnMaterialOff(m)
89
GetNumPlots
90
GetPickAttributes
91
GetPickOutput
92
GetPipelineCachingMode
93
GetQueryOutput
94
GetQueryOverTimeAttributes
95
GetRenderingAttributes
96
GetSaveWindowAttributes
97
GetTimeSliders
98
GetView
99
GetWindowInformation
100
HideActivePlots
101
HideToolbars
An integer value that tells VisIt to hide the toolbars for all windows when it is
non-zero.
Returns:
The HideToolbars function returns 1 on success and 0 on failure.
Description:
The HideToolbars function tells VisIt to hide the toolbars for the active visualization window or
for all visualization windows when the optional allWindows argument is provided and is set to a
non-zero value.
Example:
% visit -cli
SetWindowLayout(4)
HideToolbars()
ShowToolbars()
# Hide the toolbars for all windows.
HideToolbars(1)
102
IconifyAllWindows
103
InvertBackgroundColor
104
Lineout
LineoutPerforms a lineout.
Synopsis:
Lineout(start,
Lineout(start,
Lineout(start,
Lineout(start,
end)
end,
end,
end,
-> integer
variables) -> integer
samples) -> integer
variables, samples) -> integer
Arguments:
start
end
variables
A tuple of strings containing the names of the variables for which lineouts
should be created.
samples
An integer value containing the number of sample points along the lineout.
Returns:
The Lineout function returns 1 on success and 0 on failure.
Description:
The Lineout function extracts data along a given line segment and creates curves from it in a new
visualization window. The start argument is a tuple of numbers that make up the coordinate of the
lineouts starting location. The end argument is a tuple of numbers that make up the coordinate of
the lineouts ending location. The optional variables argument is a tuple of strings that contain the
variables that should be sampled to create lineouts. The optional samples argument is used to
determine the number of sample points that should be taken along the specified line. If the samples
argument is not provided then VisIt will sample the mesh where it intersects the specified line
instead of using the number of samples to compute a list of points to sample.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/rect2d.silo)
AddPlot(Pseudocolor, ascii)
DrawPlots()
Lineout((0.2,0.2), (0.8,1.2))
Lineout((0.2,1.2), (0.8,0.2), (default, d, u))
Lineout((0.6, 0.1), (0.6, 1.2), 100)
105
Lineout
106
ListPlots
107
LongFileName
Returns:
The LongFileName function returns a string.
Notes:
This function returns the input argument unless you are on the Windows platform.
Description:
On Windows, filenames can have two different sizes: traditional 8.3 format, and long format. The
long format, which lets you name files whatever you want, is implemented using the traditional 8.3
format under the covers. Sometimes filenames are given to VisIt in the traditional 8.3 format and
must be expanded to long format before it is possible to open them. If you ever find that you need
to do this conversion, such as when you process command line arguments, then you can use the
LongFileName function to return the longer filename.
108
MovePlotDatabaseKeyframe
oldFrame
newFrame
Returns:
MovePlotDatabaseKeyframe does not return a value.
Description:
MovePlotDatabaseKeyframe moves a database keyframe for a specified plot to a new animation
frame, which changes the list of database time states that are used for each animation frame when
VisIt is in keyframing mode.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/wave.visit)
k = GetKeyframeAttributes()
nFrames = 20
k.enabled, k.nFrames, k.nFramesWasUserSet = 1, nFrames, 1
AddPlot(Pseudocolor, pressure)
SetPlotFrameRange(0, 0, nFrames-1)
SetPlotDatabaseKeyframe(0, 0, 70)
SetPlotDatabaseKeyframe(0, nFrames/2, 35)
SetPlotDatabaseKeyframe(0, nFrames-1, 0)
DrawPlots()
for state in list(range(TimeSliderGetNStates())) + [0]:
SetTimeSliderState(state)
MovePlotDatabaseKeyframe(0, nFrames/2, nFrames/4)
for state in list(range(TimeSliderGetNStates())) + [0]:
SetTimeSliderState(state)
109
MovePlotKeyframe
oldFrame
newFrame
Returns:
MovePlotKeyframe does not return a value.
Description:
MovePlotKeyframe moves a keyframe for a specified plot to a new animation frame, which
changes the plot attributes that are used for each animation frame when VisIt is in keyframing
mode.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Contour, hgslice)
DrawPlots()
k = GetKeyframeAttributes()
nFrames = 20
k.enabled, k.nFrames, k.nFramesWasUserSet = 1, nFrames, 1
SetKeyframeAttributes(k)
SetPlotFrameRange(0, 0, nFrames-1)
c = ContourAttributes()
c.contourNLevels = 5
SetPlotOptions(c)
SetTimeSliderState(nFrames/2)
c.contourNLevels = 10
SetPlotOptions(c)
c.contourLevels = 25
SetTimeSliderState(nFrames-1)
SetPlotOptions(c)
for state in range(TimeSliderGetNStates()):
SetTimeSliderState(state)
SaveWindow()
temp = nFrames-2
110
MovePlotKeyframe
111
MoveViewKeyframe
newFrame
Returns:
MoveViewKeyframe returns 1 on success and 0 on failure.
Description:
MoveViewKeyframe moves a view keyframe to a new animation frame, which changes the view
that is used for each animation frame when VisIt is in keyframing mode.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Contour, hardyglobal)
DrawPlots()
k = GetKeyframeAttributes()
nFrames = 20
k.enabled, k.nFrames, k.nFramesWasUserSet = 1, nFrames, 1
SetKeyframeAttributes(k)
SetViewKeyframe()
SetTimeSliderState(nFrames/2)
v = GetView3d()
v.viewNormal = (-0.616518, 0.676972, 0.402014)
v.viewUp = (0.49808, 0.730785, -0.466764)
SetViewKeyframe()
SetTimeSliderState(0)
# Move the view keyframe to the last animation frame.
MoveViewKeyframe(nFrames/2, nFrames-1)
112
NodePick
A tuple of values that describe the coordinate of where we want to perform the
nodal pick.
variables
An optional tuple of strings containing the names of the variables for which we
want information. The tuple can contain the name default if you want
information for the plotted variable.
sx
A screen X location (in pixels) offset from the left side of the visualization
window.
sy
A screen Y location (in pixels) offset from the bottom of the visualization
window.
Returns:
The NodePick function prints pick information for the node closest to the specified point. The
point can be specified as a 2D or 3D point in world space or it can be specified as a pixel location
in screen space. If the point is specified as a pixel location then VisIt finds the node closest to a ray
that is projected into the mesh. Once the nodal pick has been calculated, you can use the GetPickOutput function to retrieve the printed pick output as a string which can be used for other purposes.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Pseudocolor, hgslice)
DrawPlots()
# Perform node pick in screen space
NodePick(300,300)
# Perform node pick in world space.
NodePick((-5.0, 5.0))
113
NumColorTableNames
114
NumOperatorPlugins
115
NumPlotPlugins
116
OpenDatabase
args
Returns:
The OpenComputeEngine function returns an integer value of 1 for success and 0 for failure.
Description:
The OpenComputeEngine function is used to explicitly open a compute engine with certain properties. When a compute engine is opened implicitly, the viewer relies on sets of attributes called
host profiles. Host profiles determine how compute engines are launched. This allows compute
engines to be easily launched in parallel. Since the VisIt Python Interface does not expose VisIts
host profiles, it provides the OpenComputeEngine function to allow users to launch compute
engines. The OpenComputeEngine function must be called before opening a database in order to
prevent any latent host profiles from taking precedence. A complete list of VisIts command line
arguments is listed in Ap p en d ix A on page 259.
Example:
% visit -cli
# Launch parallel compute engine remotely.
args = (-np, 16, -nn, 4)
OpenComputeEngine("thunder", args)
OpenDatabase("thunder:/usr/gapps/visit/data/multi_ucd3d.silo")
AddPlot("Pseudocolor", "d")
DrawPlots()
117
OpenDatabase
This is an optional integer argument indicating the time index at which to open
the database. If it is not specified, a time index of zero is assumed.
Returns:
The OpenDatabase function returns an integer value of 1 for success and 0 for failure.
Description:
The OpenDatabase function is one of the most important functions in the VisIt Python Interface
because it opens a database so it can be plotted. The databaseName argument is a string containing
the full name of the database to be opened. The database name is of the form: computer:/path/filename. The computer part of the filename can be omitted if the database to be opened resides on the
local computer.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
OpenDatabase(mcr:/usr/gapps/visit/data/multi_ucd3d.silo)
OpenDatabase(file.visit)
OpenDatabase(file.visit, 4)
118
OpenMDServer
The optional host argument determines the host on which the metadata server is
to be launched. If this argument is not provided, localhost is assumed.
args
A tuple of strings containing command line flags for the metadata server.
Returns:
The OpenMDServer function returns 1 on success and 0 on failure.
Description:
The OpenMDServer explicitly launches a metadata server on a specified host. This allows you to
provide command line options that influence how the metadata server will run.
Argument
Description
-debug #
-dir visitdir
-default_format format
Example:
% visit -cli
args = (-dir, /my/private/visit/version/, -default_format, \
PDB, -debug, 4)
# Open a metadata server before the call to OpenDatabase so we
# can launch it how we want.
OpenMDServer(thunder, args)
OpenDatabase(thunder:/usr/gapps/visit/data/allinone00.pdb)
# Open a metadata server on localhost too.
OpenMDServer()
119
OperatorPlugins
120
OverlayDatabase
OverlayDatabaseCreates new plots based on current plots but with a new database.
Synopsis:
OverlayDatabase(databaseName) -> integer
Arguments:
databaseName
Returns:
The OverlayDatabase function returns an integer value of 1 for success and 0 for failure.
Description:
VisIt has the concept of overlaying plots which, in the nutshell, means that the entire plot list is
copied and a new set of plots with exactly the same attributes but a different database is appended
to the plot list of the active window. The OverlayDatabase function allows the VisIt Python Interface to overlay plots. OverlayDatabase takes a single string argument which contains the name of
the database. After calling the OverlayDatabase function, the plot list is larger and contains plots
of the specified overlay database.
Example:
% visit -cli
OpenDatabase("/usr/gapps/visit/data/globe.silo")
AddPlot("Pseudocolor", "u")
DrawPlots()
OverlayDatabase("riptide:/usr/gapps/visit/data/curv3d.silo")
121
Pick
A tuple of values that describe the coordinate of where we want to perform the
zonal pick.
variables
An optional tuple of strings containing the names of the variables for which we
want information. The tuple can contain the name default if you want
information for the plotted variable.
sx
A screen X location (in pixels) offset from the left side of the visualization
window.
sy
A screen Y location (in pixels) offset from the bottom of the visualization
window.
Returns:
The Pick function prints pick information for the cell (a.k.a zone) that contains the specified point.
The point can be specified as a 2D or 3D point in world space or it can be specified as a pixel location in screen space. If the point is specified as a pixel location then VisIt finds the zone that contains the intersection of a cell and a ray that is projected into the mesh. Once the zonal pick has
been calculated, you can use the GetPickOutput function to retrieve the printed pick output as a
string which can be used for other purposes.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Pseudocolor, hgslice)
DrawPlots()
# Perform node pick in screen space
Pick(300,300)
# Perform node pick in world space.
Pick((-5.0, 5.0))
122
PickByGlobalNode
PickByGlobalNodePerforms pick operation for a specific node using a global node id.
Synopsis:
PickByGlobalNode(node) -> integer
PickByGlobalNode(node, variables) -> integer
Arguments:
node
Integer index of the global node for which we want pick information.
variables
A tuple of strings containing the names of the variables for which we want pick
information.
Returns:
PickByGlobalNode returns 1 on success and 0 on failure.
Description:
The PickByGlobalNode function tells VisIt to perform pick using a specific global node index for
the entire problem. Some meshes are broken up into smaller domains and then these smaller
domains can employ a global indexing scheme to make it appear as though the mesh was still one
large mesh. Not all meshes that have been decomposed into domains provide sufficient information to allow global node indexing. You can use the GetPickOutput function to retrieve a string
containing the pick information once youve called PickByGlobalNode.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/multi_curv2d.silo)
AddPlot(Pseudocolor, d)
DrawPlots()
# Pick on node 200 in the first domain.
PickByGlobalNode(200)
print Last pick = , GetPickOutput()
123
PickByGlobalZone
PickByGlobalZonePerforms pick operation for a specific cell using a global cell id.
Synopsis:
PickByGlobalZone(id) -> integer
PickByGlobalZone(id, variables) -> integer
Arguments:
id
Integer index of the global cell for which we want pick information.
variables
A tuple of strings containing the names of the variables for which we want pick
information.
Returns:
PickByGlobalZone returns 1 on success and 0 on failure.
Description:
The PickByGlobalZone function tells VisIt to perform pick using a specific global cell index for
the entire problem. Some meshes are broken up into smaller domains and then these smaller
domains can employ a global indexing scheme to make it appear as though the mesh was still one
large mesh. Not all meshes that have been decomposed into domains provide sufficient information to allow global cell indexing. You can use the GetPickOutput function to retrieve a string containing the pick information once youve called PickByGlobalZone.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/multi_curv2d.silo)
AddPlot(Pseudocolor, d)
DrawPlots()
# Pick on cell 200 in the first domain.
PickByGlobalZone(200)
print Last pick = , GetPickOutput()
124
PickByNode
-> integer
variables) -> integer
domain) -> integer
domain, variables) -> integer
Arguments:
node
domain
An integer representing the index of the domain that contains the node for
which we want pick information. Note that if the first domain is domain1 then
the first valid index is 1.
variables
A tuple of strings containing the names of the variables for which we want pick
information.
Returns:
PickByNode returns 1 on success and 0 on failure.
Description:
The PickByNode function tells VisIt to perform pick using a specific node index in a given
domain. Other pick by node variants first determine the node that is closest to some user-specified
3D point but the PickByNode functions cuts out this step and allows you to directly pick on the
node of your choice. You can use the GetPickOutput function to retrieve a string containing the
pick information once youve called PickByNode.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/multi_curv2d.silo)
AddPlot(Pseudocolor, d)
DrawPlots()
# Pick on node 200 in the first domain.
PickByNode(200)
# Pick on node 200 in the second domain.
PickByNode(200, 2)
# Pick on node 100 in domain 5 and return information for two
additional variables.
PickByNode(100, 5, (default, u, v))
print Last pick = , GetPickOutput()
125
PickByZone
-> integer
variables) -> integer
domain) -> integer
domain, variables) -> integer
Arguments:
cell
domain
An integer representing the index of the domain that contains the cell for which
we want pick information. Note that if the first domain is domain1 then the
first valid index is 1.
variables
A tuple of strings containing the names of the variables for which we want pick
information.
Returns:
PickByZone returns 1 on success and 0 on failure.
Description:
The PickByZone function tells VisIt to perform pick using a specific cell index in a given domain.
Other pick by zone variants first determine the cell that contains some user-specified 3D point but
the PickByZone functions cuts out this step and allows you to directly pick on the cell of your
choice. You can use the GetPickOutput function to retrieve a string containing the pick information once youve called PickByZone.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/multi_curv2d.silo)
AddPlot(Pseudocolor, d)
DrawPlots()
# Pick on cell 200 in the first domain.
PickByZone(200)
# Pick on cell 200 in the second domain.
PickByZone(200, 2)
# Pick on cell 100 in domain 5 and return information for two
additional variables.
PickByZone(100, 5, (default, u, v))
print Last pick = , GetPickOutput()
126
PlotPlugins
127
PrintWindow
128
PromoteOperator
applyAll
An integer flag that causes all plots in the plot list to be affected when it is nonzero.
Returns:
PromoteOperator returns 1 on success and 0 on failure.
Description:
The PromoteOperator function moves an operator closer to the end of the visualization pipeline.
This allows you to change the order of operators that have been applied to a plot without having to
remove them from the plot. For example, consider moving a Slice to after a Reflect operator when
it had been the other way around. Changing the order of operators can result in vastly different
results for a plot. The opposite function is DemoteOperator (see page 63).
Example:
% visit -cli
OpenDatabase("/usr/gapps/visit/data/noise.silo")
AddPlot("Pseudocolor", "hardyglobal")
AddOperator(Slice)
s = SliceAttributes()
s.project2d = 0
s.originPoint = (0,5,0)
s.originType=s.Point
s.normal = (0,1,0)
s.upAxis = (-1,0,0)
SetOperatorOptions(s)
AddOperator("Reflect")
DrawPlots()
# Now slice after reflect. Well only get 1 slice plane instead of 2.
PromoteOperator(0)
DrawPlots()
129
Queries
130
QueriesOverTime
131
Query
-> integer
variables) -> integer
arg1) -> integer
arg1, variables) -> integer
arg1, arg2) -> integer
arg1, arg2, variables) -> integer
Arguments:
name
variables
arg1
arg2
Returns:
The Query function returns 1 on success and 0 on failure.
Description:
The Query function is used to execute any of VisIts predefined queries. Since queries can take a
wide array of arguments, the Query function has a wide variety of possible arguments. The list of
queries can be found in the VisIt Users Manual in the Quantitative Analysis chapter.You
can get also get a list of queries that can be executed over time using the Queries function.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/wave.visit)
AddPlot(Pseudocolor, pressure)
DrawPlots()
Query(Volume)
132
QueryOverTime
-> integer
variables) -> integer
arg1) -> integer
arg1, variables) -> integer
arg1, arg2) -> integer
arg1, arg2, variables) -> integer
Arguments:
name
variables
arg1
arg2
Returns:
The QueryOverTime function returns 1 on success and 0 on failure.
Description:
The QueryOverTime function is used to execute any of VisIts predefined queries. Since queries
can take a wide array of arguments, the QueryOverTime function has a wide variety of possible
arguments. The list of queries can be found in the VisIt Users Manual in the Quantitative
Analysis chapter. You can get also get a list of queries that can be executed over time using the
QueriesOverTime function.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/wave.visit)
AddPlot(Pseudocolor, pressure)
DrawPlots()
for q in QueriesOverTime():
QueryOverTime(q)
ResetView()
133
RecenterView
RecenterViewRecalculates the view for the active visualization window so that its plots
are centered in the window.
Synopsis:
RecenterView()
Returns:
The RecenterView function does not return a value.
Description:
After adding plots to a visualization window or applying operators to those plots, it is sometimes
necessary to recenter the view. When the view is recentered, the orientation does not change but
the view is shifted to make better use of the screen.
Example:
OpenDatabase("/usr/gapps/visit/data/globe.silo")
AddPlot("Pseudocolor", "u")
DrawPlots()
OpenDatabase("/usr/gapps/visit/data/curv3d.silo")
AddPlot(Pseudocolor, d)
DrawPlots()
RecenterView()
134
RedrawWindow
135
RemoveOperator
An optional integer argument that tells the function to ignore the selected plots
and use all plots in the plot list if the value of the argument is non-zero.
index
The zero-based integer index into a plots operator list that specifies which
operator is to be deleted.
Returns:
All functions return an integer value of 1 for success and 0 for failure.
Description:
The RemoveOperator functions allow operators to be removed from plots. The RemoveLastOperator function removes the operator that was last applied to the selected plots. The RemoveAllOperators function removes all operators from the selected plots in the active visualization window. If
the all argument is provided and contains a non-zero value, all plots in the active visualization window are affected. If the value is zero or if the argument is not provided, only the selected plots are
affected.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
AddOperator(Threshold)
AddOperator(Slice)
AddOperator(SphereSlice)
DrawPlots()
RemoveLastOperator() # Remove SphereSlice
RemoveOperator(0) # Remove Threshold
RemoveAllOperators() # Remove the rest of the operators
136
ReOpenDatabase
137
ReplaceDatabase
A zero-based integer containing the time state that should be made active once
the database has been replaced.
Returns:
The ReplaceDatabase function returns an integer value of 1 for success and 0 for failure.
Description:
The ReplaceDatabase function replaces the database in the current plots with a new database. This
is one way of switching timesteps if no .visit file was ever created. If two databases have the
same variable name then replace is usually a success. In the case where the new database does not
have the desired variable, the plot with the variable not contained in the new database does not get
regenerated with the new database.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
DrawPlots()
ReplaceDatabase(/usr/gapps/visit/data/curv3d.silo)
SaveWindow()
# Replace with a time-varying database and change the time
# state to 17.
ReplaceDatabase(/usr/gapps/visit/data/wave.visit, 17)
138
ResetLineoutColor
139
ResetOperatorOptions
all
An optional integer argument that tells the function to reset the operator
options for all plots regardless of whether or not they are selected.
Returns:
The ResetOperatorOptions function returns an integer value of 1 for success and 0 for failure.
Description:
The ResetOperatorOptions function resets the operator attributes of the specified operator type for
the selected plots back to the default values. The operatorType argument is a string containing the
name of the type of operator whose attributes are to be reset. The all argument is an optional flag
that tells the function to reset the operator attributes for the indicated operator in all plots regardless of whether the plots are selected. When non-zero values are passed for the all argument, all
plots are reset. When the all argument is zero or not provided, only the operators on selected plots
are modified.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
DrawPlots()
AddOperator(Slice)
a = SliceAttributes()
a.normal,a.upAxis = (0,0,1),(0,1,0)
SetOperatorOptions(a)
ResetOperatorOptions(Slice)
140
ResetPickLetter
141
ResetPlotOptions
Returns:
The ResetPlotOptions function returns an integer value of 1 for success and 0 for failure.
Description:
The ResetPlotOptions function resets the plot attributes of the specified plot type for the selected
plots back to the default values. The plotType argument is a string containing the name of the type
of plot whose attributes are to be reset.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
DrawPlots()
p = PseudocolorAttributes()
p.colorTableName = "calewhite"
p.minFlag,p.maxFlag = 1,1
p.min,p.max = -5.0, 8.0
SetPlotOptions(p)
ResetPlotOptions(Pseudocolor)
142
ResetView
143
RestoreSession
visitDir
Returns:
RestoreSession returns 1 on success and 0 on failure.
Description:
The RestoreSession function is important for setting up complex visualizations because you can
design a VisIt session file, which is an XML file that describes exactly how plots are set up, using
the VisIt GUI and then use that same session file in the CLI to generate movies in batch. The
RestoreSession function takes 2 arguments. The first argument specifies the filename that contains
the VisIt session to be restored. The second argument determines whether the session file is
assumed to be in the users VisIt directory. If the visitDir argument is set to 0 then the filename
argument must contain the absolute path to the session file.
Example:
% visit -cli
# Restore my session file for a time-varying database from
# my .visit directory.
RestoreSessionFile(visit.session, 1)
for state in range(TimeSliderGetNStates()):
SetTimeSliderState(state)
SaveWindow()
144
SaveSession
The filename argument is the filename that is used to save the session file. The
filename is relative to the current working directory.
Returns:
The SaveSession function returns 1 on success and 0 on failure.
Description:
The SaveSession function tells VisIt to save an XML session file that describes everything about
the current visualization. Session files are very useful for creating movies and also as shortcuts for
setting up complex visualizations.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/noise.silo)
# Set up a keyframe animation of view and save a session file of it.
k = GetKeyframeAttributes()
k.enabled,k.nFrames,k.nFramesWasUserSet = 1,20,1
SetKeyframeAttributes(k)
AddPlot(Surface, hgslice)
DrawPlots()
v = GetView3D()
v.viewNormal = (0.40823, -0.826468, 0.387684)
v.viewUp, v.imageZoom = (-0.261942, 0.300775, 0.917017), 1.60684
SetView3D(v)
SetViewKeyframe()
SetTimeSliderState(TimeSliderGetNStates() - 1)
v.viewNormal = (-0.291901, -0.435608, 0.851492)
v.viewUp = (0.516969, 0.677156, 0.523644)
SetView3D(v)
SetViewKeyframe()
ToggleCameraViewMode()
SaveSession(~/.visit/keyframe.session)
145
SaveWindow
146
SetActiveColorTable
SetActiveColorTableSets the color table that is used by plots that use a default
color table.
Synopsis:
SetActiveContinuousColorTable(name) -> integer
SetActiveDiscreteColorTable(name) -> integer
Arguments:
name
The name of the color table to use for the active color table. The name must be
present in the tuple returned by the ColorTableNames function.
Returns:
Both functions return 1 on success and 0 on failure.
Description:
VisIt supports two flavors of color tables: continuous and discrete. Both types of color tables have
the same underlying representation but each type of color table is used a slightly different way.
Continuous color tables are made of a small number of color control points and the gaps in the
color table between two color control points are filled by interpolating the colors of the color control points. Discrete color tables do not use any kind of interpolation and like continuous color
tables, they are made up of control points. The color control points in a discrete color table repeat
infinitely such that if we have 4 color control points: A, B, C, D then the pattern of repetition is:
ABCDABCDABCD... Discrete color tables are mainly used for plots that have a discrete set of
items to display (e.g. Subset plot). Continuous color tables are used in plots that display a continuous range of values (e.g. Pseudocolor).
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Contour, hgslice)
DrawPlots()
SetActiveDiscreteColorTable(levels)
147
SetActivePlots
Returns:
The SetActivePlots function returns an integer value of 1 for success and 0 for failure.
Description:
Any time VisIt sets the attributes for a plot, it only sets the attributes for plots which are selected.
The SetActivePlots function must be called to set the active plots. The function takes one argument
which is a tuple of integer plot indices that start at zero. If only one plot is being selected, the plots
argument can be an integer instead of a tuple.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Subset, mat1)
AddPlot(Mesh, mesh1)
AddPlot(Contour, u)
DrawPlots()
SetActivePlots((0,1,2)) # Make all plots active
SetActivePlots(0) # Make only the Subset plot active
148
SetActiveTimeSlider
A string containing the name of the time slider that should be made active.
Returns:
SetActiveTimeSlider returns 1 on success and 0 on failure.
Description:
Sets the active time slider, which is the time slider that is used to change time states.
Example:
% visit -cli
path = /usr/gapps/visit/data/
dbs = (path + dbA00.pdb, path + dbB00.pdb, path + dbC00.pdb)
for db in dbs:
OpenDatabase(db)
AddPlot(FilledBoundary, material(mesh))
DrawPlots()
CreateDatabaseCorrelation(common, dbs, 1)
tsNames = GetWindowInformation().timeSliders
for ts in tsNames:
SetActiveTimeSlider(ts)
for state in list(range(TimeSliderGetNStates())) + [0]:
SetTimeSliderState(state)
149
SetActiveWindow
150
SetAnimationTimeout
151
SetAnnotationAttributes
Returns:
Both functions return 1 on success and 0 on failure.
Description:
The annotation settings control what bits of text are drawn in the visualization window. Among the
annotations are the plot legends, database information, user information, plot axes, triad, and the
background style and colors. Setting the annotation attributes is important for producing quality
visualizations. The annotation settings are stored in AnnotationAttributes objects. To set the annotation attributes, first create an AnnotationAttributes object using the AnnotationAttributes function and then pass the object to the SetAnnotationAttributes function. To set the default annotation
attributes, also pass the object to the SetDefaultAnnotationAttributes function.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/wave.visit)
AddPlot(Pseudocolor, pressure)
DrawPlots()
a = AnnotationAttributes()
a.axes3DFlag = 1
a.userInfoFlag = 0
a.gradientBackgroundStyle = a.GRADIENTSTYLE_RADIAL
a.gradientColor1 = (0,255,255)
a.gradientColor2 = (0,0,0)
a.backgroundMode = a.BACKGROUNDMODE_GRADIENT
SetAnnotationAttributes(a)
152
SetCenterOfRotation
Returns:
The SetCenterOfRotation function returns 1 on success and 0 on failure.
Description:
The SetCenterOfRotation function sets the center of rotation for plots in a 3D visualization window. The center of rotation, is the point about which plots are rotated when you interactively spin
the plots using the mouse. It is useful to set the center of rotation if youve zoomed in on any 3D
plots so in the event that you rotate the plots, the point of interest remains fixed on the screen.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
AddPlot("Mesh", "mesh1")
DrawPlots()
v = GetView3D()
v.viewNormal = (-0.409139, 0.631025, 0.6591)
v.viewUp = (0.320232, 0.775678, -0.543851)
v.imageZoom = 4.8006
SetCenterOfRotation(-4.755280, 6.545080, 5.877850)
# Rotate the plots interactively.
153
SetDatabaseCorrelationOptions
method
whenToCreate An integer that tells VisIt when to automatically create database correlations.
Returns:
SetDatabaseCorrelationOptions returns 1 on success and 0 on failure.
Description:
VisIt provides functions to explicitly create and alter database correlations but there are also a
number of occasions where VisIt can automatically create a database correlation. The SetDatabaseCorrelationOptions function allows you to tell VisIt the default correlation method to use
when automatically creating a new database correlation and it also allows you to tell VisIt when
database correlations can be automatically created.
method
Description
IndexForIndexCorrelation
StretchedIndexCorrelation
TimeCorrelation
CycleCorrelation
whenToCreate
Description
Example:
154
SetDatabaseCorrelationOptions
% visit -cli
OpenDatabase(/usr/gapps/visit/data/dbA00.pdb)
AddPlot(FilledBoundary, material(mesh))
DrawPlots()
# Always create a stretched index correlation.
SetDatabaseCorrelationOptions(1, 0)
OpenDatabase(/usr/gapps/visit/data/dbB00.pdb)
AddPlot(FilledBoundary, material(mesh))
# The AddPlot caused a database correlation to be created.
DrawPlots()
wi = GetWindowInformation()
print Active time slider: % wi.timeSliders[wi.activeTimeSlider]
# This will set time for both databases since the database correlation
is the active time slider.
SetTimeSliderState(5)
155
SetGlobalLineoutAttributes
Returns:
The SetGlobalLineoutAttributes function returns 1 on success and 0 on failure.
Description:
The SetGlobalLineoutAttributes function allows you to set global lineout options that are used in
the creation of all lineouts. You can, for example, specify the destination window and the number
of sample points for lineouts.
Example:
% visit -cli
SetWindowLayout(4)
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Pseudocolor, hgslice)
DrawPlots()
gla = GetGlobalLineoutAttributes()
gla.createWindow = 0
gla.windowId = 4
gla.samplingOn = 1
gla.numSamples = 150
SetGlobalLineoutAttributes(gla)
Lineout((-5,-8), (-3.5, 8))
156
SetInteractorAttributes
Returns:
SetInteractorAttributes returns 1 on success and 0 on failure.
Description:
The SetInteractorAttributes function is used to set certain interactor properties. Interactors, can be
thought of as how mouse clicks and movements are translated into actions in the vis window. To
set the interactor attributes, first get the interactor attributes using the GetInteractorAttributes function (see page 83). Once youve set the objects properties, call the SetInteractorAttributes function
to make VisIt use the new interactor attributes.
The SetDefaultInteractorAttributes function sets the default interactor attributes, which are used
for new visualization windows. The default interactor attributes can also be saved to the VisIt configuration file to ensure that future VisIt sessions have the right default interactor attributes.
Example:
% visit -cli
ia = GetInteractorAttributes()
print ia
ia.showGuidelines = 0
SetInteractorAttributes(ia)
157
SetKeyframeAttributes
Returns:
SetKeyframeAttributes returns 1 on success and 0 on failure.
Description:
Use the SetKeyframeAttributes function when you want to change VisIts keyframing settings.
You must pass a KeyframeAttributes object, which you can create using the GetKeyframeAttributes function (page 84). The KeyframeAttributes object must contain the keyframing settings
that you want VisIt to use. For example, you would use the SetKeyframeAttributes function if you
wanted to turn on keyframing mode and set the number of animation frames.
Example:
% visit -cli
k = GetKeyframeAttributes()
print k
k.enabled,k.nFrames,k.nFramesWasUserSet = 1, 100, 1
SetKeyframeAttributes(k)
158
SetLight
A zero-based integer index into the light list. Index can be in the range [0,7].
light
A LightAttributes object containing the properties to use for the specified light.
Returns:
SetLight returns 1 on success and 0 on failure.
Description:
The SetLight function sets the attributes for a specific light.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot("Pseudocolor", "w")
p = PseudocolorAttributes()
p.colorTableName = xray
SetPlotOptions(p)
DrawPlots()
InvertBackgroundColor()
light = GetLight(0)
print light
light.enabledFlag = 1
light.direction = (0,-1,0)
light.color = (255,0,0,255)
SetLight(0, light)
light.color,light.direction = (0,255,0,255), (-1,0,0)
SetLight(1, light)
159
SetMaterialAttributes
Returns:
Both functions return 1 on success and 0 on failure.
Description:
The SetMaterialAttributes function takes a MaterialAttributes object and makes VisIt use the
material settings that it contains. You use the SetMaterialAttributes function when you want to
change how VisIt performs material interface reconstruction. The SetDefaultMaterialAttributes
function sets the default material attributes, which are saved to the config file and are also used by
new visualization windows.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/allinone00.pdb)
AddPlot(Pseudocolor, mesh/mixvar)
p = PseudocolorAttributes()
p.min,p.minFlag = 4.0, 1
p.max,p.maxFlag = 13.0, 1
SetPlotOptions(p)
DrawPlots()
# Tell VisIt to always do material interface reconstruction.
m = GetMaterialAttributes()
m.forceMIR = 1
SetMaterialAttributes(m)
ClearWindow()
# Redraw the plot forcing VisIt to use the mixed variable information.
DrawPlots()
160
SetOperatorOptions
activeIndex An optional zero-based integer that serves as an index into the selected plots
operator list. Use this argument if you want to set the operator attributes for a
plot that has multiple instances of the same type of operator.
all
An optional integer argument that tells the function to apply the operator
attributes to all plots containing the specified operator if the value of the
argument is non-zero.
Returns:
All functions return an integer value of 1 for success and 0 for failure.
Description:
Each operator in VisIt has a group of attributes that controls the operator. To set the attributes for
an operator, first create an operator attributes object. This is done by calling a function which is the
name of the operator plus the word Attributes. For example, a Slice operators operator attributes
object is created and returned by the SliceAttributes function. Assign the new operator attributes
object into a variable and set its fields. After setting the desired fields in the operator attributes
object, pass the object to the SetOperatorOptions function. The SetOperatorOptions function
determines the type of operator to which the operator attributes object applies and sets the
attributes for that operator type. To set the default plot attributes, use the SetDefaultOperatorOptions function. Setting the default attributes ensures that all future instances of a certain operator
are initialized with the new default values.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
AddPlot(Mesh, mesh1)
AddOperator(Slice, 1) # Add the operator to both plots
a = SliceAttributes()
a.normal, a.upAxis = (0,0,1), (0,1,0)
# Only set the attributes for the selected plot.
SetOperatorOptions(a)
DrawPlots()
161
SetPickAttributes
SetPickAttributesChanges the pick settings that VisIt uses when picking on plots.
Synopsis:
SetPickAttributes(atts) -> integer
SetDefaultPickAttributes(atts) -> integer
ResetPickAttributes() -> integer
Arguments:
atts
Returns:
All functions return 1 on success and 0 on failure.
Description:
The SetPickAttributes function changes the pick attributes that are used when VisIt picks on plots.
The pick attributes allow you to format your pick output in various ways and also allows you to
select auxiliary pick variables.
Example:
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Pseudocolor, hgslice)
DrawPlots()
Pick((-5,5))
p = GetPickAttributes()
p.showTimeStep = 0
p.showMeshName = 0
p.showZoneId = 0
SetPickAttributes(p)
Pick((0,5))
162
SetPipelineCachingMode
163
SetPlotDatabaseState
A zero-based integer index that is the plots location in the plot list.
frame
A zero-baed integer index representing the animation frame for which were
going to add a database keyframe.
state
A zero-based integer index representating the database time state that were
going to use at the specified animation frame.
Returns:
The SetPlotDatabaseState function does not return a value.
Description:
The SetPlotDatabaseState function is used when VisIt is in keyframing mode to add a database
keyframe for a specific plot. VisIt uses database keyframes to determine which database state is to
be used for a given animation frame. Database keyframes can be used to stop database time
while animation time continues forward and they can also be used to make database time go in
reverse, etc.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/wave.visit)
k = GetKeyframeAttributes()
nFrames = 20
k.enabled, k.nFrames, k.nFramesWasUserSet = 1, nFrames, 1
SetKeyframeAttributes(k)
AddPlot(Pseudocolor, pressure)
AddPlot(Mesh, quadmesh)
DrawPlots()
# Make database time for the Pseudocolor plot go in reverse
SetPlotDatabaseState(0, 0, 70)
SetPlotDatabaseState(0, nFrames-1, 0)
# Animate through the animation frames since the Keyframe animation
time slider is active.
for state in range(TimeSliderGetNStates()):
SetTimeSliderState(state)
164
SetPlotFrameRange
start
A zero-based integer representing the animation frame where the plot first
appears in the visualization.
end
Returns:
The SetPlotFrameRange function does not return a value.
Description:
The SetPlotFrameRange function sets the start and end frames for a plot when VisIt is in keyframing mode. Outside of this frame range, the plot does not appear in the visualization. By default,
plots are valid over the entire range of animation frames when they are first created. Frame ranges
allow you to construct complex animations where plots appear and disappear dynamically.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/wave.visit)
k = GetKeyframeAttributes()
nFrames = 20
k.enabled, k.nFrames, k.nFramesWasUserSet = 1, nFrames, 1
SetKeyframeAttributes(k)
AddPlot(Pseudocolor, pressure)
AddPlot(Mesh, quadmesh)
DrawPlots()
# Make the Pseudocolor plot take up the first half of the animation
frames before it disappears.
SetPlotFrameRange(0, 0, nFrames/2-1)
# Make the Mesh plot take up the second half of the animation frames.
SetPlotFrameRange(1, nFrames/2, nFrames-1)
for state in range(TimeSliderGetNStates())
SetTimeSliderState(state)
SaveWindow()
165
SetPlotOptions
Returns:
All functions return an integer value of 1 for success and 0 for failure.
Description:
Each plot in VisIt has a group of attributes that controls the appearance of the plot. To set the
attributes for a plot, first create a plot attributes object. This is done by calling a function which is
the name of the plot plus the word Attributes. For example, a Pseudocolor plots plotattributes
object is created and returned by the PseudocolorAttributes function. Assign the new plot
attributes object into a variable and set its fields. After setting the desired fields in the plot
attributes object, pass the object to the SetPlotOptions function. The SetPlotOptions function
determines the type of plot to which the plot attributes object applies and sets the attributes for that
plot type. To set the default plot attributes, use the SetDefaultPlotOptions function. Setting the
default attributes ensures that all future instances of a certain plot are initialized with the new
default values.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
p = PseudocolorAttributes()
p.colorTableName = "calewhite"
p.minFlag,p.maxFlag = 1,1
p.min,p.max = -5.0, 8.0
SetPlotOptions(p)
DrawPlots()
166
SetPlotSILRestriction
all
An optional argument that tells the function if the SIL restriction should be
applied to all plots in the plot list.
Returns:
The SetPlotSILRestriction function returns an integer value of 1 for success and 0 for failure.
Description:
VisIt allows the user to select subsets of databases. The description of the subset is called a Subset
Inclusion Lattice Restriction, or SIL restriction. The SIL restriction allows databases to be subselected in several different ways. The VisIt Python Interface provides the SetPlotSILRestriction
function to allow Python scripts to turn off portions of the plotted database. The SetPlotSILRestriction function accepts a SILRestriction object that contains the SIL restriction for the selected
plots. The optional all argument is an integer that tells the function to apply the SIL restriction to
all plots when the value of the argument is non-zero. If the all argument is not supplied, then the
SIL restriction is only applied to the selected plots.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/multi_curv2d.silo)
AddPlot("Subset", "mat1")
silr = SILRestriction()
silr.TurnOffSet(silr.SetsInCategory(mat1)[1])
SetPlotSILRestriction(silr)
DrawPlots()
167
SetPrinterAttributes
A PrinterAttributes object.
Returns:
The SetPrinterAttributes function does not return a value.
Description:
The SetPrinterAttributes function sets the printer attributes. VisIt uses the printer attributes to
determine how the active visualization window should be printed. The function accepts a single
argument which is a PrinterAttributes object containing the printer attributes to use for future
printing. VisIt allows images to be printed to a network printer or to a PostScript file that can be
printed later by other applications.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/curv2d.silo)
AddPlot(Surface, v)
DrawPlots()
# Make it print to a file.
p = PrinterAttributes()
p.outputToFile = 1
p.outputToFileName = printfile
SetPrinterAttributes(p)
PrintWindow()
168
SetQueryOverTimeAttributes
Returns:
All functions return 1 on success and 0 on failure.
Description:
The SetQueryOverTimeAttributes function changes the settings that VisIt uses for query over
time. The SetDefaultQueryOverTimeAttributes function changes the settings that new visualization windows inherit for doing query over time. Finally, the ResetQueryOverTimeAttributes function forces VisIt to use the stored default query over time attributes instead of the previous settings.
Example:
% visit -cli
SetWindowLayout(4)
OpenDatabase(/usr/gapps/visit/data/allinone00.pdb)
AddPlot(Pseudocolor, mesh/mixvar)
DrawPlots()
qot = GetQueryOverTimeAttributes()
# Make queries over time go to window 4.
qot.createWindow,q.windowId = 0, 4
SetQueryOverTimeAttributes(qot)
QueryOverTime(Min)
# Make queries over time only use half of the number of time states.
qot.endTimeFlag,qot.endTime = 1, GetDatabaseNStates() / 2
SetQueryOverTimeAttributes(qot)
QueryOverTime(Min)
ResetView()
169
SetRenderingAttributes
Returns:
The SetRenderingAttributes function returns 1 on success and 0 on failure.
Description:
The SetRenderingAttributes makes VisIt use the rendering attributes stored in the specified RenderingAttributes object. The RenderingAttributes object stores rendering attributes such as: scalable rendering options, shadows, specular highlights, display lists, etc.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Surface, hgslice)
DrawPlots()
v = GetView2D()
v.viewNormal = (-0.215934, -0.454611, 0.864119)
v.viewUp = (0.973938, -0.163188, 0.157523)
v.imageZoom = 1.64765
SetView3D(v)
light = GetLight(0)
light.direction = (0,1,-1)
SetLight(0, light)
r = GetRenderingAttributes()
print r
r.scalableActivationMode = r.Always
r.doShadowing = 1
SetRenderingAttributes(r)
170
SetSaveWindowAttributes
A SaveWindowAttributes object.
Returns:
The SetSaveWindowAttributes object does not return a value.
Description:
The SetSaveWindowAttributes function sets the format and filename that are used to save windows when the SaveWindow function is called. The contents of the active visualization window
can be saved as TIFF, JPEG, RGB, PPM, PNG images or they can be saved as curve, Alias Wavefront Obj, or VTK geometry files. To set the SaveWindowAttributes, create a SaveWindowAttributes object using the SaveWindowAttributes function and assign it into a variable. Set the fields
in the object and pass it to the SetSaveWindowAttributes function.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/curv3d.silo)
AddPlot(Pseudocolor, d)
DrawPlots()
# Set the save window attributes
s = SaveWindowAttributes()
s.filename = "test"
s.format = s.FILEFORMAT_JPEG
s.progressive = 1
s.fileName = "test"
SetSaveWindowAttributes(s)
# Save the window
SaveWindow()
171
SetTimeSliderState
A zero-based integer containing the time state that we want to make active.
Returns:
The SetTimeSliderState function returns 1 on success and 0 on failure.
Description:
The SetTimeSliderState function sets the time state for the active time slider. This is the function
to use if you want to animate through time or change the current keyframe frame.
Example:
% visit -cli
path = /usr/gapps/visit/data/
dbs = (path + dbA00.pdb, path + dbB00.pdb, path + dbC00.pdb)
for db in dbs:
OpenDatabase(db)
AddPlot(FilledBoundary, material(mesh))
DrawPlots()
CreateDatabaseCorrelation(common, dbs, 1)
tsNames = GetWindowInformation().timeSliders
for ts in tsNames:
SetActiveTimeSlider(ts)
for state in list(range(TimeSliderGetNStates())) + [0]:
SetTimeSliderState(state)
172
SetView
Returns:
Neither function returns a value.
Description:
The view is a crucial part of a visualization since it determines which parts of the database are
examined. The VisIt Python Interface provides two functions for setting the view: SetView2D, and
SetView3D. If the visualization window contains 2D plots, use the SetView2D function. Use the
SetView3D function when the visualization window contains 3D plots. Both functions take a ViewAttributes object as an argument. To set the view, first create a ViewAttributes object using the
ViewAttributes function and set the objects fields to set a new view. After setting the fields, pass
the object to either the SetView2D or SetView3D function. A common use of the SetView functions is to animate the view to produce simple animations where the camera appears to fly around
the plots in the visualization window.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, v)
DrawPlots()
v0 = GetView3D()
v1 = GetView3D()
v1.camera,v1.viewUp = (1,1,1),(-1,1,-1)
v1.parallelScale = 10.
for i in range(0,20):
t = float(i) / 19.
v2 = (1. - t) * v0 + t * v1
SetView3D(v2) # Animate the view.
173
SetViewExtentsType
Returns:
SetViewExtentsType returns 1 on success and 0 on failure.
Description:
VisIt can use a plots spatial extents in two ways when computing the view. The first way of using
the extents is to use the original extents, which are the spatial extents before any modifications,
such as subset selection, have been made to the plot. This ensures that the view will remain relatively constant for a plot. Alternatively, you can use the actual extents, which are the spatial
extents of the pieces of the plot that remain after operations such as subset selection.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
SetViewExtentsType(actual)
AddPlot(FilledBoundary, mat1)
DrawPlots()
v = GetView3D()
v.viewNormal = (-0.618945, 0.450655, 0.643286)
v.viewUp = (0.276106, 0.891586, -0.358943)
SetView3D(v)
mats = GetMaterials()
nmats = len(mats):
# Turn off all but the last material in sequence and watch
# the view update each time.
for i in range(nmats-1):
index = nmats-1-i
TurnMaterialsOff(mats[index])
SaveWindow()
SetViewExtentsType(original)
174
SetViewKeyframe
175
SetWindowArea
width
height
Returns:
The SetWindowArea function does not return a value.
Description:
The SetWindowArea method sets the area of the screen that can be used by VisIts visualization
windows. This is useful for making sure windows are a certain size when running a Python script.
Example:
import visit
visit.Launch()
visit.SetWindowArea(0, 0, 600, 600)
visit.SetWindowLayout(4)
176
SetWindowLayout
Returns:
The SetWindowLayout function returns an integer value of 1 for success and 0 for failure.
Description:
VisIts visualization windows can be arranged in various tiled patterns that allow VisIt to make
good use of the screen while displaying several visualization windows. The window layout determines how windows are shown on the screen. The SetWindowLayout function sets the window
layout. The layout argument is an integer value equal to 1,2,4,8,9, or 16.
Example:
% visit -cli
SetWindowLayout(2) # switch to 1x2 layout
SetWindowLayout(4) # switch to 2x2 layout
SetWindowLayout(8) # switch to 2x4 layout
177
SetWindowMode
Returns:
The SetWindowMode function does not return a value.
Description:
VisIts visualization windows have various window modes that alter their behavior. Most of the
time a visualization window is in navigate mode which changes the view when the mouse is
moved in the window. The zoom mode allows a zoom rectangle to be drawn in the window for
changing the view. The pick mode retrieves information about the plots when the mouse is
clicked in the window. The lineout mode allows the user to draw lines which produce curve
plots.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/curv2d.silo)
AddPlot(Pseudocolor, d)
DrawPlots()
SetWindowMode(zoom)
# Draw a rectangle in the visualization window to zoom the plots
178
ShowAllWindows
179
ShowToolbars
An integer value that tells VisIt to show the toolbars for all windows when it is
non-zero.
Returns:
The ShowToolbars function returns 1 on success and 0 on failure.
Description:
The ShowToolbars function tells VisIt to show the toolbars for the active visualization window or
for all visualization windows when the optional allWindows argument is provided and is set to a
non-zero value.
Example:
% visit -cli
SetWindowLayout(4)
HideToolbars(1)
ShowToolbars()
# Show the toolbars for all windows.
ShowToolbars(1)
180
Source
181
TimeSliderGetNStates
TimeSliderGetNStatesReturns the number of time states for the active time slider.
Synopsis:
TimeSliderGetNStates() -> integer
Returns:
Returns an integer containing the number of time states for the current time slider.
Description:
The TimeSliderGetNStates function returns the number of time states for the active time slider.
Remember that the length of the time slider does not have to be equal to the number of time states
in a time-varying database because of database correlations and keyframing. If you want to iterate
through time, use this function to determine the number of iterations that are required to reach the
end of the active time slider.
Example:
OpenDatabase(/usr/gapps/visit/data/wave.visit)
AddPlot(Pseudocolor, pressure)
DrawPlots()
for state in range(TimeSliderGetNStates()):
SetTimeSliderState(state)
SaveWindow()
182
TimeSliderNextState
183
TimeSliderPreviousState
184
ToggleMode
185
ToggleMode
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
DrawPlots()
# Turn on spin mode.
ToggleSpinMode()
# Rotate the plot interactively using the mouse and watch it keep
spinning after the mouse release.
# Turn off spin mode.
ToggleSpinMode()
186
TurnMaterialsOn/Off, TurnDomainsOn/Off
187
UndoView
188
WriteConfigFile
189
WriteConfigFile
190
Chapter 5
1.0
Object Reference I
Overview
VisIts Python Interface is replete with functions that perform complex behaviors. Each
function requires anywhere from a handful of pieces of information to dozens of pieces of
information in order to complete successfully. To ensure that programming scripts using
VisIts Python Interface is made as simple as possible, many functions take special objects
which group all related pieces of information as their arguments. These objects are new
Python types that contain groups of attributes that are used to perform related functions.
These objects, which are covered in this chapter, are used to simplify the interface to the
functions in the VisIt Python Interface and they also make convenient return values for
functions that return information about VisIts state.
2.0
191
AnnotationAttributes
192
Field
Type
Default value
axesFlag2D
int
axesAutoSetTicks2D
int
labelAutoSetScaling2D
int
xAxisLabels2D
int
yAxisLabels2D
int
xAxisTitle2D
int
yAxisTitle2D
int
xGridLines2D
int
yGridLines2D
int
xMajorTickMinimum2D
float
0.0
yMajorTickMinimum2D
float
0.0
xMajorTickMaximum2D
float
1.0
yMajorTickMaximum2D
float
1.0
xMajorTickSpacing2D
float
0.2
yMajorTickSpacing2D
float
0.2
xMinorTickSpacing2D
float
0.02
yMinorTickSpacing2D
float
0.02
xLabelFontHeight2D
float
0.02
yLabelFontHeight2D
float
0.02
xTitleFontHeight2D
float
0.02
yTitleFontHeight2D
float
0.02
xLabelScaling2D
int
yLabelScaling2D
int
AnnotationAttributes
Field
Type
Default value
axesLineWidth2D
int
axesTickLocation2D
int
Outside
Possible values: Inside, Outside, Both
axesTicks2D
int
BottomLeft
Possible values: Off, Bottom, Left, BottomLeft, All
axesFlag
int
axesAutoSetTicks
int
labelAutoSetScaling
int
xAxisLabels
int
yAxisLabels
int
zAxisLabels
int
xAxisTitle
int
yAxisTitle
int
zAxisTitle
int
xGridLines
int
yGridLines
int
zGridLines
int
xAxisTicks
int
yAxisTicks
int
zAxisTicks
int
xMajorTickMinimum
float
0.0
yMajorTickMinimum
float
0.0
zMajorTickMinimum
float
0.0
xMajorTickMaximum
float
1.0
yMajorTickMaximum
float
1.0
zMajorTickMaximum
float
1.0
xMajorTickSpacing
float
0.2
yMajorTickSpacing
float
0.2
zMajorTickSpacing
float
0.2
xMinorTickSpacing
float
0.02
yMinorTickSpacing
float
0.02
193
AnnotationAttributes
Field
Type
Default value
zMinorTickSpacing
float
0.02
xLabelFontHeight
float
0.02
yLabelFontHeight
float
0.02
zLabelFontHeight
float
0.02
xTitleFontHeight
float
0.02
yTitleFontHeight
float
0.02
zTitleFontHeight
float
0.02
xLabelScaling
int
yLabelScaling
int
zLabelScaling
int
axesTickLocation
int
axesType
int
ClosestTriad
Possible values: ClosestTriad, FurthestTriad, OutsideEdges, StaticTriad, StaticEdges
triadFlag
int
bboxFlag
int
backgroundColor
tuple of int
foregroundColor
tuple of int
(0, 0, 0, 255)
gradientBackgroundStyle
int
Radial
Possible values: TopToBottom, BottomToTop, LeftToRight, RightToLeft, Radial
gradientColor1
tuple of int
gradientColor2
tuple of int
(0, 0, 0, 255)
backgroundMode
int
Solid
Possible values: Solid, Gradient
userInfoFlag
int
databaseInfoFlag
int
legendInfoFlag
int
Description:
The AnnotationAttributes function is used to create AnnotationAttributes objects that can be
passed to the SetAnnotationAttributes function once their attributes have been set.
Example:
194
AnnotationAttributes
% visit -cli
# Turning on a gradient background.
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, u)
AddPlot(Mesh, mesh1)
DrawPlots()
# Get the current annotation attributes.
a = GetAnnotationAttributes()
a.foregroundColor = (255,255,255,255)
a.gradientBackgroundStyle = a.TopToBottom
a.gradientColor1 = (150,200,255,255)
a.backgroundMode = a.Gradient
# Make the visualization use a gradient background.
SetAnnotationAttributes(a)
195
GlobalAttributes
196
Field
Type
Default value
sources
tuple of
string
()
windows
tuple of int
(1)
activeWindow
int
iconifiedFlag
int
autoUpdateFlag
int
replacePlots
int
applyOperator
int
executing
int
windowLayout
int
makeDefaultConfirm
int
cloneWindowOnFirstRef
int
maintainView
int
maintainData
int
automaticallyAddOperator
int
GlobalAttributes
Description:
The GlobalAttributes function is used to create GlobalAttributes objects but more often than not,
you should use the GetGlobalAttributes function to create a GlobalAttributes object since objects
returned from that function will be initialized with VisIts current state.
Example:
% visit -cli
SetWindowLayout(4)
ptypes = ("Pseudocolor", "FilledBoundary", "Vector", "Volume")
pvars = ("u", "mat1", "vel", "speed")
for win in GetGlobalAttributes().windows:
SetActiveWindow(win)
DeleteAllPlots()
OpenDatabase("/usr/gapps/visit/data/globe.silo")
i = win-1
AddPlot(ptypes[i], pvars[i])
DrawPlots()
197
LightAttributes
Type
Default value
enabledFlag
int
type
int
Camera
Possible values: Ambient, Object, Camera
direction
tuple of
float
color
tuple of
float
brightness
float
1.0
Description:
The LightAttributes function is used to create LightAttributes objects. Once you set the properties
for a LightAttributes object, you can pass the object to the SetLight function (see page 159) to set
the properties for one of VisIts lights.
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/globe.silo)
AddPlot(Pseudocolor, w)
p = PseudocolorAttributes()
p.colorTableName = xray
SetPlotOptions(p)
InvertBackgroundColor()
DrawPlots()
L = LightAttributes()
L.direction, L.color = (0,-1,0), (255,0,0,255)
SetLight(0, L)
198
MaterialAttributes
Type
Default value
cleanZonesOnly
int
forceMIR
int
needValidConnectivity
int
smoothing
int
useNewMIRAlgorithm
int
Description:
The MaterialAttributes function is used to create MaterialAttributes objects which are then used to
set material interface reconstruction options using the SetMaterialAttributes function (see
page 160).
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/allinone00.pdb)
AddPlot(Pseudocolor, mesh/mixvar)
p = PseudocolorAttributes()
p.min,p.minFlag = 4.0, 1
p.max,p.maxFlag = 13.0, 1
SetPlotOptions(p)
DrawPlots()
# Tell VisIt to always do material interface reconstruction.
m = GetMaterialAttributes()
m.forceMIR = 1
SetMaterialAttributes(m)
ClearWindow()
DrawPlots()
199
PrinterAttributes
Type
Default value
creator
string
""
documentName
string
"untitled"
numCopies
int
outputToFile
int
outputToFileName
string
"untitled"
pageSize
int
portrait
int
printColor
int
printProgram
string
lpr
printerName
string
Description:
The PrinterAttributes function is used to create PrinterAttributes objects.
200
RenderingAttributes
Type
Default value
antialiasing
int
geometryRepresentation
int
Surfaces
Possible values: Surfaces, Wireframe,
Points
displayListMode
int
Auto
Possible values: Never, Always, Auto
stereoRendering
int
stereoType
int
CrystalEyes
Possible values: RedBlue, Interlaced,
CrystalEyes
notifyForEachRender
int
scalableActivationMode
int
Auto
Possible values: Never, Always, Auto
scalableAutoThreshold
int
2000000
specularFlag
int
specularCoeff
float
0.6
specularPower
float
10.0
specularColor
tuple of int
doShadowing
int
shadowStrength
float
0.5
Description:
The RenderingAttributes function is used to create RenderingAttributes objects that can be passed
to the SetRenderingAttributes function (see page 170) to set VisIts rendering options.
Example:
% visit -cli
201
RenderingAttributes
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Surface, hgslice)
DrawPlots()
# Set up the view
v = GetView3D()
v.viewNormal = (-0.215934, -0.454611, 0.864119)
v.viewUp = (0.973938, -0.163188, 0.157523)
v.imageZoom = 1.64765
SetView3D(v)
# Set up the light.
light = GetLight(0)
light.direction = (0,1,-1)
SetLight(0, light)
# Turn on shadows
r = GetRenderingAttributes()
print r
r.scalableActivationMode = r.Always
r.doShadowing = 1
SetRenderingAttributes(r)
202
SaveWindowAttributes
Type
Default value
outputToCurrentDirectory
int
outputDirectory
string
fileName
string
"visit"
family
int
format
int
TIFF
Possible values: BMP, CURVE, JPEG,
OBJ, PNG, POSTSCRIPT, PPM, RGB,
STL, TIFF, ULTRA, VTK
maintainAspect
int
width
int
1024
height
int
1024
screenCapture
int
saveTiled
int
quality
int
80
progressive
int
binary
int
stereo
int
compression
int
Description:
The SaveWindowAttributes function is used to create SaveWindowAttributes objects so that you
can pass them to the SetSaveWindowAttributes function to set options that are used when VisIt
saves an image.
Example:
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Contour, hardyglobal)
203
SaveWindowAttributes
DrawPlots()
# Set the save window options
s = SaveWindowAttributes()
s.fileName = mycontour.jpeg
s.format = s.JPEG
s.family = 0
s.progressive = 1
s.quality = 90
SetSaveWindowOptions(s)
# Save the image in the active vis window.
SaveWindow()
204
SILRestriction
Description
Arguments:
A string
containing the
name of the set
whose index is to
be returned.
setname
Arguments:
setindex
An integer index
into the list of
sets.
205
SILRestriction
Method
Description
This method returns a tuple of integers containing the set indices of the sets that belong
in the specified category.
Arguments:
The name of a
category. The
name must be in
the tuple
returned by the
Categories
method.
catname
TurnOffAll()
TurnOffSet(setindex)
Arguments:
An integer index
into the list of
sets.
setindex
TurnOnAll()
TurnOnSet(setindex)
Arguments:
An integer index
into the list of
sets.
setindex
TurnSet(setindex, onoff)
The TurnSet method allows you to turn a specific set and all of its subsets on or off.
Arguments:
206
setindex
An integer index
into the list of
sets.
onoff
An integer that
indicates
whether the set is
on (non-zero) or
off (zero).
SILRestriction
Method
Description
Arguments:
An integer index
into the list of
sets.
setindex
The Wholes method returns a tuple of integers containing the indices of the top sets that
are stored in the simulation.
Description:
The SILRestriction function is used to create SILRestriction objects based on the active plot in the
plot list. A SIL restriction is can be thought of as a list of on/off values for each set in the SIL. VisIt
uses SIL restrictions to determine which subsets are actually plotted in a visualization. You can use
a SILRestriction object to turn off sets that you do not want to see in the visualization.
Example:
% visit -cli
OpenDatabase("/usr/gapps/visit/data/multi_rect2d.silo")
AddPlot("FilledBoundary", "mat1")
AddPlot("Subset", "domains")
s = SubsetAttributes()
s.wireframe, s.lineWidth = 1, 2
SetPlotOptions(s)
DrawPlots()
ToggleMaintainViewMode()
# Select both plots so we can set both of their SIL restrictions.
SetActivePlots((0,1))
s = SILRestriction()
# Iterate through the categories in the SIL restriction
# and turn all sets on/off different ways.
for category in s.Categories():
# Turn sets off one at a time.
for setindex in s.SetsInCategory(category):
s.TurnOffSet(setindex)
SetPlotSILRestriction(s)
# Turn sets back on one at a time.
for setindex in s.SetsInCategory(category):
s.TurnOnSet(setindex)
SetPlotSILRestriction(s)
207
ViewCurveAttributes
Type
Default value
domainCoords
tuple of
float
(0.0, 1.0)
rangeCoords
tuple of
float
(0.0, 1.0)
viewportCoords
tuple of
float
(0.2, 0.95)
Description:
The ViewCurveAttributes function is used to create ViewCurveAttributes objects, which are
passed to the SetViewCurve function to set the view when the visualization window displays
Curve plots.
208
View2DAttributes
Type
Default value
fullFrame
int
viewportCoords
tuple of
float
windowCoords
tuple of
float
Description:
The View2DAttributes function is used to create View2DAttributes objects that are used to set the
2D view using the SetView2D function. Note that View2DAttributes can be used in arithmetic
expressions so you can add views together, multiply them by a scale factor, etc. You can even
interpolate views (e.g. view0 * (1. - t) + view1 * t).
Example:
% visit -cli
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Pseudocolor, hgslice)
DrawPlots()
v = View2DAttributes()
xmin, ymin = 0.5, 0.5
v.viewportCoords = (xmin, 0.95, ymin, 0.95)
v.windowCoords = (-5.0, 0.0, 1.02, 5.9)
SetView2D(v)
209
View3DAttributes
Type
Default value
viewNormal
tuple of
float
(0, 0, 1)
focus
tuple of
float
(0, 0, 0)
viewUp
tuple of
float
(0, 1, 0)
viewAngle
float
30.0
parallelScale
float
0.5
nearPlane
float
-0.5
farPlane
float
0.5
imagePan
tuple of
float
(0.0, 0.0)
imageZoom
float
1.0
perspective
int
eyeAngle
float
2.0
centerOfRotationSet
int
centerOfRotation
tuple of
float
Description:
The View3DAttributes function is used to create View3DAttributes objects which are then passed
to the SetView3D function to set the view when the visualization window is in 3D. Note that
View3DAttributes can be used in arithmetic expressions so you can add views together, multiply
them by a scale factor, etc. You can even interpolate views (e.g. view0 * (1. - t) + view1 * t).
Example:
OpenDatabase(/usr/gapps/visit/data/noise.silo)
AddPlot(Contour, hardyglobal)
DrawPlots()
210
View3DAttributes
211
WindowInformation
212
Field
Type
Default value
activeSource
string
notset
activeTimeSlider
int
-1
timeSliders
tuple of
string
()
timeSliderCurrentStates
tuple of int
()
animationMode
int
windowMode
int
boundingBoxNavigate
int
spin
int
fullFrame
int
perspective
int
lockView
int
lockTools
int
lockTime
int
viewExtentsType
int
viewDimension
int
viewKeyframes
tuple of int
()
cameraViewMode
int
usingScalableRendering
int
lastRenderMin
float
0.0
WindowInformation
Field
Type
Default value
lastRenderAvg
float
0.0
lastRenderMax
float
0.0
numTriangles
int
extents
tuple of
float
(-FLTMAX,FLTMAX,-FLTMAX,FLTMAX,-FLTMAX,FLTMAX)
Description:
The WindowInformation function is used to create WindowInformation objects. For an initialized
WindowInformation object, use the GetWindowInformation function. WindowInformation objects
allow you to inspect some of VIsIts state for the active window and you can use this state information to influence the control flow of your scripts.
Example 1:
% visit -cli
path = /usr/gapps/visit/data/
dbs = (path + dbA00.pdb, path + dbB00.pdb, path + dbC00.pdb)
for db in dbs:
OpenDatabase(db)
AddPlot(FilledBoundary, material(mesh))
DrawPlots()
CreateDatabaseCorrelation(common, dbs, 1)
# Use the WindowInformation to get the list of time sliders.
tsNames = GetWindowInformation().timeSliders
for ts in tsNames:
SetActiveTimeSlider(ts)
for state in list(range(TimeSliderGetNStates())) + [0]:
SetTimeSliderState(state)
DeleteAllPlots()
Example 2:
OpenDatabase(path + noise.silo)
AddPlot(Pseudocolor, hardyglobal)
DrawPlots()
v = GetView3D()
v.viewNormal = (-0.700661, 0.379712, 0.604064)
v.viewUp = (0.248662, 0.923501, -0.292083)
SetView3D(v)
# Get the window information so we have the extents.
w = GetWindowInformation()
ToggleMaintainViewMode()
zmin = w.extents[4]
213
WindowInformation
zmax = w.extents[5]
AddOperator(Slice)
s = SliceAttributes()
s.project2d = 0
s.originType = s.Point
s.normal = (0,0,1)
s.upAxis = (0,1,0)
nSteps = 50
# Use the extents to slice from zmin to zmax.
for i in range(nSteps):
t = float(i) / float(nSteps - 1)
s.originPoint = (0.0, 0.0, (1.0 - t) * zmin + t * zmax)
SetOperatorOptions(s)
214
Chapter 6
1.0
Overview
VisIts Python Interface contains many objects that allow plot plugin attributes to be set
programmatically. These objects are new Python types that contain groups of attributes
that are used by plots to control the look and feel of the plots. Plot objects, which are
covered in this chapter, are used to simplify the interface to the functions in the VisIt
Python Interface and they also make convenient return values for functions that return
information about VisIts plots.
2.0
215
BoundaryAttributes
Type
Default value
colorType
int
ColorByMultipleColors
Possible values: ColorBySingleColor,
ColorByMultipleColors, ColorByColorTable
colorTableName
string
Default
filledFlag
int
legendFlag
int
lineStyle
int
lineWidth
int
singleColor
tuple of int
(0, 0, 0, 255)
boundaryNames
tuple of int
()
boundaryType
int
Unknown
Possible values: Domain, Group, Material, Unknown
opacity
float
1.0
wireframe
int
smoothingLevel
int
pointSize
float
0.05
pointType
int
Box
Possible values: Box, Axis, Icosahedron,
Point
216
pointSizeVarEnabled
int
pointSizeVar
string
default
BoundaryAttributes
Description:
The BoundaryAttributes function is used to create BoundaryAttributes objects that can be fed to
the SetPlotOptions function in order to set the attributes for Boundary plots.
217
ContourAttributes
Type
Default value
colorTableName
string
Default
colorType
int
ColorByMultipleColors
Possible values: ColorBySingleColor,
ColorByMultipleColors, ColorByColorTable
contourMethod
int
Level
Possible values: Level, Value, Percent
contourNLevels
int
10
contourPercent
tuple of
float
()
contourValue
tuple of
float
()
legendFlag
int
lineStyle
int
lineWidth
int
max
float
1.0
maxFlag
min
minFlag
scaling
int
Linear
Possible values: Linear, Log
218
singleColor
tuple of int
(255, 0, 0, 255)
wireframe
int
ContourAttributes
Description:
The ContourAttributes function is used to create ContourAttributes objects that can be fed to the
SetPlotOptions function in order to set the attributes for Contour plots.
219
CurveAttributes
Type
Default value
color
tuple of int
(0,0,0,255)
lineStyle
int
lineWidth
int
pointSize
float
5.0
showLabels
int
showPoints
int
Description:
The CurveAttributes function is used to create CurveAttributes objects that can be fed to the SetPlotOptions function in order to set the attributes for Curve plots.
220
FilledBoundaryAttributes
Type
Default value
colorType
int
ColorByMultipleColors
Possible values: ColorBySingleColor,
ColorByMultipleColors, ColorByColorTable
colorTableName
string
Default
filledFlag
int
legendFlag
int
lineStyle
int
lineWidth
int
singleColor
tuple of int
(0,0,0,255)
boundaryType
int
Unknown
Possible values: Domain, Group, Material, Unknown
opacity
float
1.0
wireframe
int
drawInternal
int
smoothingLevel
int
cleanZonesOnly
int
mixedColor
tuple of int
pointSize
float
0.05
pointType
int
Box
Possible values: Box, Axis, Icosahedron,
Point
pointSizeVarEnabled
int
pointSizeVar
string
default
221
FilledBoundaryAttributes
Description:
The FilledBoundaryAttributes function is used to create FilledBoundaryAttributes objects that can
be fed to the SetPlotOptions function in order to set the attributes for FilledBoundary plots.
222
HistogramAttributes
Type
Default value
specifyRange
int
min
float
0.0
max
float
1.0
outputType
int
Block
Possible values: Curve, Block
numBins
int
32
twoDAmount
int
RevolvedVolume
Possible values: Area, RevolvedVolume
lineStyle
int
lineWidth
int
color
tuple of int
(0, 0, 0, 255)
Description:
The HistogramAttributes function is used to create HistogramAttributes objects that can be fed to
SetPlotOptions function in order to set the attributes for Histogram plots.
223
LabelAttributes
Type
Default value
legendFlag
int
showNodes
int
showCells
int
restrictNumberOfLabels
int
drawLabelsFacing
int
Front
Possible values: Front, Back, FrontAndBack
showSingleNode
int
showSingleCell
int
useForegroundTextColor
int
labelDisplayFormat
int
Natural
Possible values: Natural, LogicalIndex,
Index
numberOfLabels
int
200
textColor
tuple of int
(255, 0, 0, 255)
textHeight
float
0.02
textLabel
string
horizontalJustification
int
HCenter
Possible values: HCenter, Left, Right
verticalJustification
int
VCenter
Possible values: VCenter, Top, Bottom
224
singleNodeIndex
int
singleCellIndex
int
LabelAttributes
Description:
The LabelAttributes function is used to create LabelAttributes objects that can be fed to the SetPlotOptions function in order to set the attributes for Label plots.
225
MeshAttributes
Type
Default value
legendFlag
int
lineStyle
int
lineWidth
int
meshColor
tuple of int
(0,0,0,255)
outlineOnlyFlag
int
errorTolerance
float
0.01
opaqueMode
int
Auto
Possible values: Auto, On, Off
pointSize
float
0.05
opaqueColor
tuple of int
backgroundFlag
int
foregroundFlag
int
smoothingLevel
int
None
Possible values: None, Fast, High
pointSizeVarEnabled
int
pointSizeVar
string
default
pointType
int
Box
Possible values: Box, Axis, Icosahedron,
Point
showInternal
int
Description:
The MeshAttributes function is used to create MeshAttributes objects that can be fed to the SetPlotOptions function in order to set the attributes for Mesh plots.
226
PseudocolorAttributes
Type
Default value
legendFlag
int
lightingFlag
int
minFlag
int
maxFlag
int
centering
int
Natural
Possible values: Natural, Nodal, Zonal
scaling
int
Linear
Possible values: Linear, Log, Skew
limitsMode
int
min
float
0.0
max
float
1.0
pointSize
float
0.05
pointType
int
Box
Possible values: Box, Axis, Icosahedron,
Point
skewFactor
float
1.0
opacity
float
1.0
colorTableName
string
hot
smoothingLevel
float
pointSizeVarEnabled
int
pointSizeVar
string
default
Description:
The PseudocolorAttributes function is used to create PseudocolorAttributes objects that can be fed
to the SetPlotOptions function in order to set the attributes for Pseudocolor plots.
227
ScatterAttributes
Type
Default value
var1Role
int
Coordinate0
Possible values: Coordinate0,
Coordinate1, Coordinate2, Color, None
var1MinFlag
int
var1MaxFlag
int
var1Min
float
0.0
var1Max
float
0.0
var1Scaling
int
Linear
Possible values: Linear, Log, Skew
var1SkewFactor
float
1.0
var2Role
int
Coordinate1
Possible values: Coordinate0,
Coordinate1, Coordinate2, Color, None
var2
string
default
var2MinFlag
int
var2MaxFlag
int
var2Min
float
0.0
var2Max
float
1.0
var2Scaling
int
Linear
Possible values: Linear, Log, Skew
var2SkewFactor
float
1.0
var3Role
int
None
Possible values: Coordinate0,
Coordinate1, Coordinate2, Color, None
228
var3
string
default
var3MinFlag
int
ScatterAttributes
Field
Type
Default value
var3MaxFlag
int
var3Min
float
0.0
var3Max
float
1.0
var3Scaling
int
Linear
Possible values: Linear, Log, Skew
var3SkewFactor
float
1.0
var4Role
int
None
Possible values: Coordinate0,
Coordinate1, Coordinate2, Color, None
var4
string
default
var4MinFlag
int
var4MaxFlag
int
var4Min
float
0.0
var4Max
float
1.0
var4Scaling
int
Linear
Possible values: Linear, Log, Skew
var4SkewFactor
float
1.0
pointSize
float
0.05
pointType
int
Point
Possible values: Box, Axis, Icosahedron,
Point
scaleCube
int
colorTableName
string
hot
singleColor
tuple of int
(255,0,0,255)
foregroundFlag
int
legendFlag
int
Description:
The ScatterAttributes function is used to create ScatterAttributes objects that can be fed to the SetPlotOptions function in order to set the attributes for Scatter plots.
229
StreamlineAttributes
Type
Default value
sourceType
int
SpecifiedPoint
Possible values: SpecifiedPoint, SpecifiedLine, SpecifiedPlane, SpecifiedSphere, SpecifiedBox
stepLength
float
1.0
maxTime
float
10.0
pointSource
tuple of
float
lineStart
tuple of
float
lineEnd
tuple of
float
planeOrigin
tuple of
float
planeNormal
tuple of
float
planeUpAxis
tuple of
float
planeRadius
float
1.0
sphereOrigin
tuple of
float
sphereRadius
float
1.0
boxExtents
tuple of
float
pointDensity
int
displayMethod
int
Lines
Possible values: Lines, Tubes, Ribbons
showStart
230
int
StreamlineAttributes
Field
Type
Default value
radius
float
0.125
lineWidth
int
coloringMethod
int
ColorBySpeed
Possible values: Solid, ColorBySpeed,
ColorByVorticity
colorTableName
string
Default
singleColor
tuple of int
(0, 0, 0, 255)
legendFlag
int
lightingFlag
int
Description:
The StreamlineAttributes function is used to create StreamlineAttributes objects that can be fed to
the SetPlotOptions function in order to set the attributes for Streamline plots.
231
SubsetAttributes
Type
Default value
colorType
int
colorTableName
string
Default
filledFlag
int
legendFlag
int
lineStype
int
lineWidth
int
singleColor
tuple of int
(0,0,0,255)
subsetType
int
Unknown
Possible values: Domain, Group, Material, Unknown
opacity
float
1.0
wireframe
int
drawInternal
int
smoothingLevel
int
pointSize
float
0.05
pointType
int
Box
Possible values: Box, Axis, Icosahedron,
Point
pointSizeVarEnabled
int
pointSizeVar
string
default
Description:
The SubsetAttributes function is used to create SubsetAttributes objects that can be fed to the SetPlotOptions function in order to set the attributes for Subset plots.
232
SurfaceAttributes
Type
Default value
colorByZFlag
int
colorTableName
string
Default
legendFlag
int
lightingFlag
int
limitsMode
int
OriginalData
Possible values: OriginalData, CurrentPlot
lineStyle
int
lineWidth
int
max
maxFlag
1.0
int
min
0
0.0
minFlag
int
scaling
int
Linear
Possible values: Linear, Log, Skew
skewFactor
float
1.0
surfaceColor
tuple of int
(0, 0, 0, 255)
surfaceFlag
int
wireframeColor
tuple of int
(0, 0, 0, 255)
wireframeFlag
int
Description:
The SurfaceAttributes function is used to create SurfaceAttributes objects that can be fed to the
SetPlotOptions function in order to set the attributes for Surface plots.
233
TensorAttributes
Type
Default value
useStride
int
stride
int
nTensors
int
400
scale
float
0.25
scaleByMagnitude
int
autoScale
int
colorByEigenvalues
int
useLegend
int
tensorColor
tuple of int
(0, 0, 0, 255)
colorTableName
string
Default
Description:
The TensorAttributes function is used to create TensorAttributes objects that can be fed to the SetPlotOptions function in order to set the attributes for Tensor plots.
234
VectorAttributes
Type
Default value
useStride
int
stride
int
nVectors
int
400
lineStyle
int
lineWidth
int
scale
float
0.25
scaleByMagnitude
int
autoScale
int
headSize
float
0.25
headOn
int
colorByMag
int
useLegend
int
vectorColor
tuple of int
(0, 0, 0, 255)
colorTableName
string
Default
vectorOrigin
int
Tail
Possible values: Head, Middle, Tail
minFlag
int
maxFlag
int
limitsMode
int
OriginalData
Possible values: OriginalData, CurrentPlot
min
float
0.0
max
float
1.0
235
VectorAttributes
Description:
The VectorAttributes function is used to create VectorAttributes objects that can be fed to the SetPlotOptions function in order to set the attributes for Vector plots.
236
VolumeAttributes
Type
Default value
legendFlag
int
lightingFlag
int
opacityAttenuation
float
1.0
freeformFlag
int
resampleTarget
int
50000
opacityVariable
string
default
freeformOpacity
tuple of int
useColorVarMin
int
colorVarMin
float
0.0
useColorVarMax
int
colorVarMax
float
1.0
useOpacityVarMin
int
opacityVarMin
float
0.0
useOpacityVarMax
int
opacityVarMax
float
0.0
smoothData
int
samplesPerRay
int
500
rendererType
int
Splatting
Possible values: Splatting, Texture3D,
RayCasting
gradientType
int
SobelOperator
Possible values: CenteredDifferences,
SobelOperator
num3DSlices
int
200
237
VolumeAttributes
Description:
The VolumeAttributes function is used to create VolumeAttributes objects that can be fed to the
SetPlotOptions function in order to set the attributes for Volume plots.
238
Chapter 7
1.0
Overview
VisIts Python Interface contains many objects that allow operator plugin attributes to be
set programmatically. These objects are new Python types that contain groups of attributes
that are used by operators to control how they process data. Operator objects, which are
covered in this chapter, are used to simplify the interface to the functions in the VisIt
Python Interface and they also make convenient return values for functions that return
information about VisIts operators.
2.0
239
BoxAttributes
Type
Default value
amount
int
maxx
float
1.0
maxy
float
1.0
maxz
float
1.0
minx
float
0.0
miny
float
0.0
minz
float
0.0
Description:
The BoxAttributes function is used to create BoxAttributes objects that can be fed to the SetOperatorOptions function in order to set the attributes for Box operators.
240
ClipAttributes
Type
Default value
center
tuple of
float
funcType
int
Plane
Possible values: Plane, Sphere
plane1Normal
tuple of
float
plane1Origin
tuple of
float
plane1Status
int
plane2Normal
tuple of
float
plane2Origin
tuple of
float
plane2Status
int
plane3Normal
tuple of
float
plane3Origin
tuple of
float
plane3Status
int
planeInverse
int
radius
float
1.0
sphereInverse
int
Description:
The ClipAttributes function is used to create ClipAttributes objects that can be fed to the SetOperatorOptions function in order to set the attributes for Clip operators.
241
ConeAttributes
Type
Default value
angle
float
45.0
cutByLength
int
length
float
1.0
normal
tuple of
float
origin
tuple of
float
representation
int
upAxis
tuple of
float
Description:
The ConeAttributes function is used to create ConeAttributes objects that can be fed to the SetOperatorOptions function in order to set the attributes for Cone operators.
242
CylinderAttributes
Type
Default value
point1
tuple of
float
point2
tuple of
float
radius
float
1.0
Description:
The CylinderAttributes function is used to create CylinderAttributes objects that can be fed to the
SetOperatorOptions function in order to set the attributes for Cylinder operators.
243
DisplaceAttributes
Type
Default value
factor
float
1.0
variable
string
"DISPL"
Description:
The DisplaceAttributes function is used to create DisplaceAttributes objects that can be fed to the
SetOperatorOptions function in order to set the attributes for Displace operators.
244
IndexSelectAttributes
Type
Default value
dim
int
domainIndex
int
groupIndex
int
whichData
int
xIncr
int
xMax
int
-1
xMin
int
yIncr
int
yMax
int
-1
yMin
int
zIncr
int
zMax
int
-1
zMin
int
Description:
The IndexSelectAttributes function is used to create IndexSelectAttributes objects that can be fed
to the SetOperatorOptions function in order to set the attributes for IndexSelect operators.
245
InverseGhostZoneAttributes
Type
Default value
showType
int
GhostZonesOnly
Possible values: GhostZonesOnly, GhostZonesAndRealZones
Description:
The InverseGhostZoneAttributes function is used to create InverseGhostZoneAttributes objects
that can be fed to the SetOperatorOptions function in order to set the attributes for InverseGhostZone operators.
246
IsosurfaceAttributes
Type
Default value
contourMethod
int
Level
Possible values: Level, Value, Percent
contourNLevels
int
10
contourPercent
tuple of
float
()
contourValue
tuple of
float
()
max
float
1.0
maxFlag
int
min
float
0.0
minFlag
int
scaling
int
Linear
Possible values: Linear, Log
variable
string
default
Description:
The IsosurfaceAttributes function is used to create IsosurfaceAttributes objects that can be fed to
the SetOperatorOptions function in order to set the attributes for Isosurface operators.
247
IsovolumeAttributes
Type
Default value
lbound
float
-1e+37
ubound
float
1e+37
variable
string
default
Description:
The IsovolumeAttributes function is used to create IsovolumeAttributes objects that can be fed to
the SetOperatorOptions function in order to set the attributes for Isovolume operators.
248
LineoutAttributes
Type
Default value
point1
tuple of
float
point2
tuple of
float
interactive
int
ignoreGlobal
int
samplingOn
int
numberOfSamplePoints
int
50
reflineLabels
int
Description:
The LineoutAttributes function is used to create LineoutAttributes objects that can be fed to the
SetOperatorOptions function in order to set the attributes for Lineout operators.
249
OnionPeelAttributes
Type
Default value
adjacencyType
int
useGlobalId
int
categoryName
string
Whole
subsetName
string
Whole
index
tuple of int
(1)
logical
int
requestedLayer
int
Description:
The OnionPeelAttributes function is used to create OnionPeelAttributes objects that can be fed to
the SetOperatorOptions function in order to set the attributes for OnionPeel operators.
250
ProjectAttributes
Type
Default value
projectionType
int
XYCartesian
Possible values: XYCartesian, ZRCylindrical
Description:
The ProjectAttributes function is used to create ProjectAttributes objects that can be fed to the SetOperatorOptions function in order to set the attributes for Project operators.
251
ReflectAttributes
Type
Default value
octant
int
PXPYPZ
Possible values: PXPYPZ, NXPYPZ,
PXNYPZ, NXNYPZ, PXPYNZ,
NXPYNZ, PXNYNZ, NXNYNZ
reflections
tuple of int
(1, 0, 1, 0, 0, 0, 0, 0)
specifiedX
float
0.0
specifiedY
float
0.0
specifiedZ
float
0.0
useXBoundary
int
useYBoundary
int
useZBoundary
int
Description:
The ReflectAttributes function is used to create ReflectAttributes objects that can be fed to the SetOperatorOptions function in order to set the attributes for Reflect operators.
252
RevolveAttributes
Type
Default value
axis
tuple of
float
startAngle
float
0.0
steps
int
30
stopAngle
float
360.0
Description:
The RevolveAttributes function is used to create RevolveAttributes objects that can be fed to the
SetOperatorOptions function in order to set the attributes for Revolve operators.
253
SliceAttributes
Type
Default value
originType
int
Intercept
Possible values: Point, Intercept, Percent,
Zone, Node
originPoint
tuple of
float
originIntercept
float
0.0
originPercent
float
0.0
originZone
int
originNode
int
normal
tuple of
float
axisType
int
YAxis
Possible values: XAxis, YAxis, ZAxis,
Arbitrary
upAxis
tuple of
float
project2d
int
interactive
int
flip
int
originZoneDomain
int
originNodeDomain
int
Description:
The SliceAttributes function is used to create SliceAttributes objects that can be fed to the SetOperatorOptions function in order to set the attributes for Slice operators.
254
SphereSliceAttributes
Type
Default value
origin
tuple of
float
radius
float
1.0
Description:
The SphereSliceAttributes function is used to create SphereSliceAttributes objects that can be fed
to the SetOperatorOptions function in order to set the attributes for SphereSlice operators.
255
ThreeSliceAttributes
Type
Default value
interactive
int
float
0.0
float
0.0
float
0.0
Description:
The ThreeSliceAttributes function is used to create ThreeSliceAttributes objects that can be fed to
the SetOperatorOptions function in order to set the attributes for ThreeSlice operators.
256
ThresholdAttributes
Type
Default value
amount
int
lbound
float
-1e+37
ubound
float
1e+37
variable
string
default
Description:
The ThresholdAttributes function is used to create ThresholdAttributes objects that can be fed to
the SetOperatorOptions function in order to set the attributes for Threshold operators.
257
TransformAttributes
Type
Default value
doRotate
int
doScale
int
doTranslate
int
rotateAmount
float
0.0
rotateAxis
tuple of
float
rotateOrigin
tuple of
float
rotateType
int
scaleOrigin
tuple of
float
scaleX
float
1.0
scaleY
float
1.0
scaleZ
float
1.0
translateX
float
0.0
translateY
float
0.0
translateZ
float
0.0
Description:
The TransformAttributes function is used to create TransformAttributes objects that can be fed to
the SetOperatorOptions function in order to set the attributes for Transform operators.
258
Appendix A
Ap p e n d i x A
A.1
Program options
-cli
-gui
-movie
Run with the Command Line Interface in movie making mode where
there is no window. You must also provide the -sessionfile or -s arguments when -movie is specified.
Additional programs
Program description
convert
Run the VisIt database conversion tool, which can read in a data file in
one of VisIts supported formats and write it back out in another supported VisIt database format that supports writing new files through
VisIts plugin interface. The convert tool is currently used primarily as
a tool to convert non-Silo files into Silo files.
makemili
Run the makemili program that creates a .mili root file that allows VisIt
to read Mili files.
259
Appendix A
Additional programs
Program description
mpeg_encode
Run the mpeg_encode software that is bundled with the UNIX versions
of VisIt.
silex
xmledit
xml2plugin
xmltest
xml2atts
Runs VisIts XML plugin attribute generator which produces C++ code
from an XML description of a state object.
xml2avt
xml2info
Runs VisIts XML plugin code generator for plugin skeleton C++ code.
xml2java
xml2makefile
xml2projectfile
Runs VisIts XML plugin MSVC++ 6.0 project file generator. This component is only distributed in the MS Windows version of VisIt.
xml2python
xml2window
Runs VisIts XML plugin GUI window generator for plot and operator
attribute windows.
Version options
-beta
-dir <directory>
-v <version>
Parallel options
-b <bank>
260
Bank from which to draw resources. Only applies when using a launch
program that operates in a batch environment.
Appendix A
Parallel options
-expedite
Makes psub and other launch programs give priority to your job when
scheduling your job to run. You must have expedite privileges for this
option to take effect.
-l <method>
Launch VisIts compute engine in parallel using the given launch program. Accepted launch programs are: bsub, dmpirun, mpirun, poe,
prun, psub, srun, yod. Be sure to use the launch program that is appropriate for the computer where you want to run VisIt in parallel.
-la <args>
-n <jobname>
-nn <numnodes>
-np <numprocessors>
-p <partition>
-par
-pl <method>
-t <timelimit>
Window options
-background <color>
Background color for the graphical user interface. The color can consist of either a color name or an RGB triplet. For example, the color red
could be specified as -background red or -background
#ff0000.
-foreground <color>
Foreground color for the graphical user interface. The color can consist
of either a color name or an RGB triplet. For example, the color red
could be specified as -background red or -background
#ff0000.
-geometry <spec>
The portion of the screen to use. This is a standard X Windows geometry specification. For example 500x500+300+0, indicates an area 500
pixels by 500 pixels, 300 pixels to the right of the top left corner.
-noconfig
Run without reading any configuration files. This can be useful if you
run VisIt and encounter unexpected behavior on startup.
-nowin
Run without any windows. This option may be useful when running
scripts.
-small
-style <style>
The style to use for the graphical user interface. One of windows,
261
Appendix A
File options
-o <databasename>
-s <scriptname>
Run the specified VisIt script. Note that this option only takes effect
with the -cli option.
-default_format <format>
Tells VisIt to use the specified database reader plugin when reading
files. This is a useful option if your data files do not have file extensions,
since VisIt is able to open the file on the first try instead of having to
sequentially try all of its database reader plugins until one of them can
successfully open the file. To make VisIt use the Silo plugin first to open
files, add: -default_format Silo to the command line.
-sessionfile <filename>
Run VisIt and have it open the specified session file, which will cause
VisIt to restore its state to what is stored in the session file. This argument is only valid with the -gui or -movie arguments.
Debugging options
-debug <level>
-timing
Run with timings. Timings are provided for the execution of each
major portion of the execution pipeline on the viewer and each engine
process. Timing information for launch time is also provided for the gui
and viewer processes.
-dump
This argument causes VisIt to write VTK files for each stage of the execution pipeline so you can see the output of each VTK filter.
-verbose
This argument causes VisIts CLI to print out the stages of execution
for its compute engine to the console.
262
A
ActivateDatabase 32
AddArgument 26
Adding operators 17
AddOperator 17, 33
AddPlot 15, 34
AddWindow 35
AlterDatabaseCorrelation 36
AnnotationAttributes 192
B
BoundaryAttributes 216
BoxAttributes 240
C
CheckForNewStates 38
ChooseCenterOfRotation 39
ClearAllWindows 41
ClearCache 40
ClearCacheForAllEngines 40
ClearReferenceLines 43
ClearViewKeyframes 44
ClearWindow 41
ClipAttributes 241
Close 27
CloseComputeEngine 46
CloseDatabase 47
ColorTableNames 48
ConeAttributes 242
ContourAttributes 218
Control flow 7
CopyAnnotationsToWindow 49
CopyLightingToWindow 49
CopyPlotsToWindow 49
CopyViewTowindow 49
CreateAnnotationObject 50
CreateDatabaseCorrelation 51
Creating a plot 15
CurveAttributes 220
CylinderAttributes 243
D
DefineMaterialExpression 53
DefineMeshExpression 53
DefineScalarExpression 18, 53
DefineSpeciesExpression 53
DefineVectorExpression 53
Defining expressions 18
Defining functions 9
DeIconifyAllWindows 54
DeleteActivePlots 55
DeleteAllPlots 55
DeleteDatabaseCorrelation 56
DeleteExpression 57
DeletePlotDatabaseKeyframe 58
DeletePlotKeyframe 59
DeleteViewKeyframe 61
DeleteWindow 62
DemoteOperator 63
Dictionaries 7
DisableRedraw 64
DisplaceAttributes 244
DrawPlots 17, 65
cclxiii
E
EnabledTool 66
EvalCubic 67
EvalCubicSpline 22, 68
EvalLinear 69
EvalQuadratic 70
Expressions 71
F
FilledBoundaryAttributes 221
Finding the min and the max 20
Flying around plots 22
For loop 8
G
GetActiveContinuousColorTable 72
GetActiveDiscreteColorTable 72
GetActiveTimeSlider 73
GetAnimationNumStates 75
GetAnnotationAttributes 76
GetAnnotationObject 77
GetDatabaseNStates 78
GetDebugLevel 30
GetDomains 79
GetEngineList 80
GetGlobalAttributes 81
GetGlobalLineoutAttributes 82
GetInteractorAttributes 83
GetKeyframeAttributes 84
GetLastError 85
GetLight 86
GetLocalHostName 87
GetLocalUserName 87
GetMaterialAttributes 88
GetMaterials 89
GetNumPlots 90
GetPickAttributes 91
GetPickOutput 19, 92
GetPipelineCachingMode 93
GetQueryOutputString 94
GetQueryOutputValue 94
GetQueryOverTimeAttributes 95
GetRenderingAttributes 96
GetSaveWindowAttributes 97
GetTimeSliders 98
Getting something on the screen 12
GetView2D 99
GetView3D 22, 99
GetViewCurve 99
GetWindowInformation 100
GlobalAttributes 196
H
HideActivePlots 101
HideToolbars 102
HistogramAttributes 223
I
IconifyAllWindows 103
Identifiers 6
if/elif/else 8
cclxiv
Indentation 5
IndexSelectAttributes 245
InverseGhostZoneAttributes 246
IsosurfaceAttributes 247
IsovolumeAttributes 248
N
NodePick 113
NumColorTableNames 114
NumOperatorPlugins 115
NumPlotPlugins 116
L
LabelAttributes 224
Launch 28
LaunchNowin 28
LightAttributes 198
Lineout 19, 105
LineoutAttributes 249
ListPlots 107
Lists 7
LocalNamespace 29
LongFileName 108
O
OnionPeelAttributes 250
OpenComputeEngine 14, 46, 117
OpenDatabase 13, 14, 118
Opening a compute engine 14
Opening a database 13
Opening a database at late time 13
Opening a remote database 14
Opening a virtual database 14
OpenMDServer 119
OperatorPlugins 33, 120
OverlayDatabase 121
M
Manual chapters 1
MaterialAttributes 199
MeshAttributes 226
MovePlotDatabaseKeyframe 109
MovePlotKeyframe 110
MoveViewKeyframe 112
P
Pick 19, 122
PickByGlobalNode 123
PickByGlobalZone 124
PickByNode 125
PickByZone 126
PlotPlugins 34, 127
Plots in the error state 17
Plotting materials 15
PrinterAttributes 200
cclxv
PrintWindow 128
ProjectAttributes 251
PromoteOperator 129
PseudocolorAttributes 227
Q
Queries 130
QueriesOverTime 131
Query 132
QueryOverTime 133
R
rAttributes 228
RecenterView 134
RedrawWindow 135
ReflectAttributes 252
RemoveAllOperators 136
RemoveLastOperator 136
RemoveOperator 136
RenderingAttributes 201
ReOpenDatabase 137
ReplaceDatabase 138
ResetLineoutColor 139
ResetOperatorOptions 140
ResetPickAttributes 162
ResetPickLetter 141
ResetPlotOptions 142
ResetQueryOverTimeAttributes 169
ResetView 143
RestoreSession 144
RestoreSesssion 11
RevolveAttributes 253
S
SaveSession 145
SaveWindow 13, 146, 171
SaveWindowAttributes 13, 203
Saving an image 13
SetActiveContinuousColorTable 147
SetActiveDiscreteColorTable 147
SetActivePlots 16, 148
SetActiveTimeSlider 149
SetActiveWindow 150
SetAnnotationAttributes 152
SetCenterOfRotation 153
SetDatabaseCorrelationOptions 154
SetDebugLevel 30
SetDefaultAnnotationAttributes 152
SetDefaultInteractorAttributes 157
SetDefaultMaterialAttributes 160
SetDefaultOperatorOptions 161
SetDefaultPickAttributes 162
SetDefaultPlotOptions 166
SetDefaultQueryOverTimeAttributes 169
SetGlobalLineoutAttributes 156
SetInteractorAttributes 157
SetKeyframeAttributes 158
SetLight 159
SetMaterialAttributes 160
SetOperatorOptions 18, 161
SetPickAttributes 162
SetPlotDatabaseState 164
SetPlotFrameRange 165
SetPlotOptions 16, 166
SetPlotSILRestriction 167
SetPrinterAttributes 168
SetQueryOverTimeAttributes 169
SetRenderingAttributes 170
SetSaveWindowAttributes 146
SetTimeSliderState 172
Setting operator attributes 18
Setting plot attributes 15
Setting the 2D view 21
Setting the 3D view 22
Setting the output image characteristics 12
cclxvi
SetView2D 173
SetView3D 173
SetViewExtentsType 174
SetViewKeyframe 175
SetWindowArea 176
SetWindowMode 178
ShowAllWindows 179
ShowToolbars 180
SILRestriction 205
SliceAttributes 254
Source 181
SphereSliceAttributes 255
StreamlineAttributes 230
Strings 6
SubsetAttributes 232
SurfaceAttributes 233
U
UndoView 188
Using session files 11
V
T
TensorAttributes 234
ThreeSliceAttributes 256
ThresholdAttributes 257
TimeSliderGetNStates 182
TimeSliderNextState 183
TimeSliderPreviousState 184
ToggleBoundingBoxMode 185
ToggleCameraViewMode 185
ToggleFullFrameMode 185
ToggleLockTime 185
ToggleLockViewMode 185
ToggleMaintainDataMode 185
ToggleMaintainViewMode 185
ToggleSpinMode 185
TransformAttributes 258
Tuples 6
TurnDomainsOff 21, 187
TurnDomainsOn 21, 187
Turning off domains 21
Turning off materials 21
TurnMaterialsOff 21, 187
VectorAttributes 235
Version 31
View2DAttributes 209
View3DAttributes 210
ViewCurveAttributes 208
VolumeAttributes 237
W
While loop 9
WindowInformation 212
Working with multiple plots 16
WriteConfigFile 189
cclxvii
Z
ZonePick 122
cclxviii