Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
ToolBox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SCS
ToolBox
Commits
0a027bad
Commit
0a027bad
authored
2 years ago
by
Laurent Mercadier
Browse files
Options
Downloads
Patches
Plain Diff
Add get_sase_pId() and load bpt only if number of pulses changes in load()
parent
a15e1866
No related branches found
No related tags found
1 merge request
!234
Only use bunch pattern table when necessary
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/toolbox_scs/load.py
+24
-6
24 additions, 6 deletions
src/toolbox_scs/load.py
with
24 additions
and
6 deletions
src/toolbox_scs/load.py
+
24
−
6
View file @
0a027bad
...
@@ -152,12 +152,16 @@ def load(proposalNB=None, runNB=None,
...
@@ -152,12 +152,16 @@ def load(proposalNB=None, runNB=None,
data_arrays
=
[]
data_arrays
=
[]
run_mnemonics
=
mnemonics_for_run
(
run
)
run_mnemonics
=
mnemonics_for_run
(
run
)
# load pulse pattern info
# load pulse pattern info only if number of sase 3 pulses changed
bpt
=
load_bpt
(
run
,
run_mnemonics
=
run_mnemonics
)
sase3
,
sase3_changed
=
get_sase_pId
(
run
)
if
bpt
is
None
:
if
sase3_changed
:
log
.
warning
(
'
Bunch pattern table not found in run. Skipping!
'
)
log
.
warning
(
'
Number of pulses changed during the run.
'
else
:
'
Loading bunch pattern table.
'
)
data_arrays
.
append
(
bpt
)
bpt
=
load_bpt
(
run
,
run_mnemonics
=
run_mnemonics
)
if
bpt
is
None
:
log
.
warning
(
'
Bunch pattern table not found in run. Skipping!
'
)
else
:
data_arrays
.
append
(
bpt
)
for
f
in
fields
:
for
f
in
fields
:
if
type
(
f
)
==
dict
:
if
type
(
f
)
==
dict
:
...
@@ -505,3 +509,17 @@ def load_bpt(run, merge_with=None, run_mnemonics=None):
...
@@ -505,3 +509,17 @@ def load_bpt(run, merge_with=None, run_mnemonics=None):
return
bpt
return
bpt
log
.
debug
(
'
Could not find bunch pattern table.
'
)
log
.
debug
(
'
Could not find bunch pattern table.
'
)
return
None
return
None
def
get_sase_pId
(
run
,
sase
=
'
sase3
'
):
mnemonics
=
mnemonics_for_run
(
run
)
if
sase
not
in
mnemonics
:
# bunch pattern not recorded
return
[],
True
npulse_sase
=
np
.
unique
(
get_array
(
run
,
'
npulses_
'
+
sase
))
if
len
(
npulse_sase
)
==
1
:
return
np
.
unique
(
load_run_values
(
run
)[
sase
])[
1
:],
False
# number of pulses changed during the run
return
np
.
unique
(
get_array
(
run
,
sase
))[
1
:],
True
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