diff --git a/MAC/Services/TBB/TBBServer/lib/tbbservice.py b/MAC/Services/TBB/TBBServer/lib/tbbservice.py index ad50dfb98246a3d2663d8bb492c3335860a92b1c..856a08d3881d650e4a2156abbb26ad3861700571 100644 --- a/MAC/Services/TBB/TBBServer/lib/tbbservice.py +++ b/MAC/Services/TBB/TBBServer/lib/tbbservice.py @@ -239,10 +239,10 @@ class TBBControlService: """ Command TBBs in ALERT mode to start data recording. :param stations: string - Only TBBs of these stations will be commanded to start data recording. - :param mode: string - Parameter to set-up data recording in either \"subbands\" or \"rawvoltage\" mode. + :param mode: string - Parameter to set-up data recording in either \"subband\" or \"rawvoltage\" mode. :param sub_bands: string - The list of sub-bands that the RSP will be set-up for. """ - log_message = "Starting the TBB data recording for mode %s on stations %s in subbands %s" % (mode, stations, subbands) + log_message = "Starting the TBB data recording for mode %s on stations %s in sub-bands %s" % (mode, stations, subbands) logger.info(log_message + "...") start_tbb(stations, mode, subbands) logger.info(log_message + "done.") diff --git a/MAC/TBB/lib/tbb_config.py b/MAC/TBB/lib/tbb_config.py index b86a09205cad39ce503fd4d408cf85382ad03459..6ce04c082c46b4c5171c4e173fc04a6d287a715f 100644 --- a/MAC/TBB/lib/tbb_config.py +++ b/MAC/TBB/lib/tbb_config.py @@ -27,4 +27,4 @@ else: rsp_command = "/opt/lofar/bin/rspctl " lcurun_command = "lcurun" -supported_firmwares = ['timeseries', 'subbands'] +supported_modes = ['rawvoltage', 'subband'] diff --git a/MAC/TBB/lib/tbb_load_firmware.py b/MAC/TBB/lib/tbb_load_firmware.py index 4ffcafd46d6a46e0562c355e4f422e3da1726c62..c27cab6094af534c5ed2f3c76eb477529e5c1476 100755 --- a/MAC/TBB/lib/tbb_load_firmware.py +++ b/MAC/TBB/lib/tbb_load_firmware.py @@ -10,25 +10,23 @@ import argparse import time import subprocess import logging -from lofar.mac.tbb.tbb_config import lcurun_command, tbb_command +from lofar.mac.tbb.tbb_config import supported_modes, lcurun_command, tbb_command -supported_firmwares = ['timeseries', 'subbands'] -def load_tbb_firmware(stations, firmware): - - logging.info('Loading TBB firmware \"%s\"' % (firmware)) +def load_tbb_firmware(stations, mode): + logging.info('Loading TBB firmware for mode \"%s\"' % (mode)) # This is hardcoded for now. There is no reliable way to tell from the output # of tbbctl --imageinfo what a firmware can do. Everything there is a string that # gets passed by the --writeimage command. So even the image name can be wrong or # misleading. # So: the ALERT firmware must be in slot #2! - if firmware == "subbands": + if mode == "subband": slot = 2 else: slot = 1 - logging.info("It is assumed that the %s firmware is in slot %d!" % (firmware, slot)) + logging.info("It is assumed that the firmware for mode \"%s\" is in slot %d!" % (mode, slot)) relay = [lcurun_command, stations] cmd = [tbb_command, '--config=%s' % slot] @@ -41,9 +39,9 @@ def load_tbb_firmware(stations, firmware): wait_time = 60 interval = 10 for sleep_time in range(wait_time, 0, -interval): - logging.info("Waited %ds of %ds for the TBB boards to load the %s firmware..." % (wait_time - sleep_time, wait_time, firmware)) + logging.info("Waited %ds of %ds for the TBB boards to load the firmware for mode \"%s\"..." % (wait_time - sleep_time, wait_time, mode)) time.sleep(interval) - logging.info("TBBs should now have the %s firmware loaded. Check the output of the following command!" % (firmware)) + logging.info("TBBs should now have the firmware for mode \"%s\" loaded. Check the output of the following command!" % (mode)) for board in range(6): cmd = [tbb_command, '--imageinfo=%s' % str(board)] @@ -55,10 +53,10 @@ def load_tbb_firmware(stations, firmware): def main(): parser = argparse.ArgumentParser("This script will load a TBB firmware on a bunch of stations and the respective boards there.") parser.add_argument('-s', '--stations', dest='stations', help="comma-separated list of station LCUs (e.g. cs030c,cs031c; also accepts lcurun aliases like 'today', 'nl', ...)", default='today') - parser.add_argument('-f', '--firmware', dest='firmware', help="supported tbb firmwares: %s" % supported_firmwares, default='subbands') + parser.add_argument('-m', '--mode', dest='mode', help="supported tbb modes: %s" % supported_modes, default='subband') args = parser.parse_args() - if args.firmware not in supported_firmwares: - raise ValueError('Firmware must be one of %s' % supported_firmwares) + if args.mode not in supported_modes: + raise ValueError('Mode must be one of %s' % supported_modes) - load_tbb_firmware(args.stations, args.firmware) + load_tbb_firmware(args.stations, args.mode) diff --git a/MAC/TBB/lib/tbb_start_recording.py b/MAC/TBB/lib/tbb_start_recording.py index 23651347b34f86136d8eb8792202b52a073bcb73..62238235f72e041fe7572a0a82de8edfa55e4b32 100755 --- a/MAC/TBB/lib/tbb_start_recording.py +++ b/MAC/TBB/lib/tbb_start_recording.py @@ -10,15 +10,13 @@ import argparse import time import subprocess import logging -from lofar.mac.tbb.tbb_config import lcurun_command, tbb_command, rsp_command - -supported_modes = ['transient', 'subbands'] +from lofar.mac.tbb.tbb_config import supported_modes, lcurun_command, tbb_command, rsp_command def start_tbb(stations, mode, subbands): logging.info('Starting TBB recording') - if mode == 'subbands': + if mode == 'subband': rspctl_mode_cmd = [rsp_command, '--tbbmode=%s,%s' % (mode, subbands)] else: rspctl_mode_cmd = [rsp_command, '--tbbmode=%s' % (mode)] @@ -43,7 +41,7 @@ def main(): parser = argparse.ArgumentParser("This script will start TBB recording on a bunch of stations.") parser.add_argument('-s', '--stations', dest='stations', help="comma-separated list of station LCUs (e.g. cs030c,cs031c; also accepts lcurun aliases like 'today', 'nl', ...)", default='today') - parser.add_argument('-m', '--mode', dest='mode', help="supported tbb modes: %s" % supported_modes, default='subbands') + parser.add_argument('-m', '--mode', dest='mode', help="supported tbb modes: %s" % supported_modes, default='subband') parser.add_argument('-b', '--subbands', dest='subbands', help='Subband range, e.g. 10:496', default='10:496') args = parser.parse_args()