'--dbe-desired', type='float', dest='dbe_desired_power', default=-26.0, help= 'Desired DBE input power, in dBm (default=%default). Success will be within 1 dBm of this value.' ) #parser.remove_option('-d') parser.set_defaults(observer='Otto Attenuate') parser.set_defaults(description='Auto Attenuate data') parser.set_defaults(nd_params='off') # Parse the command line opts, args = parser.parse_args() opts.description = 'Auto atten' with verify_and_connect(opts) as kat: try: # In the past there was a command line option to select dbe # (fringe finder) / dbe7, but since fringe finder has been # decommisioned that option has been removed selected_dbe = kat.dbe7 except NameError: raise RuntimeError( "Unknown dbe device (%s) specified. Typically it should be either 'dbe' or 'dbe7'" ) with start_session(kat, **vars(opts)) as session: # If centre frequency is specified, set it accordingly user_logger.info('Current centre frequency: %s MHz' % (session.get_centre_freq(), )) if not kat.dry_run and opts.centre_freq and not session.get_centre_freq( ) == opts.centre_freq:
try: defaults = defaults_set[opts.defaults_set] except KeyError: print "Unknown defaults set '%s', expected one of %s" % ( opts.defaults_set, defaults_set.keys()) sys.exit() if opts.reset and not opts.sb_id_code: raise ValueError( "To reset system to defaults you need to specify the schedule block: use --sb-id-code, or run without --reset" ) # Try to build the KAT configuration # This connects to all the proxies and devices and queries their commands and sensors try: kat = verify_and_connect(opts) except ValueError, err: raise ValueError("Could not build host for sb-id-code %s (%s)" % (opts.sb_id_code, err)) print "Using KAT connection with configuration: %s" % (kat.system, ) user_logger.info("defaults.py: start") smsg = "Checking current settings....." user_logger.info(smsg) print smsg check_sensors(kat, defaults) if opts.reset: smsg = "Resetting to default settings..." user_logger.info(smsg)