def detect_resonator_frequency_at_the_sweet_spot():

    znb.set_nop(100)
    old_avg = znb.get_averages()
    old_bw = znb.get_bandwidth()
    znb.set_bandwidth(10)
    znb.set_averages(5)
    current.output_on()

    znb.avg_clear()
    znb.prepare_for_stb()
    znb.sweep_single()
    znb.wait_for_stb()
    res_freq1 = RD.detect_resonator(znb, type="FIT")[0]

    znb.set_averages(old_avg)
    znb.set_bandwidth(old_bw)
    znb.set_nop(1)
    znb.set_center(res_freq1)
    znb.prepare_for_stb()
    znb.sweep_single()
    znb.wait_for_stb()

    print(znb.get_frequencies(), 20 * log10(abs(znb.get_sdata())))
def detect_resonator_frequency_at_the_sweet_spot():

    vna.set_nop(100)
    old_avg = vna.get_averages()
    old_bw = vna.get_bandwidth()
    vna.set_bandwidth(100)
    vna.set_averages(1)
    current.set_status(1)

    vna.avg_clear()
    vna.prepare_for_stb()
    vna.sweep_single()
    vna.wait_for_stb()
    res_freq1 = RD.detect_resonator(vna, type="FIT")[0]

    vna.set_averages(old_avg)
    vna.set_bandwidth(old_bw)
    vna.set_nop(1)
    vna.set_center(res_freq1)
    vna.prepare_for_stb()
    vna.sweep_single()
    vna.wait_for_stb()

    print(vna.get_frequencies(), 20 * log10(abs(vna.get_sdata())))
from lib import ResonatorDetector as RD
from lib import parametric_sweep as ps
from time import sleep

try:

    start_center_freq = RD.detect_resonator(vna)[0]

    mw_src_freqs = np.linspace(9.2e9, 9.23e9, 100)
    mw_src.set_power(0)

    powers = np.linspace(-50, -20, 31)

    current.set_current(.276e-3)
    current.set_status(1)

    vna.set_bandwidth(500)
    vna.set_averages(1)
    vna.set_nop(100)

    center_freqs = []
    averages = np.round((10**(abs(powers) / 50))**2)
    for idx, power in enumerate(powers):

        vna.set_averages(averages[idx])
        vna.set_power(power)
        vna.avg_clear()
        vna.prepare_for_stb()
        vna.sweep_single()
        vna.wait_for_stb()
    res_freq1 = RD.detect_resonator(vna, type="FIT")[0]

    vna.set_averages(old_avg)
    vna.set_bandwidth(old_bw)
    vna.set_nop(1)
    vna.set_center(res_freq1)
    vna.prepare_for_stb()
    vna.sweep_single()
    vna.wait_for_stb()

    print(vna.get_frequencies(), 20 * log10(abs(vna.get_sdata())))


try:

    start_center_freq = RD.detect_resonator(vna)[0]

    mw_src_freqs = np.linspace(9.22e9, 9.226e9, 100)

    powers = linspace(-10, -11, 2)

    current.set_current(.285e-3)
    current.set_status(1)

    vna.set_averages(10)
    vna.set_bandwidth(10)
    vna.set_power(-35)

    detect_resonator_frequency_at_the_sweet_spot()

    mw_src.set_output_state("ON")
Ejemplo n.º 5
0
from lib import ResonatorDetector as RD
from lib import parametric_sweep as ps
from time import sleep

try:

    start_center_freq = RD.detect_resonator(znb)[0]

    currents = np.linspace(-1490e-6, 930e-6, 200)
    current.set_compliance(1)
    current.set_range(max(abs(currents)))

    center_freqs = center_freq_estimator(currents)

    for idx, current_val in enumerate(currents):
        current.set_current(current_val)
        znb.avg_clear()
        znb.prepare_for_stb()
        znb.sweep_single()
        znb.wait_for_stb()
        center_freq = RD.detect_resonator(znb)[0]
        center_freqs.append(center_freq)
        znb.set_freq_center_span(center_freq, 10e6)
        print("\rCurrent %.3e, center frequency %.5e" %
              (current_val, center_freq),
              end=" %.2f %%" % (100 * idx / len(currents)),
              flush=True)

    mw_src_freqs = np.linspace(7e9, 10.5e9, 300)
    mw_src.set_power(-10)
    mw_src.set_power(-20)

    powers = np.linspace(-20, 14, 200)

    current.set_current(-0.59e-3)
    current.output_on()

    znb.set_nop(100)
    znb.set_averages(50)
    znb.set_power(-30)

    znb.avg_clear()
    znb.prepare_for_stb()
    znb.sweep_single()
    znb.wait_for_stb()
    znb.set_freq_center_span(RD.detect_resonator(znb)[0], 1)
    print(RD.detect_resonator(znb))
    znb.scale_auto_by_trace_name("Trc1")

    znb.set_nop(1)
    znb.set_averages(20)
    mw_src.set_output_state("ON")
    measurement = ps.sweep2D(znb, powers, mw_src.set_power, mw_src_freqs,
                             mw_src.set_frequency)

finally:
    current.set_current(0)
    current.output_off()
    mw_src.set_output_state("OFF")
    znb.avg_clear()
    znb.set_averages(10)
Ejemplo n.º 7
0
from lib import ResonatorDetector as RD
from lib import parametric_sweep as ps
from time import sleep
from datetime import datetime as dt
from scipy.interpolate import interp1d as interpolate
from scipy.signal import savgol_filter as savgol

def format_time_delta(delta):
	hours, remainder = divmod(delta, 3600)
	minutes, seconds = divmod(remainder, 60)
	return '%s h %s m %s s' % (int(hours), int(minutes), round(seconds, 2))

try:

    start_center_freq = RD.detect_resonator(znb)[0]

    currents = np.linspace(-12.5e-3, 7e-3, 20)
    current.set_compliance(5)
    current.set_range(max(abs(currents)))
    current.output_on()

    znb.set_nop(100)
    znb.set_bandwidth(50)
    znb.set_averages(2)
    znb.set_power(-60)

    print("Adapting settlement frequencies...", flush=True)
    start = dt.now()
    center_freqs = []
    for idx, current_val in enumerate(currents):
        current.set_current(current_val)
    res_freq1 = RD.detect_resonator(znb, type="FIT")[0]

    znb.set_averages(old_avg)
    znb.set_bandwidth(old_bw)
    znb.set_nop(1)
    znb.set_center(res_freq1)
    znb.prepare_for_stb()
    znb.sweep_single()
    znb.wait_for_stb()

    print(znb.get_frequencies(), 20 * log10(abs(znb.get_sdata())))


try:

    start_center_freq = RD.detect_resonator(znb, type="AMP")[0]
    start_center_freq2 = RD.detect_resonator(znb, type="FIT")[0]
    print("AMP:", RD.detect_resonator(znb, type="AMP"), "vs FIT:",
          RD.detect_resonator(znb, type="FIT"))

    mw_src_freqs = np.linspace(9.496e9, 9.5e9, 100)
    mw_src.set_power(5)

    powers = linspace(-60, -50, 20)

    current.set_current(-4.13e-3)
    current.output_on()

    znb.set_averages(20)
    znb.set_bandwidth(1)
    znb.set_power(-60)