Skip to content
Snippets Groups Projects
tbb_release_recording.py 890 B
#!/usr/bin/env python

########################################################################
#
# Release TBB recording on a bunch of stations
#
########################################################################

import argparse
import time
import subprocess
import logging

def release_tbb(stations):
    logging.info('Releasing TBB recording')

    relay = ['lcurun', stations]

    cmd = relay + ['/opt/lofar/bin/tbbctl', '--free']
    logging.info('Executing %s' % cmd)
    subprocess.check_call(cmd)

def main():
    parser = argparse.ArgumentParser("This script will release 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')
    args = parser.parse_args()

    release_tbb(args.stations)