-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved channel obtaining by meta data to its own module
- Loading branch information
Showing
5 changed files
with
138 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
Module for importing channel lists from LEGEND meta data | ||
""" | ||
from importlib import import_module | ||
|
||
def legend_meta(params:dict) -> list: | ||
# only import legend meta data when needed. | ||
# LEGEND collaborators can use the meta keyword | ||
# While for users w/o access to the LEGEND meta data this is still working | ||
lm = import_module("legendmeta") | ||
lmeta = lm.LegendMetadata(path=params["meta_path"]) | ||
chmap = lmeta.channelmap(params['time_key']) | ||
tmp = [ | ||
f"ch{e}" | ||
for e in chmap.map("daq.rawid") | ||
if chmap.map("daq.rawid")[e]["system"] == params['system'] | ||
] | ||
if 'usability' not in params.keys(): return tmp | ||
else: | ||
return [e for e in tmp if chmap.map("daq.rawid")[int(e[2:])]["analysis"]["usability"] == params['usability']] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,88 @@ | ||
{ | ||
"channels": { | ||
"geds_on": ["ch1084803", "ch1084804", "ch1121600"] | ||
"channels": { | ||
"geds_on": ["ch1084803", "ch1084804", "ch1121600"] | ||
}, | ||
"operations": { | ||
"multiplicity": { | ||
"channels": "geds_on", | ||
"aggregation_mode": "sum", | ||
"expression": "hit.cuspEmax_ctc_cal > a", | ||
"parameters": { "a": 25 }, | ||
"initial": 0 | ||
}, | ||
"operations":{ | ||
"multiplicity": { | ||
"channels": "geds_on", | ||
"aggregation_mode": "sum", | ||
"expression": "hit.cuspEmax_ctc_cal > a", | ||
"parameters": { "a": 25 }, | ||
"initial": 0 | ||
}, | ||
"test_sum": { | ||
"channels": "geds_on", | ||
"aggregation_mode": "sum", | ||
"query":"evt.multiplicity == 1", | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_first": { | ||
"channels": "geds_on", | ||
"aggregation_mode": ["first", "dsp.tp_0_est"], | ||
"query":"evt.multiplicity == 1", | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_first2": { | ||
"channels": "geds_on", | ||
"aggregation_mode": ["first", "dsp.tp_0_est"], | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_last": { | ||
"channels": "geds_on", | ||
"aggregation_mode": ["last", "dsp.tp_0_est"], | ||
"query":"evt.multiplicity == 1", | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_last2": { | ||
"channels": "geds_on", | ||
"aggregation_mode": ["last", "dsp.tp_0_est"], | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_any": { | ||
"channels": "geds_on", | ||
"aggregation_mode": "any", | ||
"query":"evt.multiplicity == 1", | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_any2": { | ||
"channels": "geds_on", | ||
"aggregation_mode": "any", | ||
"query":"hit.cuspEmax_ctc_cal >25", | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_all": { | ||
"channels": "geds_on", | ||
"aggregation_mode": "all", | ||
"query":"evt.multiplicity == 1", | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_all2": { | ||
"channels": "geds_on", | ||
"aggregation_mode": "all", | ||
"query":"hit.cuspEmax_ctc_cal >25", | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_vov": { | ||
"channels": "geds_on", | ||
"aggregation_mode": "vov", | ||
"query":"evt.multiplicity == 1", | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_vov2": { | ||
"channels": "geds_on", | ||
"aggregation_mode": "vov", | ||
"expression": "True", | ||
"initial": false | ||
} | ||
"test_sum": { | ||
"channels": "geds_on", | ||
"aggregation_mode": "sum", | ||
"query": "evt.multiplicity == 1", | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_first": { | ||
"channels": "geds_on", | ||
"aggregation_mode": ["first", "dsp.tp_0_est"], | ||
"query": "evt.multiplicity == 1", | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_first2": { | ||
"channels": "geds_on", | ||
"aggregation_mode": ["first", "dsp.tp_0_est"], | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_last": { | ||
"channels": "geds_on", | ||
"aggregation_mode": ["last", "dsp.tp_0_est"], | ||
"query": "evt.multiplicity == 1", | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_last2": { | ||
"channels": "geds_on", | ||
"aggregation_mode": ["last", "dsp.tp_0_est"], | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_any": { | ||
"channels": "geds_on", | ||
"aggregation_mode": "any", | ||
"query": "evt.multiplicity == 1", | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_any2": { | ||
"channels": "geds_on", | ||
"aggregation_mode": "any", | ||
"query": "hit.cuspEmax_ctc_cal >25", | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_all": { | ||
"channels": "geds_on", | ||
"aggregation_mode": "all", | ||
"query": "evt.multiplicity == 1", | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_all2": { | ||
"channels": "geds_on", | ||
"aggregation_mode": "all", | ||
"query": "hit.cuspEmax_ctc_cal >25", | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_vov": { | ||
"channels": "geds_on", | ||
"aggregation_mode": "vov", | ||
"query": "evt.multiplicity == 1", | ||
"expression": "True", | ||
"initial": false | ||
}, | ||
"test_vov2": { | ||
"channels": "geds_on", | ||
"aggregation_mode": "vov", | ||
"expression": "True", | ||
"initial": false | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters