Exemple #1
0
    if trigger is not None:
        try:
            trigger = eval('u.' + trigger + '()')
        except SyntaxError:
            u.print_error(
                "Cannot find the trigger \'%s\'. Is it implemented in the USRP_triggers module?"
                % trigger)
            return ""
        except AttributeError:
            u.print_error(
                "Cannot find the trigger \'%s\'. Is it implemented in the USRP_triggers module?"
                % trigger)
            return ""

    #replicate the VNA measure (WARNING: DOES NOT SUPPORT ITERATIONS)
    u.print_debug("Replicating seed VNA measure to ensure phase coherency...")
    VNA_seed_info = u.get_rx_info(args.VNA, ant=ant)
    seed_rf, seed_tones = u.get_tones(args.VNA)
    seed_start_f = VNA_seed_info['freq'][0]
    seed_end_f = VNA_seed_info['chirp_f'][0]
    seed_measure_t = VNA_seed_info['chirp_t'][0]
    seed_points = VNA_seed_info['swipe_s'][0]
    seed_gain = VNA_seed_info['gain']
    seed_rate = VNA_seed_info['rate']
    seed_ntones = len(seed_tones) + len(guard_tones)
    u.print_debug("Adjusting power for %d tone readout..." % seed_ntones)

    if not u.Connect():
        u.print_error("Cannot find the GPU server!")
        exit()
Exemple #2
0
    except OSError:
        pass

    os.chdir(args.folder)

    if not u.Connect():
        u.print_error("Cannot find the GPU server!")
        exit()

    if np.abs(args.f0) > args.rate / 2:
        u.print_warning(
            "Cannot use initial baseband frequency of %.2f MHz with a data rate of %.2f MHz"
            % (args.f0, args.rate))
        f0 = args.rate / 2 * (np.abs(args.f0) / args.f0)
        u.print_debug(
            "Setting maximum initial baseband scan frequency to %.2f MHz" %
            (f0))
    else:
        f0 = args.f0

    if np.abs(args.f1) > args.rate / 2:
        u.print_warning(
            "Cannot use initial baseband frequency of %.2f MHz with a data rate of %.2f MHz"
            % (args.f1, args.rate))
        f1 = args.rate / 2 * (np.abs(args.f1) / args.f1)
        u.print_debug(
            "Setting maximum initial baseband scan frequency to %.2f MHz" %
            (f1))
    else:
        f1 = args.f1
    # Data acquisition
Exemple #3
0
        '-tr',
        help=
        'String describing the trigger to use. Default is no trigger. Use the name of the trigger classes defined in the trigger module with no parentesis',
        type=str)

    args = parser.parse_args()
    try:
        os.mkdir(args.folder)
    except OSError:
        pass

    os.chdir(args.folder)

    if args.VNA is not None:
        rf_freq, tones = u.get_tones(args.VNA)
        u.print_debug("getting %d tones from %s" % (len(tones), args.VNA))
    else:
        if args.random is not None:
            tones = [
                random.randint(-args.rate / 2., -args.rate / 2.)
                for c in range(args.random)
            ]
        else:
            try:
                if args.tones is not None:
                    tones = [float(x) for x in args.tones]
                    tones = np.asarray(tones) * 1e6
                else:
                    tones = []
            except ValueError:
                u.print_error("Cannot convert tone argument.")
Exemple #4
0
    parser.add_argument('--decimation', '-d', help='Decimation factor required', type=float, default=100)
    parser.add_argument('--time', '-t', help='Duration of the scan in seconds', type=float, default=10)
    parser.add_argument('--VNA', '-vna', help='VNA file containing the resonators. Relative to the specified folder above.', type=str)


    args = parser.parse_args()
    try:
        os.mkdir(args.folder)
    except OSError:
        pass

    os.chdir(args.folder)

    if args.VNA is not None:
        rf_freq_A, tones_A = u.get_tones(args.VNA,frontends = 'A_RX2')
        u.print_debug("getting %d tones from %s frontend A" % (len(tones_A),args.VNA))
        rf_freq_B, tones_B = u.get_tones(args.VNA,frontends = 'B_RX2')
        u.print_debug("getting %d tones from %s frontend B" % (len(tones_B),args.VNA))

    else:
        try:
            tones_A = [float(x) for x in args.tones_A]
            tones_A = np.asarray(tones_A)*1e6
            tones_B = [float(x) for x in args.tones_B]
            tones_B = np.asarray(tones_B)*1e6
        except ValueError:
            u.print_error("Cannot convert tone arfreqgument.")

        rf_freq_A = args.freq_A*1e6
        rf_freq_B = args.freq_A*1e6