Startup
This commit is contained in:
@@ -21,7 +21,7 @@ bphase.config.resolution = 1.0
|
||||
bphase.config.save()
|
||||
bphase.initialize()
|
||||
st = Stream("Schottky", dispatcher)
|
||||
q = st.addScalar("Charge", "SINEG01-DICT215:B1_CHARGE", 1, 0)
|
||||
q = st.addScalar("Charge", "SINEG01-DICT215:B1_CHARGE", 1, 0)
|
||||
st.initialize()
|
||||
st.start()
|
||||
rphase = Channel("SINEG01-RSYS:GET-VSUM-PHASE", type = 'd', alias = 'RF phase')
|
||||
@@ -37,17 +37,20 @@ try:
|
||||
rfphase = [val.mean for val in r.getReadable(1)]
|
||||
rfphaserms = [val.stdev for val in r.getReadable(1)]
|
||||
finally:
|
||||
bphase.write(phase0)
|
||||
bphase.write(bphase0)
|
||||
bphase.close()
|
||||
st.close()
|
||||
q.close()
|
||||
rphase.close()
|
||||
|
||||
#Setting the return value
|
||||
print "MAX CHARGE = " , max(charge)
|
||||
index_max = charge.index(max(charge))
|
||||
print "INDEX = " , index_max
|
||||
rphase_ref = rfphase[index_max] - 80
|
||||
bphase_ref = bphase[index_max] - 80
|
||||
|
||||
set_return(rphase_ref)
|
||||
set_return([rphase_ref, bphase_ref])
|
||||
|
||||
# save the entry in the logbook
|
||||
#if get_option("Generated data file:\n" + get_exec_pars().path +"\n\n" + "Save to ELOG?", "YesNo") == "Yes":
|
||||
|
||||
@@ -81,8 +81,8 @@ amplitude_scale = fit_amplitude / Ampl
|
||||
power_scale = Power / math.pow(Ampl,2)
|
||||
|
||||
caput(station + "-RSYS:SET-VSUM-PHASE-OFFSET-BASE", phase_offset)
|
||||
caput(station + "-RSYS:SET-VSUM-AMPLT-SCALE", amplitude_scale)
|
||||
caput(station + "-RSYS:SET-VOLT-POWER-SCALE", power_scale)
|
||||
#caput(station + "-RSYS:SET-VSUM-AMPLT-SCALE", amplitude_scale)
|
||||
#caput(station + "-RSYS:SET-VOLT-POWER-SCALE", power_scale)
|
||||
|
||||
#title="Phase scan "+str(station)
|
||||
#message=("Energy Gain: %0.3f" % energy_gain + "MeV\n" +
|
||||
|
||||
Reference in New Issue
Block a user