Skip to content
Snippets Groups Projects
Commit 187aab91 authored by 29iduser's avatar 29iduser
Browse files

debug

parent 433d2a28
No related branches found
No related tags found
No related merge requests found
......@@ -70,16 +70,6 @@ def input_timeout(question,t):
else:
print("You said nothing!")
def playsound(sound='FF'):
"""
'FF' Final Fantasy victory sound
'ding' a subtle ding noise
'hallelujah' hallelujah chorus
'train' train whistle
'drumroll'
'beepboop
"""
play_sound(sound)
def play_sound(sound='train'):
"""
......
......@@ -22,6 +22,23 @@ global m3r_camNum
m3r_camNum = 6
def sotw(grt,branch,wait=False,**kwarg):
""" This should be run every at the start of every week.
If wait=True, wait for next day a 8:05.
**kwargs:
mode: polarization, default => RCP
repeat: True/False
True => doesn't do any initialization
False => resets everything (switches branch and grating)
scanType = ['slit1','wire','monoVslit','flux',]
sound: plays sound when a scantype is completed, default => True
# for individiual scantypes
slit1A_extended: to take a larger range, default => False
monoVslit_quick:
True => takes a single line cut (default)
False => """
StartOfTheWeek(grt,branch,wait=wait,**kwarg)
def default_detectors(branch):
......@@ -54,7 +71,9 @@ def interactive_fct():
if flag == '1':
print('\nresuming script...\n')
if flag == '2':
print('\nrepeating scan...\n')
print('\nrepeating scan...\n')
if flag == '':
return
return flag
def input2float(ask,default_x=0):
......@@ -129,6 +148,8 @@ def interactive_fit_mda(val_name,scannum,det,FWHM_or_PolyOrder,fct,**kwargs):
position = fit_mda(scannum,det,FWHM_or_PolyOrder,fct,xrange=(x1,x2))
plt.show()
flagfit=2
if flatfit == '':
return
return flagfit,position
def sotw_BLinit(branch):
......@@ -215,11 +236,11 @@ def sotw_ID_steering(detCA4,**kwargs):
scanNum_v = last_mda()
flagfit, h = interactive_fit_mda('H_center',scanNum_h,detCA4,1,'gauss',xrange=[-1,1])
if flagfit == '':
if flagfit == '' or flag <0:
return
flagfit, v = interactive_fit_mda('V_center',scanNum_v,detCA4,1,'gauss',xrange=[-1,1])
if flagfit == '':
if flagfit == '' or flag <0:
return
try:
ID_steering_message(h,v)
......@@ -298,22 +319,24 @@ def sotw_slit_vs_mono(slit_name,**kwargs):
FMB_mirror_move(1,'RZ',new_roll)
sleep(2)
FMB_mirror_get(1)
print('\nrepeating scans...')
#update M1 dictionary
foo=input('Do you want to update the M1 (y or n)? >')
if foo[0].lower() == 'y':
try:
#update_mirror_dict(1)
print_warning_message("need to debug update_mirror_dict, do by hand")
except:
print_warning_message("couldn't update the mirror dictionary, do by hand")
if flag == '':
return
flag == 2
except:
print('\invalid input; unable to move M1')
flag = interactive_fct()
flag = interactive_fct()
print('\nrepeating scans...')
#update M1 dictionary
foo=input('Do you want to update the M1 (y or n)? >')
if foo[0].lower() == 'y':
try:
#update_mirror_dict(1)
print_warning_message("need to debug update_mirror_dict, do by hand")
except:
print_warning_message("couldn't update the mirror dictionary, do by hand")
if flag == '':
return
return flag,v,h
......@@ -428,7 +451,7 @@ def StartOfTheWeek(grt,branch,wait=False,**kwargs):
flag=2
while flag>1:
flag = sotw_ID_steering(detCA4,**kwargs)
if flag == '':
if flag == '' or flag <0:
return
diagnostic('mesh_W','out')
......@@ -437,7 +460,7 @@ def StartOfTheWeek(grt,branch,wait=False,**kwargs):
if 'wire' in kwargs['scanType']:
print("\n\n================== Slit 1A scans:")
flag = sotw_wire(detH,detV,**kwargs)
if flag == '':
if flag == ''or flag <0:
return
###### Mono/slit scans:
......@@ -454,7 +477,7 @@ def StartOfTheWeek(grt,branch,wait=False,**kwargs):
print("\n\n================== Mono/slit scans:")
flag =sotw_slit_positions(grt,**kwargs)
if flag == '':
if flag == '' or flag <0:
return
......
......@@ -7,3 +7,5 @@ netCDF4
pyepics
playsound
#pygobject
\ No newline at end of file
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