Skip to content
Snippets Groups Projects
Commit c309c3fd authored by jmcchesn's avatar jmcchesn
Browse files

debug

parent 5f20fca2
No related branches found
No related tags found
No related merge requests found
......@@ -18,9 +18,11 @@ def log_update():
"""
updates the log file with the last scan info
"""
entry_list,pv_list, format_list = BL.log_entries()
logfile_update(BL.endstation_name,BL.ioc,entry_list,pv_list,format_list)
try:
entry_list,pv_list, format_list = BL.log_entries()
logfile_update(BL.endstation_name,BL.ioc,entry_list,pv_list,format_list)
except:
print('No logfile written')
##############################################################################################################
......
......@@ -413,7 +413,8 @@ class ScanRecord:
caput(scan_pv+".R"+str(posNum)+"PV",rbv_pv)
caput(scan_pv+".P"+str(posNum)+"SP",start*1.0)
caput(scan_pv+".P"+str(posNum)+"EP",stop*1.0)
if kwargs['positioner_num'] == 1:
if posNum == 1:
if 'num_points' in kwargs:
if kwargs['num_points'] :
caput(scan_pv+".NPTS",steps_points)
......@@ -681,8 +682,8 @@ class ScanRecord:
print('Scan'+str(i)+': '+drive+'= '+str(start)+' / '+str(stop)+' / '+str(step))
if self.check(scan_dim):
filename = self.prefix(self.ioc)
fileNum = self.fileNum(self.ioc)
filename = self.prefix()
fileNum = self.fileNum()
print(filename+str(fileNum)+" started at ", dateandtime())
scan_pv = self.ioc+"scan"+str(scan_dim)
caput(scan_pv+".EXSC",1,wait=True,timeout=900000) #pushes scan button
......@@ -703,21 +704,24 @@ class ScanRecord:
**kwargs:
execute = True/False (default=True)
see scanRecord.fillin for more options
Previously: Scan_Empty_Go
"""
kwargs.setdefault('execute',True)
kwargs.setdefault('num_points',True)
self.fillin("","",0,npts,1,**kwargs)
sleep(.1)
self.fillin("","",0,npts-1,npts,**kwargs)
time.sleep(.1)
if kwargs['execute']:
self.go(**kwargs)
def time_scan(self,duration_min,step_sec,**kwargs):
def time_scan(self,duration_min,step_min=1,**kwargs):
"""
starts a scan with the readback as time in seconds
duration: total time for the scan in minutes
step_min: steps per minute (sets the detector setting time for this)
**kwargs
execute True/False (default = True)
......@@ -728,10 +732,12 @@ class ScanRecord:
"""
kwargs.setdefault('execute',True)
stop=duration_min*60.0/step_sec
kwargs.update({'detector_settling_time':60.0/step_min})
stop=duration_min*60.0*step_min
self.fillin("","time",1,stop,1,**kwargs)
print("Time scan - Settling time : "+str(step_sec))
print("Time scan - Settling time : "+str(step_min))
if kwargs['execute']:
self.go(**kwargs)
......
......@@ -18,9 +18,11 @@ def log_update():
"""
updates the log file with the last scan info
"""
entry_list,pv_list, format_list = BL.log_entries()
logfile_update(BL.endstation_name,BL.ioc,entry_list,pv_list,format_list)
try:
entry_list,pv_list, format_list = BL.log_entries()
logfile_update(BL.endstation_name,BL.ioc,entry_list,pv_list,format_list)
except:
print('No logfile written')
##############################################################################################################
......
......@@ -413,7 +413,8 @@ class ScanRecord:
caput(scan_pv+".R"+str(posNum)+"PV",rbv_pv)
caput(scan_pv+".P"+str(posNum)+"SP",start*1.0)
caput(scan_pv+".P"+str(posNum)+"EP",stop*1.0)
if kwargs['positioner_num'] == 1:
if posNum == 1:
if 'num_points' in kwargs:
if kwargs['num_points'] :
caput(scan_pv+".NPTS",steps_points)
......@@ -681,8 +682,8 @@ class ScanRecord:
print('Scan'+str(i)+': '+drive+'= '+str(start)+' / '+str(stop)+' / '+str(step))
if self.check(scan_dim):
filename = self.prefix(self.ioc)
fileNum = self.fileNum(self.ioc)
filename = self.prefix()
fileNum = self.fileNum()
print(filename+str(fileNum)+" started at ", dateandtime())
scan_pv = self.ioc+"scan"+str(scan_dim)
caput(scan_pv+".EXSC",1,wait=True,timeout=900000) #pushes scan button
......@@ -703,21 +704,24 @@ class ScanRecord:
**kwargs:
execute = True/False (default=True)
see scanRecord.fillin for more options
Previously: Scan_Empty_Go
"""
kwargs.setdefault('execute',True)
kwargs.setdefault('num_points',True)
self.fillin("","",0,npts,1,**kwargs)
sleep(.1)
self.fillin("","",0,npts-1,npts,**kwargs)
time.sleep(.1)
if kwargs['execute']:
self.go(**kwargs)
def time_scan(self,duration_min,step_sec,**kwargs):
def time_scan(self,duration_min,step_min=1,**kwargs):
"""
starts a scan with the readback as time in seconds
duration: total time for the scan in minutes
step_min: steps per minute (sets the detector setting time for this)
**kwargs
execute True/False (default = True)
......@@ -728,10 +732,14 @@ class ScanRecord:
"""
kwargs.setdefault('execute',True)
stop=duration_min*60.0/step_sec
self.fillin("","time",1,stop,1,**kwargs)
kwargs.update({'detector_settling_time':60.0/step_min})
stop = duration_min
#num_pnts = duration_min * step_min
dwell = 60/step_min
self.fillin("","time",dwell/60,stop,dwell/60,**kwargs)
print("Time scan - Settling time : "+str(step_sec))
print("Time scan - Settling time : "+str(step_min))
if kwargs['execute']:
self.go(**kwargs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment