DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
wib_update_config Namespace Reference

Functions

 wib_update_config (conf_db, pulser, femb_mask, pulser_dac, pulser_channel_mask, gain, peak_time)
 

Function Documentation

◆ wib_update_config()

wib_update_config.wib_update_config ( conf_db,
pulser,
femb_mask,
pulser_dac,
pulser_channel_mask,
gain,
peak_time )

Definition at line 21 of file wib_update_config.py.

21def wib_update_config(conf_db,pulser,femb_mask,pulser_dac,pulser_channel_mask,gain,peak_time):
22
23 femb_mask = int(femb_mask,0)
24 pulser_channel_mask = int(pulser_channel_mask,0)
25
26 if(femb_mask!=0xF):
27 raise click.BadParameter("FEMB mask not currently working for values != 0xF. Please rerun")
28
29 #get the database
30 db = conffwk.Configuration('oksconflibs:' + conf_db)
31
32 #loop over all wib settings
33 for wib_setting in db.get_dals('WIBSettings'):
34
35 #do the pulser config
36 if(pulser):
37 wib_setting = wcu.enable_pulser_wib(wib_setting=wib_setting,
38 pulse_dac=pulser_dac,
39 femb_mask=femb_mask,
40 channel_mask=pulser_channel_mask)
41 else:
42 wib_setting = wcu.disable_pulser_wib(wib_setting=wib_setting)
43
44 #if gain or peak_time is set, change those too
45 wib_setting = wcu.set_gain_peak_time_wib(wib_setting=wib_setting,
46 gain=gain,
47 peak_time=peak_time,
48 femb_mask=femb_mask)
49
50 #update the wib setting. Recurse so FEMBSettings also get updated
51 db.update_dal(wib_setting,recurse=True)
52
53 db.commit()
54