Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
background_dots.py
Go to the documentation of this file.
2import subprocess
3
4xCells = 666
5yCells = 583
6
7xStep = 50
8yStep = 50
9
10xList = range(xStep, xCells+1, xStep)
11yList = range(yStep, yCells+1, yStep)
12
13DefinePythonExpression("mask_every_100", file="visit_filter_mask_every_nth_cell.py", args=["CellID"], type="scalar")
14
15outputLocation = "/home/kempf/Servers/stornext_vlasiator/visualizations/ACB/mosaics_tmp3/"
16fileName = "ACB_background_dots_50_2664x2332"
17
18fileLocation = "/home/kempf/Servers/voima_lustre_alfthan/2D/ACB_yk/bulk.0000000.silo"
19OpenDatabase(fileLocation, 0)
20
21AddPlot("Pseudocolor", "mask_every_100", 1, 0)
22SetActivePlots(1)
23AddOperator("Slice", 0)
24AddOperator("Threshold", 0)
25
26SliceAtts = SliceAttributes()
27SliceAtts.originType = SliceAtts.Intercept # Point, Intercept, Percent, Zone, Node
28SliceAtts.originPoint = (0, 0, 0)
29SliceAtts.originIntercept = 0
30SliceAtts.originPercent = 0
31SliceAtts.originZone = 0
32SliceAtts.originNode = 0
33SliceAtts.normal = (0, 0, -1)
34SliceAtts.axisType = SliceAtts.Arbitrary # XAxis, YAxis, ZAxis, Arbitrary, ThetaPhi
35SliceAtts.upAxis = (0, -1, 0)
36SliceAtts.project2d = 1
37SliceAtts.interactive = 1
38SliceAtts.flip = 0
39SliceAtts.originZoneDomain = 0
40SliceAtts.originNodeDomain = 0
41SliceAtts.meshName = "SpatialGrid"
42SliceAtts.theta = 0
43SliceAtts.phi = 90
44SetOperatorOptions(SliceAtts, 0)
45
46ThresholdAtts = ThresholdAttributes()
47ThresholdAtts.outputMeshType = 0
48ThresholdAtts.listedVarNames = ("mask_every_100")
49ThresholdAtts.zonePortions = (1)
50ThresholdAtts.lowerBounds = (1)
51ThresholdAtts.upperBounds = (1)
52ThresholdAtts.defaultVarName = "mask_every_100"
53ThresholdAtts.defaultVarIsScalar = 1
54SetOperatorOptions(ThresholdAtts, 0)
55
56PseudocolorAtts = PseudocolorAttributes()
57PseudocolorAtts.scaling = PseudocolorAtts.Linear # Linear, Log, Skew
58PseudocolorAtts.skewFactor = 1
59PseudocolorAtts.limitsMode = PseudocolorAtts.OriginalData # OriginalData, CurrentPlot
60PseudocolorAtts.minFlag = 0
61PseudocolorAtts.min = 0
62PseudocolorAtts.maxFlag = 0
63PseudocolorAtts.max = 0
64PseudocolorAtts.centering = PseudocolorAtts.Natural # Natural, Nodal, Zonal
65PseudocolorAtts.colorTableName = "xray"
66PseudocolorAtts.invertColorTable = 0
67PseudocolorAtts.opacityType = PseudocolorAtts.FullyOpaque # ColorTable, FullyOpaque, Constant, Ramp, VariableRange
68PseudocolorAtts.opacityVariable = ""
69PseudocolorAtts.opacity = 1
70PseudocolorAtts.opacityVarMin = 0
71PseudocolorAtts.opacityVarMax = 1
72PseudocolorAtts.opacityVarMinFlag = 0
73PseudocolorAtts.opacityVarMaxFlag = 0
74PseudocolorAtts.pointSize = 0.05
75PseudocolorAtts.pointType = PseudocolorAtts.Point # Box, Axis, Icosahedron, Octahedron, Tetrahedron, SphereGeometry, Point, Sphere
76PseudocolorAtts.pointSizeVarEnabled = 0
77PseudocolorAtts.pointSizeVar = "default"
78PseudocolorAtts.pointSizePixels = 2
79PseudocolorAtts.lineType = PseudocolorAtts.Line # Line, Tube, Ribbon
80PseudocolorAtts.lineStyle = PseudocolorAtts.SOLID # SOLID, DASH, DOT, DOTDASH
81PseudocolorAtts.lineWidth = 0
82PseudocolorAtts.tubeDisplayDensity = 10
83PseudocolorAtts.tubeRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox
84PseudocolorAtts.tubeRadiusAbsolute = 0.125
85PseudocolorAtts.tubeRadiusBBox = 0.005
86PseudocolorAtts.varyTubeRadius = 0
87PseudocolorAtts.varyTubeRadiusVariable = ""
88PseudocolorAtts.varyTubeRadiusFactor = 10
89PseudocolorAtts.endPointType = PseudocolorAtts.None # None, Tails, Heads, Both
90PseudocolorAtts.endPointStyle = PseudocolorAtts.Spheres # Spheres, Cones
91PseudocolorAtts.endPointRadiusSizeType = PseudocolorAtts.FractionOfBBox # Absolute, FractionOfBBox
92PseudocolorAtts.endPointRadiusAbsolute = 1
93PseudocolorAtts.endPointRadiusBBox = 0.005
94PseudocolorAtts.endPointRatio = 2
95PseudocolorAtts.renderSurfaces = 1
96PseudocolorAtts.renderWireframe = 0
97PseudocolorAtts.renderPoints = 0
98PseudocolorAtts.smoothingLevel = 0
99PseudocolorAtts.legendFlag = 1
100PseudocolorAtts.lightingFlag = 1
101SetPlotOptions(PseudocolorAtts)
102TimeSliderPreviousState()
103
104print "Drawing plots..."
105DrawPlots()
106print "Plots drawn, saving..."
107
108
109AnnotationAtts = AnnotationAttributes()
110AnnotationAtts.axes2D.visible = 1
111AnnotationAtts.axes2D.autoSetTicks = 0
112AnnotationAtts.axes2D.autoSetScaling = 1
113AnnotationAtts.axes2D.lineWidth = 5
114AnnotationAtts.axes2D.tickLocation = AnnotationAtts.axes2D.Inside # Inside, Outside, Both
115AnnotationAtts.axes2D.tickAxes = AnnotationAtts.axes2D.All # Off, Bottom, Left, BottomLeft, All
116AnnotationAtts.axes2D.xAxis.title.visible = 1
117AnnotationAtts.axes2D.xAxis.title.font.font = AnnotationAtts.axes2D.xAxis.title.font.Courier # Arial, Courier, Times
118AnnotationAtts.axes2D.xAxis.title.font.scale = 1
119AnnotationAtts.axes2D.xAxis.title.font.useForegroundColor = 0
120AnnotationAtts.axes2D.xAxis.title.font.color = (255, 255, 255, 255)
121AnnotationAtts.axes2D.xAxis.title.font.bold = 1
122AnnotationAtts.axes2D.xAxis.title.font.italic = 1
123AnnotationAtts.axes2D.xAxis.title.userTitle = 0
124AnnotationAtts.axes2D.xAxis.title.userUnits = 0
125AnnotationAtts.axes2D.xAxis.title.title = "X-Axis"
126AnnotationAtts.axes2D.xAxis.title.units = ""
127AnnotationAtts.axes2D.xAxis.label.visible = 1
128AnnotationAtts.axes2D.xAxis.label.font.font = AnnotationAtts.axes2D.xAxis.label.font.Courier # Arial, Courier, Times
129AnnotationAtts.axes2D.xAxis.label.font.scale = 1
130AnnotationAtts.axes2D.xAxis.label.font.useForegroundColor = 0
131AnnotationAtts.axes2D.xAxis.label.font.color = (255, 255, 255, 255)
132AnnotationAtts.axes2D.xAxis.label.font.bold = 1
133AnnotationAtts.axes2D.xAxis.label.font.italic = 1
134AnnotationAtts.axes2D.xAxis.label.scaling = 0
135AnnotationAtts.axes2D.xAxis.tickMarks.visible = 1
136AnnotationAtts.axes2D.xAxis.tickMarks.majorMinimum = -1.274e8
137AnnotationAtts.axes2D.xAxis.tickMarks.majorMaximum = 2.548e8
138AnnotationAtts.axes2D.xAxis.tickMarks.minorSpacing = 6.371e6
139AnnotationAtts.axes2D.xAxis.tickMarks.majorSpacing = 6.371e7
140AnnotationAtts.axes2D.xAxis.grid = 0
141AnnotationAtts.axes2D.yAxis.title.visible = 1
142AnnotationAtts.axes2D.yAxis.title.font.font = AnnotationAtts.axes2D.yAxis.title.font.Courier # Arial, Courier, Times
143AnnotationAtts.axes2D.yAxis.title.font.scale = 1
144AnnotationAtts.axes2D.yAxis.title.font.useForegroundColor = 0
145AnnotationAtts.axes2D.yAxis.title.font.color = (255, 255, 255, 255)
146AnnotationAtts.axes2D.yAxis.title.font.bold = 1
147AnnotationAtts.axes2D.yAxis.title.font.italic = 1
148AnnotationAtts.axes2D.yAxis.title.userTitle = 0
149AnnotationAtts.axes2D.yAxis.title.userUnits = 0
150AnnotationAtts.axes2D.yAxis.title.title = "Y-Axis"
151AnnotationAtts.axes2D.yAxis.title.units = ""
152AnnotationAtts.axes2D.yAxis.label.visible = 1
153AnnotationAtts.axes2D.yAxis.label.font.font = AnnotationAtts.axes2D.yAxis.label.font.Courier # Arial, Courier, Times
154AnnotationAtts.axes2D.yAxis.label.font.scale = 1
155AnnotationAtts.axes2D.yAxis.label.font.useForegroundColor = 0
156AnnotationAtts.axes2D.yAxis.label.font.color = (255, 255, 255, 255)
157AnnotationAtts.axes2D.yAxis.label.font.bold = 1
158AnnotationAtts.axes2D.yAxis.label.font.italic = 1
159AnnotationAtts.axes2D.yAxis.label.scaling = 0
160AnnotationAtts.axes2D.yAxis.tickMarks.visible = 1
161AnnotationAtts.axes2D.yAxis.tickMarks.majorMinimum = -3.322e8
162AnnotationAtts.axes2D.yAxis.tickMarks.majorMaximum = 4.322e8
163AnnotationAtts.axes2D.yAxis.tickMarks.minorSpacing = 6.371e6
164AnnotationAtts.axes2D.yAxis.tickMarks.majorSpacing = 6.371e7
165AnnotationAtts.axes2D.yAxis.grid = 0
166AnnotationAtts.axes3D.visible = 0
167AnnotationAtts.axes3D.autoSetTicks = 1
168AnnotationAtts.axes3D.autoSetScaling = 1
169AnnotationAtts.axes3D.lineWidth = 0
170AnnotationAtts.axes3D.tickLocation = AnnotationAtts.axes3D.Inside # Inside, Outside, Both
171AnnotationAtts.axes3D.axesType = AnnotationAtts.axes3D.ClosestTriad # ClosestTriad, FurthestTriad, OutsideEdges, StaticTriad, StaticEdges
172AnnotationAtts.axes3D.triadFlag = 0
173AnnotationAtts.axes3D.bboxFlag = 0
174AnnotationAtts.axes3D.xAxis.title.visible = 1
175AnnotationAtts.axes3D.xAxis.title.font.font = AnnotationAtts.axes3D.xAxis.title.font.Arial # Arial, Courier, Times
176AnnotationAtts.axes3D.xAxis.title.font.scale = 1
177AnnotationAtts.axes3D.xAxis.title.font.useForegroundColor = 0
178AnnotationAtts.axes3D.xAxis.title.font.color = (255, 255, 255, 255)
179AnnotationAtts.axes3D.xAxis.title.font.bold = 0
180AnnotationAtts.axes3D.xAxis.title.font.italic = 0
181AnnotationAtts.axes3D.xAxis.title.userTitle = 0
182AnnotationAtts.axes3D.xAxis.title.userUnits = 0
183AnnotationAtts.axes3D.xAxis.title.title = "X-Axis"
184AnnotationAtts.axes3D.xAxis.title.units = ""
185AnnotationAtts.axes3D.xAxis.label.visible = 1
186AnnotationAtts.axes3D.xAxis.label.font.font = AnnotationAtts.axes3D.xAxis.label.font.Arial # Arial, Courier, Times
187AnnotationAtts.axes3D.xAxis.label.font.scale = 1
188AnnotationAtts.axes3D.xAxis.label.font.useForegroundColor = 0
189AnnotationAtts.axes3D.xAxis.label.font.color = (255, 255, 255, 255)
190AnnotationAtts.axes3D.xAxis.label.font.bold = 0
191AnnotationAtts.axes3D.xAxis.label.font.italic = 0
192AnnotationAtts.axes3D.xAxis.label.scaling = 0
193AnnotationAtts.axes3D.xAxis.tickMarks.visible = 1
194AnnotationAtts.axes3D.xAxis.tickMarks.majorMinimum = 0
195AnnotationAtts.axes3D.xAxis.tickMarks.majorMaximum = 1
196AnnotationAtts.axes3D.xAxis.tickMarks.minorSpacing = 0.02
197AnnotationAtts.axes3D.xAxis.tickMarks.majorSpacing = 0.2
198AnnotationAtts.axes3D.xAxis.grid = 0
199AnnotationAtts.axes3D.yAxis.title.visible = 1
200AnnotationAtts.axes3D.yAxis.title.font.font = AnnotationAtts.axes3D.yAxis.title.font.Arial # Arial, Courier, Times
201AnnotationAtts.axes3D.yAxis.title.font.scale = 1
202AnnotationAtts.axes3D.yAxis.title.font.useForegroundColor = 0
203AnnotationAtts.axes3D.yAxis.title.font.color = (255, 255, 255, 255)
204AnnotationAtts.axes3D.yAxis.title.font.bold = 0
205AnnotationAtts.axes3D.yAxis.title.font.italic = 0
206AnnotationAtts.axes3D.yAxis.title.userTitle = 0
207AnnotationAtts.axes3D.yAxis.title.userUnits = 0
208AnnotationAtts.axes3D.yAxis.title.title = "Y-Axis"
209AnnotationAtts.axes3D.yAxis.title.units = ""
210AnnotationAtts.axes3D.yAxis.label.visible = 1
211AnnotationAtts.axes3D.yAxis.label.font.font = AnnotationAtts.axes3D.yAxis.label.font.Arial # Arial, Courier, Times
212AnnotationAtts.axes3D.yAxis.label.font.scale = 1
213AnnotationAtts.axes3D.yAxis.label.font.useForegroundColor = 0
214AnnotationAtts.axes3D.yAxis.label.font.color = (255, 255, 255, 255)
215AnnotationAtts.axes3D.yAxis.label.font.bold = 0
216AnnotationAtts.axes3D.yAxis.label.font.italic = 0
217AnnotationAtts.axes3D.yAxis.label.scaling = 0
218AnnotationAtts.axes3D.yAxis.tickMarks.visible = 1
219AnnotationAtts.axes3D.yAxis.tickMarks.majorMinimum = 0
220AnnotationAtts.axes3D.yAxis.tickMarks.majorMaximum = 1
221AnnotationAtts.axes3D.yAxis.tickMarks.minorSpacing = 0.02
222AnnotationAtts.axes3D.yAxis.tickMarks.majorSpacing = 0.2
223AnnotationAtts.axes3D.yAxis.grid = 0
224AnnotationAtts.axes3D.zAxis.title.visible = 1
225AnnotationAtts.axes3D.zAxis.title.font.font = AnnotationAtts.axes3D.zAxis.title.font.Arial # Arial, Courier, Times
226AnnotationAtts.axes3D.zAxis.title.font.scale = 1
227AnnotationAtts.axes3D.zAxis.title.font.useForegroundColor = 0
228AnnotationAtts.axes3D.zAxis.title.font.color = (255, 255, 255, 255)
229AnnotationAtts.axes3D.zAxis.title.font.bold = 0
230AnnotationAtts.axes3D.zAxis.title.font.italic = 0
231AnnotationAtts.axes3D.zAxis.title.userTitle = 0
232AnnotationAtts.axes3D.zAxis.title.userUnits = 0
233AnnotationAtts.axes3D.zAxis.title.title = "Z-Axis"
234AnnotationAtts.axes3D.zAxis.title.units = ""
235AnnotationAtts.axes3D.zAxis.label.visible = 1
236AnnotationAtts.axes3D.zAxis.label.font.font = AnnotationAtts.axes3D.zAxis.label.font.Arial # Arial, Courier, Times
237AnnotationAtts.axes3D.zAxis.label.font.scale = 1
238AnnotationAtts.axes3D.zAxis.label.font.useForegroundColor = 0
239AnnotationAtts.axes3D.zAxis.label.font.color = (255, 255, 255, 255)
240AnnotationAtts.axes3D.zAxis.label.font.bold = 0
241AnnotationAtts.axes3D.zAxis.label.font.italic = 0
242AnnotationAtts.axes3D.zAxis.label.scaling = 0
243AnnotationAtts.axes3D.zAxis.tickMarks.visible = 1
244AnnotationAtts.axes3D.zAxis.tickMarks.majorMinimum = 0
245AnnotationAtts.axes3D.zAxis.tickMarks.majorMaximum = 1
246AnnotationAtts.axes3D.zAxis.tickMarks.minorSpacing = 0.02
247AnnotationAtts.axes3D.zAxis.tickMarks.majorSpacing = 0.2
248AnnotationAtts.axes3D.zAxis.grid = 0
249AnnotationAtts.axes3D.setBBoxLocation = 0
250AnnotationAtts.axes3D.bboxLocation = (0, 1, 0, 1, 0, 1)
251AnnotationAtts.userInfoFlag = 0
252AnnotationAtts.userInfoFont.font = AnnotationAtts.userInfoFont.Arial # Arial, Courier, Times
253AnnotationAtts.userInfoFont.scale = 1
254AnnotationAtts.userInfoFont.useForegroundColor = 0
255AnnotationAtts.userInfoFont.color = (255, 255, 255, 255)
256AnnotationAtts.userInfoFont.bold = 0
257AnnotationAtts.userInfoFont.italic = 0
258AnnotationAtts.databaseInfoFlag = 0
259AnnotationAtts.timeInfoFlag = 1
260AnnotationAtts.databaseInfoFont.font = AnnotationAtts.databaseInfoFont.Arial # Arial, Courier, Times
261AnnotationAtts.databaseInfoFont.scale = 1
262AnnotationAtts.databaseInfoFont.useForegroundColor = 0
263AnnotationAtts.databaseInfoFont.color = (255, 255, 255, 255)
264AnnotationAtts.databaseInfoFont.bold = 0
265AnnotationAtts.databaseInfoFont.italic = 0
266AnnotationAtts.databaseInfoExpansionMode = AnnotationAtts.File # File, Directory, Full, Smart, SmartDirectory
267AnnotationAtts.databaseInfoTimeScale = 1
268AnnotationAtts.databaseInfoTimeOffset = 0
269AnnotationAtts.legendInfoFlag = 0
270AnnotationAtts.backgroundColor = (255, 255, 255, 255)
271AnnotationAtts.foregroundColor = (0, 0, 0, 255)
272AnnotationAtts.gradientBackgroundStyle = AnnotationAtts.Radial # TopToBottom, BottomToTop, LeftToRight, RightToLeft, Radial
273AnnotationAtts.gradientColor1 = (0, 0, 255, 255)
274AnnotationAtts.gradientColor2 = (0, 0, 0, 255)
275AnnotationAtts.backgroundMode = AnnotationAtts.Solid # Solid, Gradient, Image, ImageSphere
276AnnotationAtts.backgroundImage = ""
277AnnotationAtts.imageRepeatX = 1
278AnnotationAtts.imageRepeatY = 1
279AnnotationAtts.axesArray.visible = 1
280AnnotationAtts.axesArray.ticksVisible = 1
281AnnotationAtts.axesArray.autoSetTicks = 1
282AnnotationAtts.axesArray.autoSetScaling = 1
283AnnotationAtts.axesArray.lineWidth = 0
284AnnotationAtts.axesArray.axes.title.visible = 1
285AnnotationAtts.axesArray.axes.title.font.font = AnnotationAtts.axesArray.axes.title.font.Arial # Arial, Courier, Times
286AnnotationAtts.axesArray.axes.title.font.scale = 1
287AnnotationAtts.axesArray.axes.title.font.useForegroundColor = 0
288AnnotationAtts.axesArray.axes.title.font.color = (255, 255, 255, 255)
289AnnotationAtts.axesArray.axes.title.font.bold = 0
290AnnotationAtts.axesArray.axes.title.font.italic = 0
291AnnotationAtts.axesArray.axes.title.userTitle = 0
292AnnotationAtts.axesArray.axes.title.userUnits = 0
293AnnotationAtts.axesArray.axes.title.title = ""
294AnnotationAtts.axesArray.axes.title.units = ""
295AnnotationAtts.axesArray.axes.label.visible = 1
296AnnotationAtts.axesArray.axes.label.font.font = AnnotationAtts.axesArray.axes.label.font.Arial # Arial, Courier, Times
297AnnotationAtts.axesArray.axes.label.font.scale = 1
298AnnotationAtts.axesArray.axes.label.font.useForegroundColor = 0
299AnnotationAtts.axesArray.axes.label.font.color = (255, 255, 255, 255)
300AnnotationAtts.axesArray.axes.label.font.bold = 0
301AnnotationAtts.axesArray.axes.label.font.italic = 0
302AnnotationAtts.axesArray.axes.label.scaling = 0
303AnnotationAtts.axesArray.axes.tickMarks.visible = 1
304AnnotationAtts.axesArray.axes.tickMarks.majorMinimum = 0
305AnnotationAtts.axesArray.axes.tickMarks.majorMaximum = 1
306AnnotationAtts.axesArray.axes.tickMarks.minorSpacing = 0.02
307AnnotationAtts.axesArray.axes.tickMarks.majorSpacing = 0.2
308AnnotationAtts.axesArray.axes.grid = 0
309SetAnnotationAttributes(AnnotationAtts)
310
311View2DAtts = View2DAttributes()
312View2DAtts.windowCoords = (-50119193.08, 405054205.892, -199223792.493, 199223792.493)
313View2DAtts.viewportCoords = (0, 1, 0, 1)
314View2DAtts.fullFrameActivationMode = View2DAtts.Auto # On, Off, Auto
315View2DAtts.fullFrameAutoThreshold = 100
316View2DAtts.xScale = View2DAtts.LINEAR # LINEAR, LOG
317View2DAtts.yScale = View2DAtts.LINEAR # LINEAR, LOG
318View2DAtts.windowValid = 1
319SetView2D(View2DAtts)
320
321SaveWindowAtts = SaveWindowAttributes()
322SaveWindowAtts.outputToCurrentDirectory = 0
323SaveWindowAtts.outputDirectory = outputLocation
324SaveWindowAtts.fileName = fileName
325SaveWindowAtts.family = 0
326SaveWindowAtts.format = SaveWindowAtts.PNG # BMP, CURVE, JPEG, OBJ, PNG, POSTSCRIPT, POVRAY, PPM, RGB, STL, TIFF, ULTRA, VTK, PLY
327SaveWindowAtts.width = 2664
328SaveWindowAtts.height = 2332
329SaveWindowAtts.screenCapture = 0
330SaveWindowAtts.saveTiled = 0
331SaveWindowAtts.quality = 80
332SaveWindowAtts.progressive = 0
333SaveWindowAtts.binary = 0
334SaveWindowAtts.stereo = 0
335SaveWindowAtts.compression = SaveWindowAtts.PackBits # None, PackBits, Jpeg, Deflate
336SaveWindowAtts.forceMerge = 0
337SaveWindowAtts.resConstraint = SaveWindowAtts.NoConstraint # NoConstraint, EqualWidthHeight, ScreenProportions
338SaveWindowAtts.advancedMultiWindowSave = 0
339SetSaveWindowAttributes(SaveWindowAtts)
340SaveWindow()
341
342DeleteAllPlots()
343CloseDatabase(fileLocation)
344
345subprocess.call(["convert", SaveWindowAtts.fileName+".png", "-transparent", "black", SaveWindowAtts.fileName+".png"])
346
347exit()