Blog: Meeting update: average_script_visit

File average_script_visit, 3.0 KB (added by Erica Kaminski, 12 years ago)
Line 
1ActivateDatabase("localhost:/media/grassdata/erica/from_bluehive/FinalRunsNewest/BP/chombo00046.hdf")
2filename = "average_vrad_00046.curve"
3DeleteActivePlots()
4AddPlot("Pseudocolor", "vrad", 1, 1)
5SetActivePlots(0)
6
7# inner_sphere():
8AddOperator("Clip", 1)
9ClipAtts = ClipAttributes()
10ClipAtts.quality = ClipAtts.Fast # Fast, Accurate
11ClipAtts.funcType = ClipAtts.Sphere # Plane, Sphere
12ClipAtts.plane1Status = 1
13ClipAtts.plane2Status = 0
14ClipAtts.plane3Status = 0
15ClipAtts.plane1Origin = (0, 0, 0)
16ClipAtts.plane2Origin = (0, 0, 0)
17ClipAtts.plane3Origin = (0, 0, 0)
18ClipAtts.plane1Normal = (1, 0, 0)
19ClipAtts.plane2Normal = (0, 1, 0)
20ClipAtts.plane3Normal = (0, 0, 1)
21ClipAtts.planeInverse = 0
22ClipAtts.planeToolControlledClipPlane = ClipAtts.Plane1 # None, Plane1, Plane2, Plane3
23ClipAtts.center = (0, 0, 0)
24ClipAtts.radius = 0.06
25ClipAtts.sphereInverse = 1
26SetOperatorOptions(ClipAtts, 1)
27DrawPlots()
28f = open(filename, "w")
29f.write("# average_vrad\n")
30#Query, write average:
31Query("Average Value")
32t2 = GetQueryOutputValue()
33str = "%25.15e %25.15e\n" %(ClipAtts.radius, t2)
34f.write(str)
35RemoveAllOperators(1)
36for i in range(48):
37 dx=0.03
38 #inner sphere:
39 AddOperator("Clip", 1)
40 ClipAtts = ClipAttributes()
41 ClipAtts.quality = ClipAtts.Fast # Fast, Accurate
42 ClipAtts.funcType = ClipAtts.Sphere # Plane, Sphere
43 ClipAtts.plane1Status = 1
44 ClipAtts.plane2Status = 0
45 ClipAtts.plane3Status = 0
46 ClipAtts.plane1Origin = (0, 0, 0)
47 ClipAtts.plane2Origin = (0, 0, 0)
48 ClipAtts.plane3Origin = (0, 0, 0)
49 ClipAtts.plane1Normal = (1, 0, 0)
50 ClipAtts.plane2Normal = (0, 1, 0)
51 ClipAtts.plane3Normal = (0, 0, 1)
52 ClipAtts.planeInverse = 0
53 ClipAtts.planeToolControlledClipPlane = ClipAtts.Plane1 # None, Plane1, Plane2, Plane3
54 ClipAtts.center = (0, 0, 0)
55 ClipAtts.radius = 0.06 + i*dx
56 ClipAtts.sphereInverse = 0
57 SetOperatorOptions(ClipAtts, 1)
58 #Outer-sphere:
59 AddOperator("Clip", 1)
60 ClipAtts = ClipAttributes()
61 ClipAtts.quality = ClipAtts.Fast # Fast, Accurate
62 ClipAtts.funcType = ClipAtts.Sphere # Plane, Sphere
63 ClipAtts.plane1Status = 1
64 ClipAtts.plane2Status = 0
65 ClipAtts.plane3Status = 0
66 ClipAtts.plane1Origin = (0, 0, 0)
67 ClipAtts.plane2Origin = (0, 0, 0)
68 ClipAtts.plane3Origin = (0, 0, 0)
69 ClipAtts.plane1Normal = (1, 0, 0)
70 ClipAtts.plane2Normal = (0, 1, 0)
71 ClipAtts.plane3Normal = (0, 0, 1)
72 ClipAtts.planeInverse = 0
73 ClipAtts.planeToolControlledClipPlane = ClipAtts.Plane1 # None, Plane1, Plane2, Plane3
74 ClipAtts.center = (0, 0, 0)
75 ClipAtts.radius = 0.06 + (i+1)*dx
76 ClipAtts.sphereInverse = 1
77 SetOperatorOptions(ClipAtts, 1)
78 DrawPlots()
79 Query("Average Value")
80 t2 = GetQueryOutputValue()
81 str = "%25.15e %25.15e\n" %(ClipAtts.radius, t2)
82 #Not sure how to differentiate clips..., would like the outer radius
83 f.write(str)
84 RemoveAllOperators(1)
85f.close()
86DeleteAllPlots()
87OpenDatabase(filename)
88AddPlot("Curve", "average_vrad")
89DrawPlots()