Closedown
This commit is contained in:
@@ -12,7 +12,7 @@ import datetime
|
||||
|
||||
use_bpm = False
|
||||
|
||||
if get_context().source == CommandSource.ui:
|
||||
if get_exec_pars().source == CommandSource.ui:
|
||||
I1 = 95.0
|
||||
I2 = 100.0
|
||||
dI = 1.0
|
||||
@@ -116,7 +116,7 @@ else:
|
||||
hx.append(hx[0]); hy.append(hy[0])
|
||||
|
||||
# save the entry in the logbook
|
||||
gsa_log_msg = "Data file: " + get_context().path
|
||||
gsa_log_msg = "Data file: " + get_exec_pars().path
|
||||
gsa_log_msg = gsa_log_msg + "\nImages: " + str(number_images)
|
||||
gsa_log_msg = gsa_log_msg + "\nBackground: enabled=" + str(use_background) + " multiple=" + str(multiple_background) + " number=" + str(number_backgrounds)
|
||||
gsa_log_msg = gsa_log_msg + "\n\n" + r.print()
|
||||
|
||||
@@ -12,7 +12,7 @@ import datetime
|
||||
|
||||
use_bpm = False
|
||||
|
||||
if get_context().source == CommandSource.ui:
|
||||
if get_exec_pars().source == CommandSource.ui:
|
||||
phi1= 95.0
|
||||
phi2 = 100.0
|
||||
dphi = 1.0
|
||||
@@ -116,7 +116,7 @@ else:
|
||||
|
||||
|
||||
# save the entry in the logbook
|
||||
gsa_log_msg = "Data file: " + get_context().path
|
||||
gsa_log_msg = "Data file: " + get_exec_pars().path
|
||||
gsa_log_msg = gsa_log_msg + "\nImages: " + str(number_images) + " Background: enabled=" + str(use_background) + " multiple=" + str(multiple_background) + " number=" + str(number_backgrounds)
|
||||
gsa_log_msg = gsa_log_msg + "\nPhase range: " + str(phi1) + " to " + str(phi2)
|
||||
gsa_log_msg = gsa_log_msg + "\nLaser position on cathod: " + str(caget("SLG-LCAM-C103:FIT-XPOS")) + "/" + str(caget("SLG-LCAM-C103:FIT-YPOS"))
|
||||
|
||||
@@ -5,7 +5,7 @@ from plotutils import plot_line, plot_function
|
||||
from ch.psi.pshell.swing.Shell import STDOUT_COLOR
|
||||
import org.apache.commons.math3.stat.correlation.PearsonsCorrelation as PearsonsCorrelation
|
||||
|
||||
if get_context().source == CommandSource.ui:
|
||||
if get_exec_pars().source == CommandSource.ui:
|
||||
#dx = "SINEG01-RLLE-REF10:SIG-PHASE-AVG"
|
||||
#dy = "SINEG01-RLLE-REF20:SIG-PHASE-AVG"
|
||||
#dx = "SINEG01-RGUN-PUP10:SIG-AMPLT-AVG 4"
|
||||
@@ -110,7 +110,7 @@ try:
|
||||
|
||||
sd.setPointSize(4)
|
||||
|
||||
if get_context().source == CommandSource.ui:
|
||||
if get_exec_pars().source == CommandSource.ui:
|
||||
if globals().has_key("marker"):
|
||||
p.removeMarker(marker)
|
||||
marker=None
|
||||
@@ -138,7 +138,7 @@ try:
|
||||
corr= PearsonsCorrelation().correlation(to_array(ax,'d'), to_array(ay,'d'))
|
||||
s = "Correlation=" + str(round(corr,4))
|
||||
#print s
|
||||
if get_context().source == CommandSource.ui:
|
||||
if get_exec_pars().source == CommandSource.ui:
|
||||
if marker is not None:
|
||||
p.removeMarker(marker)
|
||||
marker = p.addMarker(x2+res, p.AxisId.X, s, p.getBackground())
|
||||
|
||||
@@ -6,4 +6,4 @@ instrument = Channel("SINEG01-DICT215:B1_CHARGE", 'd', alias = "Bunch Charge (IC
|
||||
r = lscan(knob, [instrument], 0, 360., 10.,2.0)
|
||||
|
||||
|
||||
elog("SchottkyICT", "Data file: " + get_context().path + "\n\n" + r.print() , get_plot_snapshots())
|
||||
elog("SchottkyICT", "Data file: " + get_exec_pars().path + "\n\n" + r.print() , get_plot_snapshots())
|
||||
|
||||
@@ -7,7 +7,7 @@ import ch.psi.pshell.epics.ControlledVariable as ControlledVariable
|
||||
|
||||
latency = 0.05
|
||||
|
||||
if get_context().source == CommandSource.ui:
|
||||
if get_exec_pars().source == CommandSource.ui:
|
||||
prefix = "MINSB03-RSYS"
|
||||
start = -170.0
|
||||
stop = 180.0
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import ch.psi.pshell.epics.ControlledVariable as ControlledVariable
|
||||
|
||||
if get_context().source != CommandSource.ui:
|
||||
if get_exec_pars().source != CommandSource.ui:
|
||||
prefix = args[0] + "-RSYS"
|
||||
|
||||
start = caget(prefix + ":SET-SCAN-START")
|
||||
|
||||
@@ -2,7 +2,7 @@ import ch.psi.pshell.epics.ControlledVariable as ControlledVariable
|
||||
|
||||
latency = 0.05
|
||||
|
||||
if get_context().source == CommandSource.ui:
|
||||
if get_exec_pars().source == CommandSource.ui:
|
||||
prefix = "SINSB04-RSYS"
|
||||
start = 0.0
|
||||
stop = 360.0
|
||||
|
||||
@@ -131,7 +131,7 @@ def elog(title, message, attachments = [], author = None, category = "Info", dom
|
||||
Add entry to ELOG.
|
||||
"""
|
||||
if author is None:
|
||||
author = "pshell" #context.getUser().name
|
||||
author = "pshell" #get_context().user.name
|
||||
typ = "pshell"
|
||||
entry = ""
|
||||
|
||||
@@ -156,7 +156,7 @@ def elog(title, message, attachments = [], author = None, category = "Info", dom
|
||||
raise Exception(err)
|
||||
print out
|
||||
|
||||
def get_plot_snapshots(title = None, file_type = "png", temp_path = context.setup.getContextPath()):
|
||||
def get_plot_snapshots(title = None, file_type = "png", temp_path = get_context().setup.getContextPath()):
|
||||
"""
|
||||
Returns list with file names of plots snapshots from a plotting context.
|
||||
"""
|
||||
@@ -184,7 +184,7 @@ center_x.setPolling(100)
|
||||
center_y.setPolling(100)
|
||||
|
||||
|
||||
if not context.isLocalMode():
|
||||
if not get_context().isLocalMode():
|
||||
try:
|
||||
run("camtool")
|
||||
add_device(CamTool("image_stats", prefix = "SINEG01-DSCR190:", latch = True, camera = "SINEG01-DSCR190", gauss = False), True)
|
||||
@@ -255,13 +255,13 @@ avy = create_averager(comy, 5, 0.001)
|
||||
|
||||
|
||||
#CAS
|
||||
if context.isServerEnabled():
|
||||
if get_context().isServerEnabled():
|
||||
import ch.psi.pshell.epics.CAS as CAS
|
||||
#CAS.setServerPort(5062)
|
||||
|
||||
class ServerUrl(ReadonlyRegisterBase):
|
||||
def doRead(self):
|
||||
return context.server.baseURL
|
||||
return get_context().server.baseURL
|
||||
d = ServerUrl()
|
||||
d.initialize()
|
||||
|
||||
|
||||
@@ -44,6 +44,6 @@ plot(r.getReadable(2), xdata=r.getReadable(1), title = "Centroid excursion")
|
||||
|
||||
# save the entry in the logbook
|
||||
msg = str(r)
|
||||
msg = msg + "\nFile: " + get_context().path
|
||||
msg = msg + "\nFile: " + get_exec_pars().path
|
||||
msg = msg + "\n\n" + r.print()
|
||||
elog("Gun solenoid current scan", msg , get_plot_snapshots())
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
a= rscan(ao1, (ai1,ai2), [(0,5,5), (10,15,20), (20,25,5)] , 0.01)
|
||||
|
||||
msg = str(a)
|
||||
msg = msg + "\nFile: " + get_context().path
|
||||
msg = msg + "\nFile: " + get_exec_pars().path
|
||||
msg = msg + "\n\n" + a.print()
|
||||
elog("Region scan", msg , get_plot_snapshots())
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
#1D vector scan, plot to 1D Vector tab
|
||||
vector = [ 1, 3, 5, 10, 25, 40, 45, 47, 49]
|
||||
a= vscan(ao1,(ai1,ai2),vector,False, 0.5, context = "1D Vector")
|
||||
a= vscan(ao1,(ai1,ai2),vector,False, 0.5, title = "1D Vector")
|
||||
|
||||
|
||||
|
||||
@@ -17,5 +17,5 @@ vector = [ [1,1] , [1,2] , [1,3] , [1,4] ,
|
||||
[2.5,2.5] ,
|
||||
[3,1] , [3,2] , [3,3] , [3,4] ]
|
||||
|
||||
a= vscan((m1,m2),(ai1,ai2),vector,False, 0.1, context = "2D Vector")
|
||||
a= vscan((m1,m2),(ai1,ai2),vector,False, 0.1, title = "2D Vector")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user