Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iexcode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
29id
iexcode
Commits
187aab91
Commit
187aab91
authored
2 years ago
by
29iduser
Browse files
Options
Downloads
Patches
Plain Diff
debug
parent
433d2a28
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
iexcode/instruments/utilities.py
+0
-10
0 additions, 10 deletions
iexcode/instruments/utilities.py
iexcode/macros/start_of_the_week.py
+41
-18
41 additions, 18 deletions
iexcode/macros/start_of_the_week.py
requirements.txt
+2
-0
2 additions, 0 deletions
requirements.txt
with
43 additions
and
28 deletions
iexcode/instruments/utilities.py
+
0
−
10
View file @
187aab91
...
@@ -70,16 +70,6 @@ def input_timeout(question,t):
...
@@ -70,16 +70,6 @@ def input_timeout(question,t):
else
:
else
:
print
(
"
You said nothing!
"
)
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
'
):
def
play_sound
(
sound
=
'
train
'
):
"""
"""
...
...
This diff is collapsed.
Click to expand it.
iexcode/macros/start_of_the_week.py
+
41
−
18
View file @
187aab91
...
@@ -22,6 +22,23 @@ global m3r_camNum
...
@@ -22,6 +22,23 @@ global m3r_camNum
m3r_camNum
=
6
m3r_camNum
=
6
def
sotw
(
grt
,
branch
,
wait
=
False
,
**
kwarg
):
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
)
StartOfTheWeek
(
grt
,
branch
,
wait
=
wait
,
**
kwarg
)
def
default_detectors
(
branch
):
def
default_detectors
(
branch
):
...
@@ -54,7 +71,9 @@ def interactive_fct():
...
@@ -54,7 +71,9 @@ def interactive_fct():
if
flag
==
'
1
'
:
if
flag
==
'
1
'
:
print
(
'
\n
resuming script...
\n
'
)
print
(
'
\n
resuming script...
\n
'
)
if
flag
==
'
2
'
:
if
flag
==
'
2
'
:
print
(
'
\n
repeating scan...
\n
'
)
print
(
'
\n
repeating scan...
\n
'
)
if
flag
==
''
:
return
return
flag
return
flag
def
input2float
(
ask
,
default_x
=
0
):
def
input2float
(
ask
,
default_x
=
0
):
...
@@ -129,6 +148,8 @@ def interactive_fit_mda(val_name,scannum,det,FWHM_or_PolyOrder,fct,**kwargs):
...
@@ -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
))
position
=
fit_mda
(
scannum
,
det
,
FWHM_or_PolyOrder
,
fct
,
xrange
=
(
x1
,
x2
))
plt
.
show
()
plt
.
show
()
flagfit
=
2
flagfit
=
2
if
flatfit
==
''
:
return
return
flagfit
,
position
return
flagfit
,
position
def
sotw_BLinit
(
branch
):
def
sotw_BLinit
(
branch
):
...
@@ -215,11 +236,11 @@ def sotw_ID_steering(detCA4,**kwargs):
...
@@ -215,11 +236,11 @@ def sotw_ID_steering(detCA4,**kwargs):
scanNum_v
=
last_mda
()
scanNum_v
=
last_mda
()
flagfit
,
h
=
interactive_fit_mda
(
'
H_center
'
,
scanNum_h
,
detCA4
,
1
,
'
gauss
'
,
xrange
=
[
-
1
,
1
])
flagfit
,
h
=
interactive_fit_mda
(
'
H_center
'
,
scanNum_h
,
detCA4
,
1
,
'
gauss
'
,
xrange
=
[
-
1
,
1
])
if
flagfit
==
''
:
if
flagfit
==
''
or
flag
<
0
:
return
return
flagfit
,
v
=
interactive_fit_mda
(
'
V_center
'
,
scanNum_v
,
detCA4
,
1
,
'
gauss
'
,
xrange
=
[
-
1
,
1
])
flagfit
,
v
=
interactive_fit_mda
(
'
V_center
'
,
scanNum_v
,
detCA4
,
1
,
'
gauss
'
,
xrange
=
[
-
1
,
1
])
if
flagfit
==
''
:
if
flagfit
==
''
or
flag
<
0
:
return
return
try
:
try
:
ID_steering_message
(
h
,
v
)
ID_steering_message
(
h
,
v
)
...
@@ -298,22 +319,24 @@ def sotw_slit_vs_mono(slit_name,**kwargs):
...
@@ -298,22 +319,24 @@ def sotw_slit_vs_mono(slit_name,**kwargs):
FMB_mirror_move
(
1
,
'
RZ
'
,
new_roll
)
FMB_mirror_move
(
1
,
'
RZ
'
,
new_roll
)
sleep
(
2
)
sleep
(
2
)
FMB_mirror_get
(
1
)
FMB_mirror_get
(
1
)
print
(
'
\n
repeating 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
flag
==
2
except
:
except
:
print
(
'
\invalid input; unable to move M1
'
)
print
(
'
\invalid input; unable to move M1
'
)
flag
=
interactive_fct
()
flag
=
interactive_fct
()
print
(
'
\n
repeating 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
return
flag
,
v
,
h
...
@@ -428,7 +451,7 @@ def StartOfTheWeek(grt,branch,wait=False,**kwargs):
...
@@ -428,7 +451,7 @@ def StartOfTheWeek(grt,branch,wait=False,**kwargs):
flag
=
2
flag
=
2
while
flag
>
1
:
while
flag
>
1
:
flag
=
sotw_ID_steering
(
detCA4
,
**
kwargs
)
flag
=
sotw_ID_steering
(
detCA4
,
**
kwargs
)
if
flag
==
''
:
if
flag
==
''
or
flag
<
0
:
return
return
diagnostic
(
'
mesh_W
'
,
'
out
'
)
diagnostic
(
'
mesh_W
'
,
'
out
'
)
...
@@ -437,7 +460,7 @@ def StartOfTheWeek(grt,branch,wait=False,**kwargs):
...
@@ -437,7 +460,7 @@ def StartOfTheWeek(grt,branch,wait=False,**kwargs):
if
'
wire
'
in
kwargs
[
'
scanType
'
]:
if
'
wire
'
in
kwargs
[
'
scanType
'
]:
print
(
"
\n\n
================== Slit 1A scans:
"
)
print
(
"
\n\n
================== Slit 1A scans:
"
)
flag
=
sotw_wire
(
detH
,
detV
,
**
kwargs
)
flag
=
sotw_wire
(
detH
,
detV
,
**
kwargs
)
if
flag
==
''
:
if
flag
==
''
or
flag
<
0
:
return
return
###### Mono/slit scans:
###### Mono/slit scans:
...
@@ -454,7 +477,7 @@ def StartOfTheWeek(grt,branch,wait=False,**kwargs):
...
@@ -454,7 +477,7 @@ def StartOfTheWeek(grt,branch,wait=False,**kwargs):
print
(
"
\n\n
================== Mono/slit scans:
"
)
print
(
"
\n\n
================== Mono/slit scans:
"
)
flag
=
sotw_slit_positions
(
grt
,
**
kwargs
)
flag
=
sotw_slit_positions
(
grt
,
**
kwargs
)
if
flag
==
''
:
if
flag
==
''
or
flag
<
0
:
return
return
...
...
This diff is collapsed.
Click to expand it.
requirements.txt
+
2
−
0
View file @
187aab91
...
@@ -7,3 +7,5 @@ netCDF4
...
@@ -7,3 +7,5 @@ netCDF4
pyepics
pyepics
playsound
#pygobject
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment