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
90c9a732
Commit
90c9a732
authored
2 years ago
by
Laurent Mercadier
Browse files
Options
Downloads
Patches
Plain Diff
introduce extract_fadc, extract_adq412, etc...
parent
3a956b5c
No related branches found
No related tags found
1 merge request
!215
Clean digitizers peak functions and add documentation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/toolbox_scs/load.py
+38
-18
38 additions, 18 deletions
src/toolbox_scs/load.py
with
38 additions
and
18 deletions
src/toolbox_scs/load.py
+
38
−
18
View file @
90c9a732
...
@@ -40,12 +40,16 @@ def load(proposalNB=None, runNB=None,
...
@@ -40,12 +40,16 @@ def load(proposalNB=None, runNB=None,
validate
=
False
,
validate
=
False
,
subset
=
ed
.
by_index
[:],
subset
=
ed
.
by_index
[:],
rois
=
{},
rois
=
{},
extract_
tim
=
True
,
extract_
adq412
=
True
,
extract_
laser
=
True
,
extract_
fadc
=
True
,
extract_xgm
=
True
,
extract_xgm
=
True
,
extract_bam
=
True
,
extract_bam
=
True
,
tim_bp
=
'
sase3
'
,
adq412_bp
=
'
sase3
'
,
laser_bp
=
'
scs_ppl
'
,
fadc_bp
=
'
scs_ppl
'
,
extract_tim
=
None
,
extract_laser
=
None
,
tim_bp
=
None
,
laser_bp
=
None
,
):
):
"""
"""
Load a run and extract the data. Output is an xarray with aligned
Load a run and extract the data. Output is an xarray with aligned
...
@@ -82,12 +86,12 @@ def load(proposalNB=None, runNB=None,
...
@@ -82,12 +86,12 @@ def load(proposalNB=None, runNB=None,
'
dim
'
: [
'
ref_x
'
,
'
ref_y
'
]},
'
dim
'
: [
'
ref_x
'
,
'
ref_y
'
]},
'
sam
'
: {
'
roi
'
:by_index[1050:1210, 535:720],
'
sam
'
: {
'
roi
'
:by_index[1050:1210, 535:720],
'
dim
'
: [
'
sam_x
'
,
'
sam_y
'
]}}}
'
dim
'
: [
'
sam_x
'
,
'
sam_y
'
]}}}
extract_
tim
: bool
extract_
adq412
: bool
If True, extracts the peaks from
TIM
variables (e.g.
'
MCP2raw
'
,
If True, extracts the peaks from
ADQ412
variables (e.g.
'
MCP2raw
'
,
'
MCP3apd
'
) and aligns the pulse Id with the sase3 bunch pattern.
'
MCP3apd
'
) and aligns the pulse Id with the sase3 bunch pattern.
extract_
laser
: bool
extract_
fadc
: bool
If True, extracts the peaks from FastADC variables (e.g.
'
FastADC5raw
'
,
If True, extracts the peaks from FastADC variables (e.g.
'
FastADC5raw
'
,
'
FastADC3peaks
'
) and aligns the pulse Id
with the PP laser
bunch
'
FastADC3peaks
'
) and aligns the pulse Id
according to the fadc_bp
bunch
pattern.
pattern.
extract_xgm: bool
extract_xgm: bool
If True, extracts the values from XGM variables (e.g.
'
SCS_SA3
'
,
If True, extracts the values from XGM variables (e.g.
'
SCS_SA3
'
,
...
@@ -103,6 +107,12 @@ def load(proposalNB=None, runNB=None,
...
@@ -103,6 +107,12 @@ def load(proposalNB=None, runNB=None,
bunch pattern used to extract the TIM pulses.
bunch pattern used to extract the TIM pulses.
Ignored if extract_tim=False.
Ignored if extract_tim=False.
DEPRECATED ARGUMENTS:
extract_tim: DEPRECATED. Use extract_adq412 instead.
extract_laser: DEPRECATED. Use extract fadc instead.
tim_bp: DEPRECATED. Use adq412_bp instead.
laser_bp: DEPRECATED. Use fadc_bp instead.
Returns
Returns
-------
-------
run, data: DataCollection, xarray.DataArray
run, data: DataCollection, xarray.DataArray
...
@@ -194,16 +204,26 @@ def load(proposalNB=None, runNB=None,
...
@@ -194,16 +204,26 @@ def load(proposalNB=None, runNB=None,
data
=
xr
.
merge
(
data_arrays
,
join
=
'
inner
'
)
data
=
xr
.
merge
(
data_arrays
,
join
=
'
inner
'
)
data
.
attrs
[
'
runFolder
'
]
=
runFolder
data
.
attrs
[
'
runFolder
'
]
=
runFolder
tim
=
[
k
for
k
in
run_mnemonics
if
'
MCP
'
in
k
and
k
in
data
]
# backward compatibility with old-defined variables:
if
extract_tim
and
len
(
tim
)
>
0
:
if
extract_tim
is
not
None
:
data
=
tbdet
.
get_tim_peaks
(
run
,
mnemonics
=
tim
,
merge_with
=
data
,
extract_adq412
=
extract_tim
bunchPattern
=
tim_bp
)
if
extract_laser
is
not
None
:
extract_fadc
=
extract_laser
laser
=
[
k
for
k
in
run_mnemonics
if
'
FastADC
'
in
k
and
k
in
data
]
if
tim_bp
is
not
None
:
if
extract_laser
and
len
(
laser
)
>
0
:
adq412_bp
=
tim_bp
data
=
tbdet
.
get_laser_peaks
(
run
,
mnemonics
=
laser
,
merge_with
=
data
,
if
laser_bp
is
not
None
:
bunchPattern
=
laser_bp
)
fadc_bp
=
laser_bp
adq412
=
[
k
for
k
in
run_mnemonics
if
'
MCP
'
in
k
and
k
in
data
]
if
extract_adq412
and
len
(
adq412
)
>
0
:
data
=
tbdet
.
get_digitizer_peaks
(
run
,
mnemonics
=
adq412
,
merge_with
=
data
,
bunchPattern
=
adq412_bp
)
fadc
=
[
k
for
k
in
run_mnemonics
if
'
FastADC
'
in
k
and
k
in
data
]
if
extract_fadc
and
len
(
fadc
)
>
0
:
data
=
tbdet
.
get_digitizer_peaks
(
run
,
mnemonics
=
fadc
,
merge_with
=
data
,
bunchPattern
=
fadc_bp
)
xgm
=
[
'
XTD10_XGM
'
,
'
XTD10_XGM_sigma
'
,
'
XTD10_SA3
'
,
'
XTD10_SA3_sigma
'
,
xgm
=
[
'
XTD10_XGM
'
,
'
XTD10_XGM_sigma
'
,
'
XTD10_SA3
'
,
'
XTD10_SA3_sigma
'
,
'
XTD10_SA1
'
,
'
XTD10_SA1_sigma
'
,
'
SCS_XGM
'
,
'
SCS_XGM_sigma
'
,
'
XTD10_SA1
'
,
'
XTD10_SA1_sigma
'
,
'
SCS_XGM
'
,
'
SCS_XGM_sigma
'
,
...
...
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