Beispiel #1
0
def JPL_2014_May_light_blackbody_temperature(directory):
    """
    Parameter directory is a string that is the path to the unzipped
    contents of the file Log0522JAlSKIP20_bbT_sweep.zip, which is
    posted on the SKIP wiki.

    Return a dictionary with keys that are integers from 0 through 13
    and values that are lists of 14 Resonators fitted to frequency
    sweeps taken at blackbody temperatures from 4.2 K to 40 K in
    ascending order. Each list contains data for a single detector.

    The fits must include cable delay as a free parameter because it
    has not been removed.
    
    The frequency data in the files is in Hz and is converted to MHz
    here to match our data.

    The original data directory contains 150 sweeps, with indices
    ranging from 203 through 352, taken at ten different temperatures
    between 40 K and 4.2 K. There are 14 working resonators. Each
    group of sweeps contains one sweep of the entire frequency range
    then 14 sweeps of individual resonators in order of increasing
    resonance frequency. Sweep 203 thus contains a sweep of the entire
    band at the highest temperature of 40 K, and sweep 352 covers the
    resonator with highest resonance frequency at the lowest
    temperature of 4.2 K.

    Note that each list in the returned dictionary contains sweeps in
    order of increasing black body temperature.
    """
    log = path.join(directory, 'Log0522JAlSKIP20_bbT_sweep.txt')
    sweeps_per_group = 15
    # Each element of sweep_number is the XX in trXX.txt
    sweep_number, readout_power_dBm, bb_temp_K = np.loadtxt(log,
                                                            usecols=(0, 5, 9),
                                                            delimiter=' ',
                                                            skiprows=15,
                                                            unpack=True,
                                                            converters={0: lambda s: path.splitext(s)[0][2:]})
    sweeps = read_all_sweeps(directory)
    first_sweep = min(sweeps.keys())
    resonators = dict([(n, []) for n in range(sweeps_per_group - 1)])
    for n in range(len(sweeps)):
        if (n % sweeps_per_group) == 0: # skip the first sweep in each group
            continue
        else:
            r = Resonator(sweeps[n + first_sweep][0] / 1e6, sweeps[n + first_sweep][1], # Hz to MHz
                          guess = delayed_generic_guess, model = delayed_generic_s21)
            r.T_bath = 0.2 # The device temperature, as listed in the header.
            r.T_bb = bb_temp_K[n]
            r.P_readout = readout_power_dBm[n]
            resonators[(n % sweeps_per_group) - 1].insert(0, r) # Insert in ascending order
    return resonators
Beispiel #2
0
def JPL_2013_August_dark_bath_temperature(directory):
    """
    Return a list of Resonators from Peter's temperature sweeps of one
    resonance.
    """
    log = path.join(directory, 'Log0829LSKIP_T_sweep.txt')
    numbers, temp_list = np.loadtxt(log,
                                    usecols=(0, 9),
                                    delimiter=' ',
                                    skiprows=12,
                                    unpack=True,
                                    converters={0: lambda s: path.splitext(s)[0][2:]}) # extract XX from trXX.txt
    sweeps = read_all_sweeps(directory)
    resonators = []
    for n, T_bath in zip(numbers, temp_list):
        r = Resonator(sweeps[n][0], sweeps[n][1], guess = generic_guess, model = generic_s21)
        r.T_bath = T_bath
        resonators.append(r)
    return resonators
Beispiel #3
0
def fit_sweep_data(sweep_data,
                   model=bifurcation_s21,
                   guess=bifurcation_guess,
                   delay_estimate=0):
    resonators = []
    for i in np.unique(sweep_data.sweep_indexes):
        f, s21, errors = sweep_data.select_index(i)
        s21 *= np.exp(2j * np.pi * delay_estimate * f)
        resonators.append(
            Resonator(f, s21, errors=errors, model=model, guess=guess))
    return sorted(resonators, key=lambda r: r.f_0)