39def make_sct_mapping():
40 """
41 Generate a mapping for the channelids in /SCT/DCS/HV to DCSOFL output
42 channel ids. The highest two bits can be used to determine the system.
43 (see `subdets`)
44 """
45 from DQUtils.db import Databases
46 from DQUtils.channel_mapping import get_channel_ids_names
47 f = Databases.get_folder("/SCT/DCS/HV", "COOLOFL_DCS/CONDBR2")
48 cids, cnames, cmap = get_channel_ids_names(f)
49
50 mapping = {}
51
52 subdets = {0: 114, 1: 111, 2: 115}
53
54 for cid in cids:
55
56 output_subdet = subdets[(cid >> 25) & 0x3]
57 mapping.setdefault(output_subdet, []).append(cid)
58
59 return mapping
60