# Populate lookup table that maps ant+pol to DBE input for dbe_input_sensor in [ sensor for sensor in selected_dbe.sensor if sensor.startswith('input_mappings_') ]: ant_pol = selected_dbe.sensor[dbe_input_sensor].get_value() connected_antpols[ant_pol] = dbe_input_sensor[15:] # Create device array of antennas, based on specification string ants = kat.ants user_logger.info('Using antennas: %s' % (' '.join([ant.name for ant in ants]), )) # Move all antennas onto calibration source and wait for lock try: targets = collect_targets(kat, [opts.target]).targets except ValueError: user_logger.info( "No valid targets specified. Antenna will not be moved.") else: session.track(targets[0], duration=1, announce=False) # Warn if requesting an RFE5 desired output power larger than max measurable power of the RFE5 output power sensor if opts.rfe5_desired_power > rfe5_out_max_meas_power: user_logger.warn( "Requested RFE5 output power %-4.1f larger than max measurable power of %-4.1f dBm. Could cause problems..." % (opts.rfe5_desired_power, rfe5_out_max_meas_power)) user_logger.info( 'Input: --dBm->| RFE5 |--dBm->| RFE7 |--dBm->| DBE |') user_logger.info( 'Desired: | RFE5 | %-4.1f | RFE7 | %-4.1f | DBE |' %
elif opts.backend == "digifits" and opts.backend_args: verify_digifits_backend_args(opts.backend_args) # Save script parameters before session capture-init's the SDP subsystem sdp = SessionSDP(kat) telstate = sdp.telstate script_args = vars(opts) script_args['targets'] = args telstate.add('obs_script_arguments', script_args) # Start capture session with start_session(kat, **vars(opts)) as session: # We are only interested in first target user_logger.info('Looking up main beamformer target...') target = collect_targets(kat, args[:1]).targets[0] # Ensure that the target is up target_elevation = np.degrees(target.azel()[1]) if target_elevation < opts.horizon: if not opts.dry_run: raise ValueError("The target %r is below the horizon" % (target.description, )) else: user_logger.warn("The target is below the horizon, " "but ignoring for dry-run!") data_product_id = ptuse.sensor.subarray_product_id.get_value() user_logger.info('Data product ID: %s', data_product_id) # Force delay tracking to be on
raise ValueError("Please specify at least one target argument via name " "('J1939-6342'), description ('radec, 19:39, -63:42') or " "catalogue file name ('three_calib.csv')") # ND states nd_off = {'diode': 'coupler', 'on': 0., 'off': 0., 'period': -1.} nd_on = { 'diode': 'coupler', 'on': opts.track_duration, 'off': 0., 'period': 0. } # Check options and build KAT configuration, connecting to proxies and devices with verify_and_connect(opts) as kat: observation_sources = collect_targets(kat, args) user_logger.info(observation_sources.visibility_list()) # Start capture session, which creates HDF5 file with start_session(kat, **vars(opts)) as session: # Quit early if there are no sources to observe or not enough antennas if len(session.ants) < 4: raise ValueError('Not enough receptors to do calibration - you ' 'need 4 and you have %d' % (len(session.ants), )) sources_above_horizon = observation_sources.filter( el_limit_deg=opts.horizon) if not sources_above_horizon: raise NoTargetsUpError("No targets are currently visible - " "please re-run the script later") # Pick the first source that is up (this assumes that the sources in # the catalogue are ordered from highest to lowest priority) target = sources_above_horizon.targets[0]
help='Set correlator F-engine FFT shift (default=leave as is)') # Set default value for any option (both standard and experiment-specific options) parser.set_defaults(description='Target track', nd_params='coupler,30,0,-1') # Parse the command line opts, args = parser.parse_args() if len(args) == 0: args.append('SCP, radec, 0, -90') b_start, b_end, b_step = opts.bgain[0], opts.bgain[1], int(opts.bgain[2]) # Check options and build KAT configuration, connecting to proxies and devices with verify_and_connect(opts) as kat: cbf = SessionCBF(kat) targets = collect_targets(kat, args) # Start capture session, which creates HDF5 file with start_session(kat, **vars(opts)) as session: # Quit early if there are no sources to observe if len(targets.filter(el_limit_deg=opts.horizon)) == 0: raise NoTargetsUpError("No targets are currently visible - " "please re-run the script later") if not kat.dry_run and not session.cbf.fengine.inputs: raise RuntimeError("Failed to get correlator input labels, " "cannot set the F-engine gains") # Quit early if the B-Engine quants are not setable for stream in cbf.beamformers: if not stream.req.quant_gains: raise RuntimeError( "Failed to set B-Engine quantisation. Quitting.") session.standard_setup(**vars(opts))