'wbc8k': 160,
                'c16n7M4k': 31,
                'c16n2M4k': 59,
                'c16n25M4k': 17,
                'c16n13M4k': 23
            }
            if dbe_mode in dbe7_mode_dict.keys():
                user_logger.info("dbe7 mode is '%s', as expected :)" %
                                 dbe_mode)
                gain = dbe7_mode_dict[dbe_mode]
                set_k7_gains(kat, gain)
                user_logger.info("Set digital gain on selected DBE to %d." %
                                 gain)
            else:
                user_logger.error(
                    "dbe7 mode is '%s' and not in the list of valid modes. Could not set appropriate gain."
                    % (dbe_mode))

            # 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]), ))
                                                  opts.projection)
                nd_params = session.nd_params
                session.track(target,
                              duration=opts.track_duration,
                              announce=False)
        session.ants.req.offset_fixed(
            0, 0, opts.projection)  # reset any dangling offsets
        # Tsys and averaging
        user_logger.info("Performing Tsys and averaging tests")
        session.nd_params = nd_off
        # 10 second track so that the antenna profiler does not run away
        session.track(target, duration=10)
        user_logger.info("Now capturing data - diode %s on", nd_on['diode'])
        session.label('%s' % (nd_on['diode'], ))
        if not session.fire_noise_diode(announce=True, **nd_on):
            user_logger.error("Noise diode %s did not fire", nd_on['diode'])
        session.nd_params = nd_off
        user_logger.info("Now capturing data - noise diode off")
        session.track(target,
                      duration=320)  # get 5 mins of data to test averaging

        # Single dish pointing ... to compare with interferometric
        user_logger.info("Performing single dish pointing tests")
        session.label('raster')
        user_logger.info("Doing scan of '%s' with current azel (%s, %s)",
                         target.description, *target.azel())
        # Do different raster scan on strong and weak targets
        session.raster_scan(target,
                            num_scans=5,
                            scan_duration=80,
                            scan_extent=6.0,
Beispiel #3
0
    #rfe5_att = get_rfe5_attenuation(kat, inputs)

    # Get stage 7 attenuation Set it to max and check it
    rfe7_att = get_rfe7_attenuation(kat, inputs)
    rfe7_att = np.clip(rfe7_att, rfe7_max_att,
                       rfe7_max_att)  # keep array structure
    set_rfe7_attenuation(kat, inputs, rfe7_att)
    #rfe7_att = get_rfe7_attenuation(kat, inputs)
    time.sleep(wait_secs)
    rfe5_att = get_rfe5_attenuation(kat, inputs)
    set_rfe7_attenuation(kat, inputs, rfe7_att)
    user_logger.info(
        'Attenuation Levels: rfe5 Max | rfe5 Set | rfe7 Max | rfe7 Set')
    for key, data in enumerate(inputs):
        user_logger.info(
            '%s %s            : %-4.1f     | %s%-4.1f%s     | %4.1f     | %s%4.1f%s'
            % (data[0], data[1], rfe5_max_att, colors.Green
               if rfe5_max_att == rfe5_att[key] else colors.Red, rfe5_att[key],
               colors.Normal, rfe7_max_att, colors.Green if rfe7_max_att
               == rfe7_att[key] else colors.Red, rfe7_att[key], colors.Normal))

    for key, data in enumerate(inputs):
        if not rfe5_max_att == rfe5_att[key]:
            user_logger.error(
                '%s Failed to set the max attenuation on stage 5 %s %s %s' %
                (colors.Red, data[0], data[1], colors.Normal))
        if not rfe7_max_att == rfe7_att[key]:
            user_logger.error(
                '%s Failed to set the max attenuation on stage 7 %s %s %s' %
                (colors.Red, data[0], data[1], colors.Normal))
Beispiel #4
0
            weight = 1.0 if inp[:-1] in bf_ants else 0.0
            weights.append(weight)
            user_logger.info('  input %r will get weight %f', inp, weight)

        reply = stream.req.weights(*weights)
        if reply.succeeded:
            user_logger.info('Set input weights successfully')
        else:
            user_logger.warning('Failed to set input weights!')

    # We are only interested in first target
    user_logger.info('Looking up main beamformer target...')
    tgt_with_spaces = [tgt for tgt in args[:1] if len(tgt.strip().split()) > 1]
    if len(tgt_with_spaces) > 0:
        user_logger.error(
            "Please replace '%s' with '%s'", '& '.join(tgt_with_spaces),
            '& '.join(
                [''.join(tgt.strip().split()) for tgt in tgt_with_spaces]))
        raise ValueError(
            'Found spaces in target names, which will cause an error in digifits'
        )

    target = collect_targets(kat, args[:1]).targets[0]

    # Verify backend_args
    if opts.backend.split(' ')[0] == "dspsr" and opts.backend_args:
        verify_dspsr_backend_args(opts.backend_args)
    elif opts.backend.split(' ')[0] == "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)