Saving Min Max and Average values over time
This function saves a plot's minimum, maximum, and average values over time to curve files that can be read in by VisIt.
def SaveMinMaxAvgCurves(minname, maxname, avgname):
minfile = open(minname, "wt")
maxfile = open(maxname, "wt")
avgfile = open(avgname, "wt")
w = GetWindowInformation()
cts = w.timeSliderCurrentStates[w.activeTimeSlider]
for i in range(TimeSliderGetNStates()):
SetTimeSliderState(i)
Query("Time")
t = GetQueryOutputValue()
Query("MinMax")
minfile.write("%g %g\n" % (t, GetQueryOutputValue()[0]))
maxfile.write("%g %g\n" % (t, GetQueryOutputValue()[1]))
Query("Variable Sum")
sum = GetQueryOutputValue()
Query("NumZones")
nzones = GetQueryOutputValue()
avgfile.write("%g %g\n" % (t, sum/nzones))
minfile.close()
maxfile.close()
avgfile.close()
SetTimeSliderState(cts)
SaveMinMaxAvgCurves("min.curve", "max.curve", "avg.curve")