Visit Python Interface Manual
Total Page:16
File Type:pdf, Size:1020Kb
VisIt Python Interface Manual Version 2.3.0 Contents 1 Introduction to VisIt1 1.1 Overview............................................1 1.2 Manual chapters........................................1 1.3 Understanding how VisIt works................................2 1.4 Starting VisIt..........................................2 1.5 Getting started.........................................3 2 Python 5 2.1 Overview............................................5 2.2 Indentation...........................................5 2.3 Comments............................................5 2.4 Identifiers............................................6 2.5 Data types...........................................6 2.5.1 Strings..........................................6 2.5.2 Tuples..........................................6 2.5.3 Lists...........................................7 2.5.4 Dictionaries.......................................7 2.6 Control flow...........................................7 2.6.1 if/elif/else........................................7 2.6.2 For loop.........................................8 2.6.3 While loop.......................................8 2.7 Functions............................................8 3 Quick Recipes 10 3.1 Overview............................................ 10 3.2 How to start.......................................... 10 3.2.1 Using session files................................... 10 3.2.2 Getting something on the screen........................... 11 3.3 Saving images.......................................... 11 3.3.1 Setting the output image characteristics....................... 11 3.3.2 Saving an image.................................... 12 3.4 Working with databases.................................... 12 3.4.1 Opening a database.................................. 12 3.4.2 Opening a database at late time........................... 12 3.4.3 Opening a virtual database.............................. 13 3.4.4 Opening a remote database.............................. 13 3.4.5 Opening a compute engine.............................. 13 3.5 Working with plots....................................... 13 3.5.1 Creating a plot..................................... 14 3.5.2 Plotting materials................................... 14 i CONTENTS CONTENTS 3.5.3 Setting plot attributes................................. 14 3.5.4 Working with multiple plots.............................. 15 3.5.5 Plots in the error state................................. 15 3.6 Operators............................................ 16 3.6.1 Adding operators.................................... 16 3.6.2 Setting operator attributes.............................. 16 3.7 Quantitative operations.................................... 17 3.7.1 Defining expressions.................................. 17 3.7.2 Pick........................................... 17 3.7.3 Lineout......................................... 18 3.7.4 Query.......................................... 18 3.7.5 Finding the min and the max............................. 18 3.8 Subsetting............................................ 19 3.8.1 Turning off domains.................................. 19 3.8.2 Turning off materials.................................. 19 3.9 View............................................... 20 3.9.1 Setting the 2D view.................................. 20 3.9.2 Setting the 3D view.................................. 20 3.9.3 Flying around plots.................................. 21 3.10 Working with annotations................................... 22 3.10.1 Using gradient background colors........................... 23 3.10.2 Adding a banner.................................... 23 3.10.3 Adding a time slider.................................. 24 3.10.4 Adding a logo...................................... 24 4 Functions available before Launch() 26 AddArgument.......................................... 27 GetDebugLevel......................................... 28 Launch............................................. 29 SetDebugLevel......................................... 30 5 Functions 31 ActivateDatabase........................................ 31 AddOperator.......................................... 32 AddPlot............................................. 33 AddWindow........................................... 34 AlterDatabaseCorrelation................................... 35 ApplyNamedSelection..................................... 36 ChangeActivePlotsVar..................................... 37 CheckForNewStates...................................... 38 ChooseCenterOfRotation................................... 39 ClearAllWindows........................................ 40 ClearCache........................................... 41 ClearCacheForAllEngines................................... 42 ClearMacros........................................... 43 ClearPickPoints......................................... 44 ClearReferenceLines...................................... 45 ClearViewKeyframes...................................... 46 ClearWindow.......................................... 47 CloneWindow.......................................... 48 Close............................................... 49 CloseComputeEngine...................................... 50 ii CONTENTS CONTENTS CloseDatabase......................................... 51 ColorTableNames........................................ 52 ConstructDataBinning..................................... 53 CopyAnnotationsToWindow.................................. 54 CopyLightingToWindow.................................... 55 CopyPlotsToWindow...................................... 56 CopyViewToWindow...................................... 57 CreateAnnotationObject.................................... 58 CreateDatabaseCorrelation.................................. 59 CreateNamedSelection..................................... 61 DeIconifyAllWindows..................................... 62 DefineArrayExpression..................................... 63 DefineCurveExpression..................................... 64 DefineMaterialExpression................................... 65 DefineMeshExpression..................................... 66 DefinePythonExpression.................................... 67 DefineScalarExpression..................................... 68 DefineSpeciesExpression.................................... 69 DefineTensorExpression.................................... 70 DefineVectorExpression.................................... 71 DeleteActivePlots........................................ 72 DeleteAllPlots......................................... 73 DeleteDatabaseCorrelation.................................. 74 DeleteExpression........................................ 75 DeleteNamedSelection..................................... 76 DeletePlotDatabaseKeyframe................................. 77 DeletePlotKeyframe...................................... 78 DeleteViewKeyframe...................................... 79 DeleteWindow......................................... 80 DemoteOperator........................................ 81 DisableRedraw......................................... 82 DrawPlots............................................ 83 EnableTool........................................... 84 ExecuteMacro.......................................... 85 ExportDatabase........................................ 86 Expressions........................................... 87 GetActiveContinuousColorTable............................... 88 GetActiveDiscreteColorTable................................. 89 GetActiveTimeSlider...................................... 90 GetAnimationAttributes.................................... 91 GetAnimationTimeout..................................... 92 GetAnnotationAttributes................................... 93 GetAnnotationObject..................................... 94 GetAnnotationObjectNames.................................. 95 GetCallbackArgumentCount.................................. 96 GetCallbackNames....................................... 97 GetDatabaseNStates...................................... 98 GetDefaultFileOpenOptions.................................. 99 GetDomains........................................... 100 GetEngineList......................................... 101 GetGlobalAttributes...................................... 102 GetGlobalLineoutAttributes.................................. 103 iii CONTENTS CONTENTS GetInteractorAttributes.................................... 104 GetKeyframeAttributes.................................... 105 GetLastError.......................................... 106 GetLight............................................. 107 GetLocalHostName....................................... 108 GetLocalUserName....................................... 109 GetMaterialAttributes..................................... 110 GetMaterials.......................................... 111 GetMeshManagementAttributes................................ 112 GetMetaData.......................................... 113 GetNumPlots.......................................... 114 GetOperatorOptions...................................... 115 GetPickAttributes....................................... 116 GetPickOutput......................................... 117 GetPipelineCachingMode................................... 118 GetPlotInformation....................................... 119 GetPlotList........................................... 120 GetPlotOptions......................................... 121 GetPreferredFileFormats...................................