Script execution

This commit is contained in:
X11MA
2016-02-04 16:14:44 +01:00
parent 07b32a9aba
commit dedfd97436
+17 -4
View File
@@ -62,21 +62,34 @@ def _startPlot(type):
s = p.getSeries(0)
cur = 0
time.sleep(3.0)
if (MCP_1 == 1 or MPC_2 ==2):
MCP1 = [[0 for x in range(1)] for x in range(NrCounters)]
MCP2 = [[0 for x in range(1)] for x in range(NrCounters)]
output_file_MCP1 = output_path+"MCP1"+file_prefix+"_" + suffix + ".dat"
output_file_MCP2 = output_path+"MCP2"+file_prefix+"_" + suffix + ".dat"
open(output_file_MCP1, "w+") as MCP1out
open(output_file_MCP2, "w+") as MCP2out
MCP1out.write("rbkenergy" + sep + "Sum1" + sep + "Sum2" + sep + "Cam1" + sep + "Cam2" + sep + "Array" + line_sep)
MCP2out.write("rbkenergy" + sep + "Sum1" + sep + "Sum2" + sep + "Cam1" + sep + "Cam2" + sep + "Array" + line_sep)
while running:
try:
if otf_start.read() == 0:
break
e = energy.read()
if (MCP_1 == 1 or MPC_2 ==2):
numpy.vstack([MCP1, MCPArray1.read()])
numpy.vstack([MCP2, MCPArray2.read()])
time.sleep(SamplingTime.read()*0.001)
if (abs(e-cur)) > 0.1:
v = abs((keithley_2a.read() / ((keithley_1a if (type==1) else keithley_3a).read() )))
s.appendData(e,v)
cur = e
time.sleep(0.2)
cur = e
# time.sleep(0.2)
except:
pass
print "Done Plotting"
MCP1out.write(MCP1)
MCP2out.write(MCP2)
def startPlot(type = 1):
global task
task = fork((_startPlot,(type,)),)