Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
generate_frames.py
Go to the documentation of this file.
1# In order to use this script, you need to at least edit the lines with the following comment:
2# EDIT
3
4# For more information on the usage of this script:
5# https://github.com/fmihpc/vlasiator/wiki/Basic-movie-making-script-documentation,-using-VisIt-on-voima
6
7import sys
8
9fileName = "BCB_rho_" # EDIT
10outputLocation = "/lustre/tmp/alfthan/2D/BCB/visualizations/movies/rho/" # EDIT
11
12
13frameList = range(int(sys.argv[1]),int(sys.argv[2])+1)
14
15for entry in frameList:
16 number=str(entry).rjust(7, '0')
17 fileLocation="/lustre/tmp/alfthan/2D/BCB/bulk."+number+".vlsv" # EDIT
18 OpenDatabase(fileLocation)
19
20 AddPlot("Pseudocolor", "rho", 0, 1) # EDIT
21 AddOperator("Slice")
22 AddOperator("Threshold")
23 PseudocolorAtts = PseudocolorAttributes()
24 PseudocolorAtts.scaling = PseudocolorAtts.Linear # Linear, Log, Skew
25 PseudocolorAtts.skewFactor = 1
26 PseudocolorAtts.limitsMode = PseudocolorAtts.CurrentPlot # OriginalData, CurrentPlot
27 PseudocolorAtts.minFlag = 1
28 PseudocolorAtts.min = 100000 # EDIT
29 PseudocolorAtts.maxFlag = 1
30 PseudocolorAtts.max = 1e+07 # EDIT
31 PseudocolorAtts.centering = PseudocolorAtts.Natural # Natural, Nodal, Zonal
32 PseudocolorAtts.colorTableName = "hot_desaturated"
33 PseudocolorAtts.invertColorTable = 0
34 PseudocolorAtts.opacityType = PseudocolorAtts.FullyOpaque # ColorTable, FullyOpaque, Constant, Ramp, VariableRange
35 PseudocolorAtts.opacityVariable = ""
36 PseudocolorAtts.opacity = 1
37 PseudocolorAtts.opacityVarMin = 0
38 PseudocolorAtts.opacityVarMax = 1
39 PseudocolorAtts.opacityVarMinFlag = 0
40 PseudocolorAtts.opacityVarMaxFlag = 0
41 PseudocolorAtts.pointSize = 0.05
42 PseudocolorAtts.pointType = PseudocolorAtts.Point # Box, Axis, Icosahedron, Octahedron, Tetrahedron, SphereGeometry, Point, Sphere
43 PseudocolorAtts.pointSizeVarEnabled = 0
44 PseudocolorAtts.pointSizeVar = "default"
45 PseudocolorAtts.pointSizePixels = 2
46 PseudocolorAtts.lineType = PseudocolorAtts.Line # Line, Tube, Ribbon
47 PseudocolorAtts.lineStyle = PseudocolorAtts.SOLID # SOLID, DASH, DOT, DOTDASH
48 PseudocolorAtts.lineWidth = 0
49 PseudocolorAtts.tubeDisplayDensity = 10
50 PseudocolorAtts.tubeRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox
51 PseudocolorAtts.tubeRadiusAbsolute = 0.125
52 PseudocolorAtts.tubeRadiusBBox = 0.005
53 PseudocolorAtts.varyTubeRadius = 0
54 PseudocolorAtts.varyTubeRadiusVariable = ""
55 PseudocolorAtts.varyTubeRadiusFactor = 10
56 PseudocolorAtts.endPointType = PseudocolorAtts.None # None, Tails, Heads, Both
57 PseudocolorAtts.endPointStyle = PseudocolorAtts.Spheres # Spheres, Cones
58 PseudocolorAtts.endPointRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox
59 PseudocolorAtts.endPointRadiusAbsolute = 1
60 PseudocolorAtts.endPointRadiusBBox = 0.005
61 PseudocolorAtts.endPointRatio = 2
62 PseudocolorAtts.renderSurfaces = 1
63 PseudocolorAtts.renderWireframe = 0
64 PseudocolorAtts.renderPoints = 0
65 PseudocolorAtts.smoothingLevel = 0
66 PseudocolorAtts.legendFlag = 0
67 PseudocolorAtts.lightingFlag = 1
68 SetPlotOptions(PseudocolorAtts)
69
70 SliceAtts = SliceAttributes()
71 SliceAtts.originType = SliceAtts.Intercept # Point, Intercept, Percent, Zone, Node
72 SliceAtts.originPoint = (0, 0, 0)
73 SliceAtts.originIntercept = 0
74 SliceAtts.originPercent = 0
75 SliceAtts.originZone = 0
76 SliceAtts.originNode = 0
77 SliceAtts.normal = (0, 1, 0)
78 SliceAtts.axisType = SliceAtts.YAxis # XAxis, YAxis, ZAxis, Arbitrary, ThetaPhi
79 SliceAtts.upAxis = (0, 0, 1)
80 SliceAtts.project2d = 1
81 SliceAtts.interactive = 1
82 SliceAtts.flip = 0
83 SliceAtts.originZoneDomain = 0
84 SliceAtts.originNodeDomain = 0
85 SliceAtts.meshName = "SpatialGrid"
86 SliceAtts.theta = 0
87 SliceAtts.phi = 90
88 SetOperatorOptions(SliceAtts)
89
90 ThresholdAtts = ThresholdAttributes()
91 ThresholdAtts.outputMeshType = 0
92 ThresholdAtts.listedVarNames = ("Boundary_type")
93 ThresholdAtts.zonePortions = (1)
94 ThresholdAtts.lowerBounds = (1)
95 ThresholdAtts.upperBounds = (1)
96 ThresholdAtts.defaultVarName = "rho"
97 ThresholdAtts.defaultVarIsScalar = 1
98 SetOperatorOptions(ThresholdAtts)
99
100 # Logging for SetAnnotationObjectOptions is not implemented yet.
101 AnnotationAtts = AnnotationAttributes()
102 AnnotationAtts.axes2D.visible = 1
103 AnnotationAtts.axes2D.autoSetTicks = 1
104 AnnotationAtts.axes2D.autoSetScaling = 1
105 AnnotationAtts.axes2D.lineWidth = 0
106 AnnotationAtts.axes2D.tickLocation = AnnotationAtts.axes2D.Outside # Inside, Outside, Both
107 AnnotationAtts.axes2D.tickAxes = AnnotationAtts.axes2D.BottomLeft # Off, Bottom, Left, BottomLeft, All
108 AnnotationAtts.axes2D.xAxis.title.visible = 1
109 AnnotationAtts.axes2D.xAxis.title.font.font = AnnotationAtts.axes2D.xAxis.title.font.Courier # Arial, Courier, Times
110 AnnotationAtts.axes2D.xAxis.title.font.scale = 1
111 AnnotationAtts.axes2D.xAxis.title.font.useForegroundColor = 1
112 AnnotationAtts.axes2D.xAxis.title.font.color = (0, 0, 0, 255)
113 AnnotationAtts.axes2D.xAxis.title.font.bold = 1
114 AnnotationAtts.axes2D.xAxis.title.font.italic = 1
115 AnnotationAtts.axes2D.xAxis.title.userTitle = 0
116 AnnotationAtts.axes2D.xAxis.title.userUnits = 0
117 AnnotationAtts.axes2D.xAxis.title.title = "X-Axis"
118 AnnotationAtts.axes2D.xAxis.title.units = ""
119 AnnotationAtts.axes2D.xAxis.label.visible = 1
120 AnnotationAtts.axes2D.xAxis.label.font.font = AnnotationAtts.axes2D.xAxis.label.font.Courier # Arial, Courier, Times
121 AnnotationAtts.axes2D.xAxis.label.font.scale = 1
122 AnnotationAtts.axes2D.xAxis.label.font.useForegroundColor = 1
123 AnnotationAtts.axes2D.xAxis.label.font.color = (0, 0, 0, 255)
124 AnnotationAtts.axes2D.xAxis.label.font.bold = 1
125 AnnotationAtts.axes2D.xAxis.label.font.italic = 1
126 AnnotationAtts.axes2D.xAxis.label.scaling = 0
127 AnnotationAtts.axes2D.xAxis.tickMarks.visible = 1
128 AnnotationAtts.axes2D.xAxis.tickMarks.majorMinimum = 0
129 AnnotationAtts.axes2D.xAxis.tickMarks.majorMaximum = 1
130 AnnotationAtts.axes2D.xAxis.tickMarks.minorSpacing = 0.02
131 AnnotationAtts.axes2D.xAxis.tickMarks.majorSpacing = 0.2
132 AnnotationAtts.axes2D.xAxis.grid = 0
133 AnnotationAtts.axes2D.yAxis.title.visible = 1
134 AnnotationAtts.axes2D.yAxis.title.font.font = AnnotationAtts.axes2D.yAxis.title.font.Courier # Arial, Courier, Times
135 AnnotationAtts.axes2D.yAxis.title.font.scale = 1
136 AnnotationAtts.axes2D.yAxis.title.font.useForegroundColor = 1
137 AnnotationAtts.axes2D.yAxis.title.font.color = (0, 0, 0, 255)
138 AnnotationAtts.axes2D.yAxis.title.font.bold = 1
139 AnnotationAtts.axes2D.yAxis.title.font.italic = 1
140 AnnotationAtts.axes2D.yAxis.title.userTitle = 0
141 AnnotationAtts.axes2D.yAxis.title.userUnits = 0
142 AnnotationAtts.axes2D.yAxis.title.title = "Y-Axis"
143 AnnotationAtts.axes2D.yAxis.title.units = ""
144 AnnotationAtts.axes2D.yAxis.label.visible = 1
145 AnnotationAtts.axes2D.yAxis.label.font.font = AnnotationAtts.axes2D.yAxis.label.font.Courier # Arial, Courier, Times
146 AnnotationAtts.axes2D.yAxis.label.font.scale = 1
147 AnnotationAtts.axes2D.yAxis.label.font.useForegroundColor = 1
148 AnnotationAtts.axes2D.yAxis.label.font.color = (0, 0, 0, 255)
149 AnnotationAtts.axes2D.yAxis.label.font.bold = 1
150 AnnotationAtts.axes2D.yAxis.label.font.italic = 1
151 AnnotationAtts.axes2D.yAxis.label.scaling = 0
152 AnnotationAtts.axes2D.yAxis.tickMarks.visible = 1
153 AnnotationAtts.axes2D.yAxis.tickMarks.majorMinimum = 0
154 AnnotationAtts.axes2D.yAxis.tickMarks.majorMaximum = 1
155 AnnotationAtts.axes2D.yAxis.tickMarks.minorSpacing = 0.02
156 AnnotationAtts.axes2D.yAxis.tickMarks.majorSpacing = 0.2
157 AnnotationAtts.axes2D.yAxis.grid = 0
158
159 AnnotationAtts.userInfoFlag = 0
160 AnnotationAtts.userInfoFont.font = AnnotationAtts.userInfoFont.Arial # Arial, Courier, Times
161 AnnotationAtts.userInfoFont.scale = 1
162 AnnotationAtts.userInfoFont.useForegroundColor = 1
163 AnnotationAtts.userInfoFont.color = (0, 0, 0, 255)
164 AnnotationAtts.userInfoFont.bold = 0
165 AnnotationAtts.userInfoFont.italic = 0
166 AnnotationAtts.databaseInfoFlag = 1
167 AnnotationAtts.timeInfoFlag = 0
168 AnnotationAtts.databaseInfoFont.font = AnnotationAtts.databaseInfoFont.Arial # Arial, Courier, Times
169 AnnotationAtts.databaseInfoFont.scale = 1
170 AnnotationAtts.databaseInfoFont.useForegroundColor = 0
171 AnnotationAtts.databaseInfoFont.color = (255, 255, 255, 255)
172 AnnotationAtts.databaseInfoFont.bold = 0
173 AnnotationAtts.databaseInfoFont.italic = 0
174 AnnotationAtts.databaseInfoExpansionMode = AnnotationAtts.File # File, Directory, Full, Smart, SmartDirectory
175 AnnotationAtts.databaseInfoTimeScale = 1
176 AnnotationAtts.databaseInfoTimeOffset = 0
177 AnnotationAtts.legendInfoFlag = 0
178 AnnotationAtts.backgroundColor = (255, 255, 255, 255)
179 AnnotationAtts.foregroundColor = (0, 0, 0, 255)
180 AnnotationAtts.gradientBackgroundStyle = AnnotationAtts.Radial # TopToBottom, BottomToTop, LeftToRight, RightToLeft, Radial
181 AnnotationAtts.gradientColor1 = (0, 0, 255, 255)
182 AnnotationAtts.gradientColor2 = (0, 0, 0, 255)
183 AnnotationAtts.backgroundMode = AnnotationAtts.Solid # Solid, Gradient, Image, ImageSphere
184 AnnotationAtts.backgroundImage = ""
185 AnnotationAtts.imageRepeatX = 1
186 AnnotationAtts.imageRepeatY = 1
187
188 AnnotationAtts.axesArray.visible = 1
189 AnnotationAtts.axesArray.ticksVisible = 1
190 AnnotationAtts.axesArray.autoSetTicks = 1
191 AnnotationAtts.axesArray.autoSetScaling = 1
192 AnnotationAtts.axesArray.lineWidth = 0
193 AnnotationAtts.axesArray.axes.title.visible = 1
194 AnnotationAtts.axesArray.axes.title.font.font = AnnotationAtts.axesArray.axes.title.font.Arial # Arial, Courier, Times
195 AnnotationAtts.axesArray.axes.title.font.scale = 1
196 AnnotationAtts.axesArray.axes.title.font.useForegroundColor = 1
197 AnnotationAtts.axesArray.axes.title.font.color = (0, 0, 0, 255)
198 AnnotationAtts.axesArray.axes.title.font.bold = 0
199 AnnotationAtts.axesArray.axes.title.font.italic = 0
200 AnnotationAtts.axesArray.axes.title.userTitle = 0
201 AnnotationAtts.axesArray.axes.title.userUnits = 0
202 AnnotationAtts.axesArray.axes.title.title = ""
203 AnnotationAtts.axesArray.axes.title.units = ""
204 AnnotationAtts.axesArray.axes.label.visible = 1
205 AnnotationAtts.axesArray.axes.label.font.font = AnnotationAtts.axesArray.axes.label.font.Arial # Arial, Courier, Times
206 AnnotationAtts.axesArray.axes.label.font.scale = 1
207 AnnotationAtts.axesArray.axes.label.font.useForegroundColor = 1
208 AnnotationAtts.axesArray.axes.label.font.color = (0, 0, 0, 255)
209 AnnotationAtts.axesArray.axes.label.font.bold = 0
210 AnnotationAtts.axesArray.axes.label.font.italic = 0
211 AnnotationAtts.axesArray.axes.label.scaling = 0
212 AnnotationAtts.axesArray.axes.tickMarks.visible = 1
213 AnnotationAtts.axesArray.axes.tickMarks.majorMinimum = 0
214 AnnotationAtts.axesArray.axes.tickMarks.majorMaximum = 1
215 AnnotationAtts.axesArray.axes.tickMarks.minorSpacing = 0.02
216 AnnotationAtts.axesArray.axes.tickMarks.majorSpacing = 0.2
217 AnnotationAtts.axesArray.axes.grid = 0
218 SetAnnotationAttributes(AnnotationAtts)
219
220 View2DAtts = View2DAttributes()
221 View2DAtts.windowCoords = (-3e+08, 3e+08, -3e+08, 3e+08)
222 View2DAtts.viewportCoords = (0, 1, 0, 1)
223 View2DAtts.fullFrameActivationMode = View2DAtts.Auto # On, Off, Auto
224 View2DAtts.fullFrameAutoThreshold = 100
225 View2DAtts.xScale = View2DAtts.LINEAR # LINEAR, LOG
226 View2DAtts.yScale = View2DAtts.LINEAR # LINEAR, LOG
227 View2DAtts.windowValid = 1
228 SetView2D(View2DAtts)
229
230 DrawPlots()
231
232 SaveWindowAtts = SaveWindowAttributes()
233 SaveWindowAtts.outputToCurrentDirectory = 0
234 SaveWindowAtts.outputDirectory = outputLocation
235 SaveWindowAtts.fileName = fileName+number
236 SaveWindowAtts.family = 0
237 SaveWindowAtts.format = SaveWindowAtts.PNG # BMP, CURVE, JPEG, OBJ, PNG, POSTSCRIPT, POVRAY, PPM, RGB, STL, TIFF, ULTRA, VTK, PLY
238 SaveWindowAtts.width = 2000
239 SaveWindowAtts.height = 2000
240 SaveWindowAtts.screenCapture = 0
241 SaveWindowAtts.saveTiled = 0
242 SaveWindowAtts.quality = 80
243 SaveWindowAtts.progressive = 0
244 SaveWindowAtts.binary = 0
245 SaveWindowAtts.stereo = 0
246 SaveWindowAtts.compression = SaveWindowAtts.PackBits # None, PackBits, Jpeg, Deflate
247 SaveWindowAtts.forceMerge = 0
248 SaveWindowAtts.resConstraint = SaveWindowAtts.NoConstraint # NoConstraint, EqualWidthHeight, ScreenProportions
249 SaveWindowAtts.advancedMultiWindowSave = 0
250 SetSaveWindowAttributes(SaveWindowAtts)
251 SaveWindow()
252
253 DeleteAllPlots()
254 #ResetView()
255 CloseDatabase(fileLocation)
256
257exit()