This commit is contained in:
voulot_d
2017-06-07 15:05:42 +02:00
parent a6733e4cc5
commit d2155f810c
8 changed files with 82 additions and 64 deletions

View File

@@ -11,7 +11,7 @@ ATTENUATORS = ["SINDI02-DBLM084:M06-1-ATT2-VAL", "SINDI02-DBLM084:M06-2-ATT2-VAL
RANGE = [0.5, 1.1]
STEP_SIZE = 0.01
SETTLING_TIME = 0.5
SIMULATION = True
SIMULATION = False
do_elog = True

View File

@@ -4,22 +4,22 @@ import ch.psi.pshell.epics.DiscretePositioner as DiscretePositioner
#Arguments
SAMPLES = 20
GAINS = ["SINDI02-DBLM084:M06-1-CH03-V-MM","SINDI02-DBLM084:M06-1-CH03-V-MM2",]
SAMPLES = 40
GAINS = ["SINDI02-DBLM084:M06-1-CH03-V-MM","SINDI02-DBLM084:M06-2-CH03-V-MM","S10DI01-DBLM113:M06-1-CH03-V-MM"]
BLMS = ["SINDI02-DBLM025", "SINDI02-DBLM085", "S10DI01-DBLM045"]
BPMS = ["SINDI01-DBPM060:Q1", "SINDI02-DBPM010:Q1"]
ATTENUATORS = ["SINDI02-DBLM084:M06-1-ATT2-VAL", "SINDI02-DBLM084:M06-2-ATT2-VAL", "S10DI01-DBLM113:M06-1-ATT2-VAL"]
RANGE = [0.5, 1.1]
STEP_SIZE = 0.01
STEP_SIZE = 0.1
SETTLING_TIME = 0.5
SIMULATION = True
SIMULATION = False
do_elog = True
gain_positioners = []
for i in range(len(GAINS)):
gain_positioners.append( DummyPositioner("gain " + str(i+1)) if SIMULATION else Channel(GAINS[i], alias = "gain " + str(i+1)))
gain_positioners.append( DummyPositioner("gain " + str(i+1)) if SIMULATION else Channel(GAINS[i], alias = "gain " + str(i+1)))
attenuators = []
for i in range(len(ATTENUATORS)):
att = DiscretePositioner("Att"+str(i+1), ATTENUATORS[i])
@@ -37,8 +37,9 @@ for i in range(len(ATTENUATORS)):
sensors = []
line_plots = []
st = Stream("pulse_id", dispatcher)
st.setFilter("SIN-CVME-TIFGUN-EVR0:BEAMOK == 1")
for i in range(len(BLMS)):
blm = Scalar("blm" + str(i+1), st, BLMS[i] + ":B1_LOSS", 10, 0)
blm = Scalar("blm" + str(i+1), st, BLMS[i] + ":B1_LOSS", 1, 0)
av = create_averager(blm, SAMPLES, interval = -1)
av.setMonitored(i>0)
sensors.append(av)
@@ -52,13 +53,15 @@ for i in range(len(BLMS)):
for i in range(len(BPMS)):
bpm = Scalar("bpm" + str(i+1), st, BPMS[i], 10, 0)
bpm = Scalar("bpm" + str(i+1), st, BPMS[i], 1, 0)
av1 = create_averager(bpm, SAMPLES, interval = -1)
av1.setMonitored(i>0)
sensors.append(av1)
sensors.append(av1.stdev)
sensors.append(av1.samples)
line_plots.append(av1.samples)
#Scalar("beam_ok" , st, "SIN-CVME-TIFGUN-EVR0:BEAMOK" , 1, 0)
st.initialize()
st.start()
st.waitCacheChange(10000) #Wait stream be running before starting scan
@@ -90,7 +93,7 @@ for att in attenuators:
try:
r=lscan(gain_positioners, sensors, [RANGE[0],] * len(gain_positioners), [RANGE[1],] * len(gain_positioners), [STEP_SIZE,] * len(gain_positioners), latency = SETTLING_TIME)
#r=bscan(st, 10)
finally:
st.close()

View File

@@ -5,8 +5,8 @@ import ch.psi.pshell.epics.ControlledVariable as ControlledVariable
#CAMERA = "S10DI01-DSCR020" #"simulation"
#CAMERA = "SINDI02-DLAC055" #"simulation"
CAMERA = "S10BD01-DSCR030" #"simulation"
#CAMERA = "SINDI01-DSCR080" #"simulation"
#CAMERA = "S10BD01-DSCR030" #"simulation"
CAMERA = "SINDI01-DSCR080" #"simulation"
#CAMERA = "SINEG01-DSCR190" #"simulation"
#QUADRUPOLE = "S10CB02-MQUA230" # quadrupole for the scan with S10DI01-DSCR020: S10CB02-MQUA230
CHARGE_BPM = "SINDI01-DBPM060:Q1"
@@ -81,7 +81,7 @@ try:
#readables.insert(0,m)
# lscan(quad, readables, RANGE[0], RANGE[1], STEPS, latency=SETTLING_TIME)
#tscan((m, x_profile, y_profile, x_axis, y_axis, bpm, wcs), 10, 1.0) #Saves 10 samples waiting 1.0 s between them
tscan((m, x_profile, y_profile, x_axis, y_axis, bpm, wcs), 20, 0.11)
tscan((m, x_profile, y_profile, x_axis, y_axis, bpm, wcs), 10, 1)
finally:
# quad.close()
camtool.stop()