Skip to content

Commit 12c1d59

Browse files
authored
Merge pull request #104 from legend-exp/patch-channelinfo-aoe-status
Include `psd_usability` in `channelinfo`
2 parents d30b323 + 7f3ecf1 commit 12c1d59

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/legend_data.jl

+11-1
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,21 @@ function channelinfo(data::LegendData, sel::AnyValiditySelection; system::Symbol
354354
ann_status::Symbol = Symbol(get(get(get(dpcfg[k], :psd, PropDict()), :status, PropDict()), Symbol("ann"), :unknown))
355355
coax_rt_status::Symbol = Symbol(get(get(get(dpcfg[k], :psd, PropDict()), :status, PropDict()), Symbol("coax_rt"), :unknown))
356356
is_bb_like::String = replace(get(get(dpcfg[k], :psd, PropDict()), :is_bb_like, ""), "&" => "&&")
357+
psd_usability::Symbol = if !(is_bb_like == "missing") &&
358+
ifelse(occursin("low_aoe", is_bb_like), low_aoe_status == :valid, true) &&
359+
ifelse(occursin("high_aoe", is_bb_like), high_aoe_status == :valid, true) &&
360+
ifelse(occursin("lq", is_bb_like), lq_status == :valid, true) &&
361+
ifelse(occursin("ann", is_bb_like), ann_status == :valid, true) &&
362+
ifelse(occursin("coax_rt", is_bb_like), coax_rt_status == :valid, true)
363+
:on
364+
else
365+
:off
366+
end
357367

358368
location::Symbol, detstring::Int, position::Int, fiber::StaticString{8} = _convert_location(chmap[k].location)
359369

360370
c = (;
361-
detector, channel, fcid, rawid, system, processable, usability, is_blinded, low_aoe_status, high_aoe_status, lq_status, ann_status, coax_rt_status, is_bb_like, det_type,
371+
detector, channel, fcid, rawid, system, processable, usability, is_blinded, psd_usability, low_aoe_status, high_aoe_status, lq_status, ann_status, coax_rt_status, is_bb_like, det_type,
362372
location, detstring, fiber, position
363373
)
364374

0 commit comments

Comments
 (0)