Commit 53065805 authored by Roberto Arturo Homs-Regojo's avatar Roberto Arturo Homs-Regojo
Browse files

- fix mca list when it is empty

parent 5887f416
......@@ -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)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment