Script execution

This commit is contained in:
X11MA
2016-02-04 17:20:03 +01:00
parent 4285841dd2
commit 2437ab5965
+9 -5
View File
@@ -1,5 +1,6 @@
import os
import traceback
import numpy
############################PGM+ID1+ID2###################################################
if str(SET_OFFSETS) == "1":
print "Setting offsets"
@@ -56,13 +57,15 @@ running = False
def _startPlot(type):
global running
sep = "\t"
line_sep = "\r\n"
print "Starting plot: type " + str(type)
running = True
p = plot(None,name="Energy")[0]
s = p.getSeries(0)
cur = 0
time.sleep(3.0)
if (MCP_1 == 1 or MPC_2 ==2):
if (MCP_1 == 1 or MPC_2 == 1):
MCP1 = [[0 for x in range(1)] for x in range(NrCounters.read())]
MCP2 = [[0 for x in range(1)] for x in range(NrCounters.read())]
output_file_MCP1 = output_path+"MCP1"+file_prefix+"_" + suffix + ".dat"
@@ -76,10 +79,11 @@ def _startPlot(type):
if otf_start.read() == 0:
break
e = energy.read()
if (MCP_1 == 1 or MPC_2 ==2):
if (MCP_1 == 1 or MPC_2 == 1):
numpy.vstack([MCP1, MCPArray1.read()])
numpy.vstack([MCP2, MCPArray2.read()])
time.sleep(SamplingTime.read()*0.001)
time.sleep(SamplingTime.read()*0.001)
print MCP_1
if (abs(e-cur)) > 0.1:
v = abs((keithley_2a.read() / ((keithley_1a if (type==1) else keithley_3a).read() )))
s.appendData(e,v)
@@ -88,8 +92,8 @@ def _startPlot(type):
except:
pass
print "Done Plotting"
''' MCP1out.write(MCP1)
MCP2out.write(MCP2) '''
MCP1out.write(MCP1)
MCP2out.write(MCP2)
def startPlot(type = 1):
global task
task = fork((_startPlot,(type,)),)