Ticket #4021: TestLogFileTimeRange.py

File TestLogFileTimeRange.py, 1014 bytes (added by Karl Palmen, 9 years ago)
Line 
1# random choice of run. Temp_Sample has 82 entries according to the dialog box ws=mtd["hifi00029177"]
2ws=mtd["hifi00025091"]
3r= ws.getRun()
4
5time_array = r.getLogData("Temp_Sample").times
6
7value_array = r.getLogData("Temp_Sample").value
8
9# print time_array
10# print value_array
11print "log point 0  ", time_array[0]
12print "log point 2  ", time_array[2]
13print "log point 3  ", time_array[3]
14print "log point 50 ", time_array[50]
15print "start time   ", r.getProperty("run_start").value
16
17#print dir(time_array[1])
18#print time_array[1].year()
19
20if (time_array[1] > r.getProperty("run_start").value) :
21        print "point 1 is in the run"
22else:
23        print "point 1 before run starts"
24
25if (time_array[50] > r.getProperty("run_start").value) :
26        print "point 50 is in the run"
27else:
28        print "point 50 before run starts"
29
30if (time_array[50] > time_array[1]) :
31        print "time going forwards"
32else:
33        print "times going backwards!"
34
35if (time_array[1] > time_array[50]) :
36        print "time going backwards"
37else:
38        print "times going forwards!"
39
40