1 | def createVULCANWorkspace(): |
---|
2 | """ |
---|
3 | """ |
---|
4 | import mantid.simpleapi as api |
---|
5 | |
---|
6 | api.Load(Filename = "/home/wzz/Projects/MantidTests/Tickets/9101_VULCAN_RecordTxt/VULCAN_42583_event.nxs", |
---|
7 | OutputWorkspace = "VULCAN_42583", |
---|
8 | MetaDataOnly = True, |
---|
9 | LoadLogs = True) |
---|
10 | |
---|
11 | wksp = AnalysisDataService.retrieve("VULCAN_42583") |
---|
12 | |
---|
13 | return wksp |
---|
14 | |
---|
15 | def createVULCANRecordTitles(): |
---|
16 | """ Create a list of records for VULCAN |
---|
17 | """ |
---|
18 | titlebase = [ |
---|
19 | ("RUN", "run_number", None), |
---|
20 | ("IPTS", "IPTS", None), |
---|
21 | ("Title", "run_title", None), |
---|
22 | ("Notes", "Notes", None), |
---|
23 | ("Sample", "Sample", None), |
---|
24 | ("StartTime", "run_start", None), |
---|
25 | ("Duration", "duration", None), |
---|
26 | ("ProtonCharge", "proton_charge", "sum"), |
---|
27 | ("TotalCounts", "TotalCounts", None), |
---|
28 | ("Monitor1", "Monitor2", None), |
---|
29 | ("Monitor2", "Monitor3", None), |
---|
30 | ("X", "X", "0"), |
---|
31 | ("Y", "Y", "0"), |
---|
32 | ("Z", "Z", "0"), |
---|
33 | ("O", "Omega", "0"), |
---|
34 | ("HROT", "HROT", "0"), |
---|
35 | ("MTSDisplacement", "loadframe.displacement", "0"), |
---|
36 | ("MTSForce", "loadframe.force", "0"), |
---|
37 | ("MTSStrain", "loadframe.strain", "0"), |
---|
38 | ("MTSStress", "loadframe.stress", "0"), |
---|
39 | ("MTSAngle", "loadframe.rot_angle", "0"), |
---|
40 | ("MTSTorque", "loadframe.torque", "0"), |
---|
41 | ("MTSLaser", "loadframe.laser", "0"), |
---|
42 | ("MTSlaserstrain", "loadframe.laserstrain", "0"), |
---|
43 | ("MTSDisplaceoffset","loadframe.x_offset", "0"), |
---|
44 | ("MTSAngleceoffset", "loadframe.rot_offset", "0"), |
---|
45 | ("MTST1", "loadframe.furnace1", "0"), |
---|
46 | ("MTST2", "loadframe.furnace2", "0"), |
---|
47 | ("MTST3", "loadframe.extTC3", "0"), |
---|
48 | ("MTST4", "loadframe.extTC4", "0"), |
---|
49 | ("FurnaceT", "furnace.temp1", "0"), |
---|
50 | ("FurnaceOT", "furnace.temp2", "0"), |
---|
51 | ("FurnacePower", "furnace.power", "0"), |
---|
52 | ("VacT", "partlow1.temp", "0"), |
---|
53 | ("VacOT", "partlow2.temp", "0") |
---|
54 | ] |
---|
55 | |
---|
56 | sampletitles = [] |
---|
57 | samplenames = [] |
---|
58 | sampleops = [] |
---|
59 | |
---|
60 | for i in xrange(len(titlebase)): |
---|
61 | tuple3 = titlebase[i] |
---|
62 | sampletitles.append(tuple3[0]) |
---|
63 | samplenames.append(tuple3[1]) |
---|
64 | sampleops.append(tuple3[2]) |
---|
65 | # ENDFOR |
---|
66 | |
---|
67 | return sampletitles, samplenames, sampleops |
---|
68 | |
---|
69 | |
---|
70 | # Generate the matrix workspace with some logs |
---|
71 | # api.Load(Filename = "/home/wzz/Projects/MantidTests/Tickets/9101_VULCAN_RecordTxt/VULCAN_42583_event.nxs", |
---|
72 | # OutputWorkspace = "VULCAN_42583", |
---|
73 | # MetaDataOnly = True, |
---|
74 | # LoadLogs = True) |
---|
75 | |
---|
76 | ws = createVULCANWorkspace() |
---|
77 | |
---|
78 | vulcantitles, vulcansamplenames, vulcanops = createVULCANRecordTitles() |
---|
79 | |
---|
80 | # Test algorithm |
---|
81 | ExportExperimentLog(InputWorkspace = str(ws), |
---|
82 | OutputFilename = "/tmp/AutoRecord.txt", |
---|
83 | FileMode = "append", |
---|
84 | SampleLogNames = vulcansamplenames, |
---|
85 | SampleLogTitles = vulcantitles, |
---|
86 | SampleLogOperation = vulcanops) |
---|
87 | |
---|