Vlasiator ebf0dd394 on dev (v5.4.0 + 1054 commits)
Loading...
Searching...
No Matches
mosaic_worker.py
Go to the documentation of this file.
1import sys
2import subprocess
3
4time = sys.argv[1]
5
6xCells = 666
7yCells = 583
8
9xStep = 50
10yStep = 50
11
12xList = range(xStep+1, xCells, xStep)
13yList = range(yStep+1, yCells, yStep)
14
15cellList = []
16
17for x in xList:
18 for y in yList:
19 cellList.append((y-1)*xCells + x)
20
21print len(cellList)
22
23for n in cellList:
24 number = str(n)
25 siloFile = "velgrid."+number+"."+time+".silo"
26 fileToExtract = "bulk."+time+".vlsv"
27 subprocess.call(["aprun", "/home/users/alfthan/opt/bin/vlsvextract_DP", fileToExtract, "--cellid", number])
28
29 if os.path.isfile(siloFile) == False:
30 subprocess.call(["ln", "-s", "velgrid.1.0000000.silo", siloFile])
31
32 subprocess.call(["chmod", "a+r", siloFile])
33
34 fileLocation = "/stornext/field/vlasiator/visualizations/ACB/mosaics_tmp3/velgrid."+number+"."+time+".silo"
35 outputLocation = "/stornext/field/vlasiator/visualizations/ACB/mosaics_tmp3/"
36 fileName = "ACB_3dv_"+time+"_"+number.rjust(7, '0')
37
38 OpenDatabase(fileLocation, 0)
39
40 AddPlot("Contour", "avgs", 1, 1)
41 ContourAtts = ContourAttributes()
42 ContourAtts.defaultPalette.GetControlPoints(0).colors = (255, 0, 0, 255)
43 ContourAtts.defaultPalette.GetControlPoints(0).position = 0
44 ContourAtts.defaultPalette.GetControlPoints(1).colors = (0, 255, 0, 255)
45 ContourAtts.defaultPalette.GetControlPoints(1).position = 0.034
46 ContourAtts.defaultPalette.GetControlPoints(2).colors = (0, 0, 255, 255)
47 ContourAtts.defaultPalette.GetControlPoints(2).position = 0.069
48 ContourAtts.defaultPalette.GetControlPoints(3).colors = (0, 255, 255, 255)
49 ContourAtts.defaultPalette.GetControlPoints(3).position = 0.103
50 ContourAtts.defaultPalette.GetControlPoints(4).colors = (255, 0, 255, 255)
51 ContourAtts.defaultPalette.GetControlPoints(4).position = 0.138
52 ContourAtts.defaultPalette.GetControlPoints(5).colors = (255, 255, 0, 255)
53 ContourAtts.defaultPalette.GetControlPoints(5).position = 0.172
54 ContourAtts.defaultPalette.GetControlPoints(6).colors = (255, 135, 0, 255)
55 ContourAtts.defaultPalette.GetControlPoints(6).position = 0.207
56 ContourAtts.defaultPalette.GetControlPoints(7).colors = (255, 0, 135, 255)
57 ContourAtts.defaultPalette.GetControlPoints(7).position = 0.241
58 ContourAtts.defaultPalette.GetControlPoints(8).colors = (168, 168, 168, 255)
59 ContourAtts.defaultPalette.GetControlPoints(8).position = 0.276
60 ContourAtts.defaultPalette.GetControlPoints(9).colors = (255, 68, 68, 255)
61 ContourAtts.defaultPalette.GetControlPoints(9).position = 0.31
62 ContourAtts.defaultPalette.GetControlPoints(10).colors = (99, 255, 99, 255)
63 ContourAtts.defaultPalette.GetControlPoints(10).position = 0.345
64 ContourAtts.defaultPalette.GetControlPoints(11).colors = (99, 99, 255, 255)
65 ContourAtts.defaultPalette.GetControlPoints(11).position = 0.379
66 ContourAtts.defaultPalette.GetControlPoints(12).colors = (40, 165, 165, 255)
67 ContourAtts.defaultPalette.GetControlPoints(12).position = 0.414
68 ContourAtts.defaultPalette.GetControlPoints(13).colors = (255, 99, 255, 255)
69 ContourAtts.defaultPalette.GetControlPoints(13).position = 0.448
70 ContourAtts.defaultPalette.GetControlPoints(14).colors = (255, 255, 99, 255)
71 ContourAtts.defaultPalette.GetControlPoints(14).position = 0.483
72 ContourAtts.defaultPalette.GetControlPoints(15).colors = (255, 170, 99, 255)
73 ContourAtts.defaultPalette.GetControlPoints(15).position = 0.517
74 ContourAtts.defaultPalette.GetControlPoints(16).colors = (170, 79, 255, 255)
75 ContourAtts.defaultPalette.GetControlPoints(16).position = 0.552
76 ContourAtts.defaultPalette.GetControlPoints(17).colors = (150, 0, 0, 255)
77 ContourAtts.defaultPalette.GetControlPoints(17).position = 0.586
78 ContourAtts.defaultPalette.GetControlPoints(18).colors = (0, 150, 0, 255)
79 ContourAtts.defaultPalette.GetControlPoints(18).position = 0.621
80 ContourAtts.defaultPalette.GetControlPoints(19).colors = (0, 0, 150, 255)
81 ContourAtts.defaultPalette.GetControlPoints(19).position = 0.655
82 ContourAtts.defaultPalette.GetControlPoints(20).colors = (0, 109, 109, 255)
83 ContourAtts.defaultPalette.GetControlPoints(20).position = 0.69
84 ContourAtts.defaultPalette.GetControlPoints(21).colors = (150, 0, 150, 255)
85 ContourAtts.defaultPalette.GetControlPoints(21).position = 0.724
86 ContourAtts.defaultPalette.GetControlPoints(22).colors = (150, 150, 0, 255)
87 ContourAtts.defaultPalette.GetControlPoints(22).position = 0.759
88 ContourAtts.defaultPalette.GetControlPoints(23).colors = (150, 84, 0, 255)
89 ContourAtts.defaultPalette.GetControlPoints(23).position = 0.793
90 ContourAtts.defaultPalette.GetControlPoints(24).colors = (160, 0, 79, 255)
91 ContourAtts.defaultPalette.GetControlPoints(24).position = 0.828
92 ContourAtts.defaultPalette.GetControlPoints(25).colors = (255, 104, 28, 255)
93 ContourAtts.defaultPalette.GetControlPoints(25).position = 0.862
94 ContourAtts.defaultPalette.GetControlPoints(26).colors = (0, 170, 81, 255)
95 ContourAtts.defaultPalette.GetControlPoints(26).position = 0.897
96 ContourAtts.defaultPalette.GetControlPoints(27).colors = (68, 255, 124, 255)
97 ContourAtts.defaultPalette.GetControlPoints(27).position = 0.931
98 ContourAtts.defaultPalette.GetControlPoints(28).colors = (0, 130, 255, 255)
99 ContourAtts.defaultPalette.GetControlPoints(28).position = 0.966
100 ContourAtts.defaultPalette.GetControlPoints(29).colors = (130, 0, 255, 255)
101 ContourAtts.defaultPalette.GetControlPoints(29).position = 1
102 ContourAtts.defaultPalette.smoothing = ContourAtts.defaultPalette.None # None, Linear, CubicSpline
103 ContourAtts.defaultPalette.equalSpacingFlag = 1
104 ContourAtts.defaultPalette.discreteFlag = 1
105 #ContourAtts.defaultPalette.externalFlag = 0
106 ContourAtts.changedColors = (0)
107 ContourAtts.colorType = ContourAtts.ColorByMultipleColors # ColorBySingleColor, ColorByMultipleColors, ColorByColorTable
108 ContourAtts.colorTableName = "Default"
109 ContourAtts.invertColorTable = 0
110 ContourAtts.legendFlag = 1
111 ContourAtts.lineStyle = ContourAtts.SOLID # SOLID, DASH, DOT, DOTDASH
112 ContourAtts.lineWidth = 0
113 ContourAtts.singleColor = (255, 0, 0, 255)
114 ContourAtts.SetMultiColor(0, (255, 0, 0, 130))
115 ContourAtts.SetMultiColor(1, (0, 255, 0, 255))
116 ContourAtts.SetMultiColor(2, (0, 0, 255, 255))
117 ContourAtts.SetMultiColor(3, (0, 255, 255, 255))
118 ContourAtts.SetMultiColor(4, (255, 0, 255, 255))
119 ContourAtts.SetMultiColor(5, (255, 255, 0, 255))
120 ContourAtts.SetMultiColor(6, (255, 135, 0, 255))
121 ContourAtts.SetMultiColor(7, (255, 0, 135, 255))
122 ContourAtts.SetMultiColor(8, (168, 168, 168, 255))
123 ContourAtts.SetMultiColor(9, (255, 68, 68, 255))
124 ContourAtts.contourNLevels = 10
125 ContourAtts.contourValue = (1e-15)
126 ContourAtts.contourPercent = ()
127 ContourAtts.contourMethod = ContourAtts.Value # Level, Value, Percent
128 ContourAtts.minFlag = 0
129 ContourAtts.maxFlag = 0
130 ContourAtts.min = 0
131 ContourAtts.max = 1
132 ContourAtts.scaling = ContourAtts.Linear # Linear, Log
133 ContourAtts.wireframe = 0
134 SetPlotOptions(ContourAtts)
135 DrawPlots()
136
137
138 View3DAtts = View3DAttributes()
139 View3DAtts.viewNormal = (0, -1, 1)
140 View3DAtts.focus = (0, 0, 0)
141 View3DAtts.viewUp = (0, 0, 1)
142 View3DAtts.viewAngle = 30
143 View3DAtts.parallelScale = 1.63228e+06
144 View3DAtts.nearPlane = -3.54897e+06
145 View3DAtts.farPlane = 3.54897e+06
146 View3DAtts.imagePan = (0, 0)
147 View3DAtts.imageZoom = 1
148 View3DAtts.perspective = 1
149 View3DAtts.eyeAngle = 2
150 View3DAtts.centerOfRotationSet = 0
151 View3DAtts.centerOfRotation = (0, 0, 0)
152 View3DAtts.axis3DScaleFlag = 0
153 View3DAtts.axis3DScales = (1, 1, 1)
154 View3DAtts.shear = (0, 0, 1)
155 SetView3D(View3DAtts)
156
157 ViewAxisArrayAtts = ViewAxisArrayAttributes()
158 ViewAxisArrayAtts.domainCoords = (0, 1)
159 ViewAxisArrayAtts.rangeCoords = (0, 1)
160 ViewAxisArrayAtts.viewportCoords = (0.15, 0.9, 0.1, 0.85)
161 SetViewAxisArray(ViewAxisArrayAtts)
162
163 AnnotationAtts = AnnotationAttributes()
164 AnnotationAtts.axes3D.visible = 1
165 #AnnotationAtts.axes3D.autoSetTicks = 1
166 #AnnotationAtts.axes3D.autoSetScaling = 1
167 AnnotationAtts.axes3D.lineWidth = 5
168 AnnotationAtts.axes3D.tickLocation = AnnotationAtts.axes3D.Inside # Inside, Outside, Both
169 AnnotationAtts.axes3D.axesType = AnnotationAtts.axes3D.OutsideEdges # ClosestTriad, FurthestTriad, OutsideEdges, StaticTriad, StaticEdges
170 AnnotationAtts.axes3D.triadFlag = 0
171 AnnotationAtts.axes3D.bboxFlag = 1
172 AnnotationAtts.axes3D.xAxis.title.visible = 0
173 #AnnotationAtts.axes3D.xAxis.title.font.font =
174 #AnnotationAtts.axes3D.xAxis.title.font.Arial # Arial, Courier, Times
175 #AnnotationAtts.axes3D.xAxis.title.font.scale = 2
176 #AnnotationAtts.axes3D.xAxis.title.font.useForegroundColor = 1
177 #AnnotationAtts.axes3D.xAxis.title.font.color = (0, 0, 0, 255)
178 #AnnotationAtts.axes3D.xAxis.title.font.bold = 0
179 #AnnotationAtts.axes3D.xAxis.title.font.italic = 0
180 #AnnotationAtts.axes3D.xAxis.title.userTitle = 0
181 #AnnotationAtts.axes3D.xAxis.title.userUnits = 0
182 #AnnotationAtts.axes3D.xAxis.title.title = " "
183 #AnnotationAtts.axes3D.xAxis.title.units = ""
184 AnnotationAtts.axes3D.xAxis.label.visible = 0
185 #AnnotationAtts.axes3D.xAxis.label.font.font = AnnotationAtts.axes3D.xAxis.label.font.Arial # Arial, Courier, Times
186 #AnnotationAtts.axes3D.xAxis.label.font.scale = 3
187 #AnnotationAtts.axes3D.xAxis.label.font.useForegroundColor = 1
188 #AnnotationAtts.axes3D.xAxis.label.font.color = (0, 0, 0, 255)
189 #AnnotationAtts.axes3D.xAxis.label.font.bold = 0
190 #AnnotationAtts.axes3D.xAxis.label.font.italic = 0
191 #AnnotationAtts.axes3D.xAxis.label.scaling = 0
192 AnnotationAtts.axes3D.xAxis.tickMarks.visible = 0
193 #AnnotationAtts.axes3D.xAxis.tickMarks.majorMinimum = 0
194 #AnnotationAtts.axes3D.xAxis.tickMarks.majorMaximum = 1
195 #AnnotationAtts.axes3D.xAxis.tickMarks.minorSpacing = 0.02
196 #AnnotationAtts.axes3D.xAxis.tickMarks.majorSpacing = 0.2
197 #AnnotationAtts.axes3D.xAxis.grid = 0
198 AnnotationAtts.axes3D.yAxis.title.visible = 0
199 #AnnotationAtts.axes3D.yAxis.title.font.font =
200 #AnnotationAtts.axes3D.yAxis.title.font.Arial # Arial, Courier, Times
201 #AnnotationAtts.axes3D.yAxis.title.font.scale = 1
202 #AnnotationAtts.axes3D.yAxis.title.font.useForegroundColor = 1
203 #AnnotationAtts.axes3D.yAxis.title.font.color = (0, 0, 0, 255)
204 #AnnotationAtts.axes3D.yAxis.title.font.bold = 0
205 #AnnotationAtts.axes3D.yAxis.title.font.italic = 0
206 #AnnotationAtts.axes3D.yAxis.title.userTitle = 0
207 #AnnotationAtts.axes3D.yAxis.title.userUnits = 0
208 #AnnotationAtts.axes3D.yAxis.title.title = " "
209 #AnnotationAtts.axes3D.yAxis.title.units = ""
210 AnnotationAtts.axes3D.yAxis.label.visible = 0
211 #AnnotationAtts.axes3D.yAxis.label.font.font = AnnotationAtts.axes3D.yAxis.label.font.Arial # Arial, Courier, Times
212 #AnnotationAtts.axes3D.yAxis.label.font.scale = 3
213 #AnnotationAtts.axes3D.yAxis.label.font.useForegroundColor = 1
214 #AnnotationAtts.axes3D.yAxis.label.font.color = (0, 0, 0, 255)
215 #AnnotationAtts.axes3D.yAxis.label.font.bold = 0
216 #AnnotationAtts.axes3D.yAxis.label.font.italic = 0
217 #AnnotationAtts.axes3D.yAxis.label.scaling = 0
218 AnnotationAtts.axes3D.yAxis.tickMarks.visible = 0
219 #AnnotationAtts.axes3D.yAxis.tickMarks.majorMinimum = 0
220 #AnnotationAtts.axes3D.yAxis.tickMarks.majorMaximum = 1
221 #AnnotationAtts.axes3D.yAxis.tickMarks.minorSpacing = 0.02
222 #AnnotationAtts.axes3D.yAxis.tickMarks.majorSpacing = 0.2
223 #AnnotationAtts.axes3D.yAxis.grid = 0
224 AnnotationAtts.axes3D.zAxis.title.visible = 0
225 #AnnotationAtts.axes3D.zAxis.title.font.font =
226 #AnnotationAtts.axes3D.zAxis.title.font.Arial # Arial, Courier, Times
227 #AnnotationAtts.axes3D.zAxis.title.font.scale = 1
228 #AnnotationAtts.axes3D.zAxis.title.font.useForegroundColor = 1
229 #AnnotationAtts.axes3D.zAxis.title.font.color = (0, 0, 0, 255)
230 #AnnotationAtts.axes3D.zAxis.title.font.bold = 0
231 #AnnotationAtts.axes3D.zAxis.title.font.italic = 0
232 #AnnotationAtts.axes3D.zAxis.title.userTitle = 0
233 #AnnotationAtts.axes3D.zAxis.title.userUnits = 0
234 #AnnotationAtts.axes3D.zAxis.title.title = " "
235 #AnnotationAtts.axes3D.zAxis.title.units = ""
236 AnnotationAtts.axes3D.zAxis.label.visible = 0
237 #AnnotationAtts.axes3D.zAxis.label.font.font = AnnotationAtts.axes3D.zAxis.label.font.Arial # Arial, Courier, Times
238 #AnnotationAtts.axes3D.zAxis.label.font.scale = 3
239 #AnnotationAtts.axes3D.zAxis.label.font.useForegroundColor = 1
240 #AnnotationAtts.axes3D.zAxis.label.font.color = (0, 0, 0, 255)
241 #AnnotationAtts.axes3D.zAxis.label.font.bold = 0
242 #AnnotationAtts.axes3D.zAxis.label.font.italic = 0
243 #AnnotationAtts.axes3D.zAxis.label.scaling = 0
244 AnnotationAtts.axes3D.zAxis.tickMarks.visible = 0
245 #AnnotationAtts.axes3D.zAxis.tickMarks.majorMinimum = 0
246 #AnnotationAtts.axes3D.zAxis.tickMarks.majorMaximum = 1
247 #AnnotationAtts.axes3D.zAxis.tickMarks.minorSpacing = 0.02
248 #AnnotationAtts.axes3D.zAxis.tickMarks.majorSpacing = 0.2
249 #AnnotationAtts.axes3D.zAxis.grid = 0
250 AnnotationAtts.axes3D.setBBoxLocation = 1
251 AnnotationAtts.axes3D.bboxLocation = (-1.0e6, 1.0e6, -1.0e6, 1.0e6, -1.0e6, 1.0e6)
252
253 AnnotationAtts.userInfoFlag = 0
254 AnnotationAtts.userInfoFont.font = AnnotationAtts.userInfoFont.Arial # Arial, Courier, Times
255 AnnotationAtts.userInfoFont.scale = 1
256 AnnotationAtts.userInfoFont.useForegroundColor = 1
257 AnnotationAtts.userInfoFont.color = (0, 0, 0, 255)
258 AnnotationAtts.userInfoFont.bold = 0
259 AnnotationAtts.userInfoFont.italic = 0
260 AnnotationAtts.databaseInfoFlag = 0
261 AnnotationAtts.timeInfoFlag = 1
262 AnnotationAtts.databaseInfoFont.font = AnnotationAtts.databaseInfoFont.Arial # Arial, Courier, Times
263 AnnotationAtts.databaseInfoFont.scale = 1
264 AnnotationAtts.databaseInfoFont.useForegroundColor = 1
265 AnnotationAtts.databaseInfoFont.color = (0, 0, 0, 255)
266 AnnotationAtts.databaseInfoFont.bold = 0
267 AnnotationAtts.databaseInfoFont.italic = 0
268 AnnotationAtts.databaseInfoExpansionMode = AnnotationAtts.File # File, Directory, Full, Smart, SmartDirectory
269 AnnotationAtts.databaseInfoTimeScale = 1
270 AnnotationAtts.databaseInfoTimeOffset = 0
271 AnnotationAtts.legendInfoFlag = 0
272 SetAnnotationAttributes(AnnotationAtts)
273
274
275
276 # MAINTENANCE ISSUE: SetSuppressMessagesRPC is not handled in Logging.C. Please contact a VisIt developer.
277 #SaveSession("/zhome/academic/HLRS/pri/iprykemp/.visit/crash_recovery.session")
278 # MAINTENANCE ISSUE: SetSuppressMessagesRPC is not handled in Logging.C. Please contact a VisIt developer.
279 SaveWindowAtts = SaveWindowAttributes()
280 SaveWindowAtts.outputToCurrentDirectory = 0
281 SaveWindowAtts.outputDirectory = outputLocation
282 SaveWindowAtts.fileName = fileName
283 SaveWindowAtts.family = 0
284 SaveWindowAtts.format = SaveWindowAtts.PNG # BMP, CURVE, JPEG, OBJ, PNG, POSTSCRIPT, POVRAY, PPM, RGB, STL, TIFF, ULTRA, VTK, PLY
285 SaveWindowAtts.width = 1024
286 SaveWindowAtts.height = 1024
287 SaveWindowAtts.screenCapture = 0
288 SaveWindowAtts.saveTiled = 0
289 SaveWindowAtts.quality = 80
290 SaveWindowAtts.progressive = 0
291 SaveWindowAtts.binary = 0
292 SaveWindowAtts.stereo = 0
293 SaveWindowAtts.compression = SaveWindowAtts.PackBits # None, PackBits, Jpeg, Deflate
294 SaveWindowAtts.forceMerge = 0
295 SaveWindowAtts.resConstraint = SaveWindowAtts.ScreenProportions # NoConstraint, EqualWidthHeight, ScreenProportions
296 SaveWindowAtts.advancedMultiWindowSave = 0
297 SetSaveWindowAttributes(SaveWindowAtts)
298 SaveWindow()
299
300 DeleteAllPlots()
301 CloseDatabase(fileLocation)
302
303 subprocess.call(["mv", fileName+".png", str(time).rjust(7, '0')+"/"])
304 subprocess.call(["rm", siloFile])
305
306
307
308
309exit()