Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ID01
id01
Commits
53065805
Commit
53065805
authored
Nov 10, 2020
by
Roberto Arturo Homs-Regojo
Browse files
- fix mca list when it is empty
parent
5887f416
Changes
1
Hide whitespace changes
Inline
Side-by-side
id01/scripts/kmap.py
View file @
53065805
...
...
@@ -716,26 +716,28 @@ def _add_detectors(
# XMAP
# ==================================================================
l_mca
=
kmap_dict
.
get
(
"mca"
,
[])
for
node
in
builder
.
get_nodes_by_controller_type
(
BaseMCA
):
mca
=
node
.
controller
assert
mca
in
l_mca
if
l_
mca
!
=
[]:
for
node
in
builder
.
get_nodes_by_controller_type
(
BaseMCA
):
_log
.
debug
(
f
"
\n
... add detectors / mca [
{
mca
.
name
}
]"
)
mca
=
node
.
controller
assert
mca
in
l_mca
,
f
"mcaCtrl [
{
mca
}
] is not in l_mca [
{
l_mca
}
]"
mca_params
=
{}
mca_params
[
"npoints"
]
=
nb_points
mca_params
[
"trigger_mode"
]
=
McaAcquisitionSlave
.
GATE
_log
.
debug
(
f
"
\n
... add detectors / mca [
{
mca
.
name
}
]"
)
if
not
xmap_save_spectra
:
node
.
_counters
=
[
c
for
c
in
node
.
_counters
if
c
.
name
.
find
(
"spectrum"
)
==
-
1
]
mca_params
=
{}
mca_params
[
"npoints"
]
=
nb_points
mca_params
[
"trigger_mode"
]
=
McaAcquisitionSlave
.
GATE
node
.
set_parameters
(
acq_params
=
mca_params
)
chain
.
add
(
top_master
,
node
)
if
not
xmap_save_spectra
:
node
.
_counters
=
[
c
for
c
in
node
.
_counters
if
c
.
name
.
find
(
"spectrum"
)
==
-
1
]
node
.
set_parameters
(
acq_params
=
mca_params
)
chain
.
add
(
top_master
,
node
)
mcas
.
add
(
mca
)
mcas
.
add
(
mca
)
builder
.
print_tree
(
not_ready_only
=
False
)
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment