Beispiel #1
0
def bias(ch=0):
    '''
    DESCRIPTION
    ================

    ARGUMENT
    ================
        1. : 
            Type: 

    RETURN
    ================
    Nothing.
    '''
    signal.signal(signal.SIGINT, signal.SIG_DFL)
    box = Cryo.mixer()
    while 1:
        print('INPUT SIS Voltage: 0 -- 30 [mV]')
        ret = raw_input()
        voltage = float(ret)
        box.set_sisv(Vmix=voltage, ch=ch)
        time.sleep(0.5)
        ret = box.monitor_sis()
        if ch == 0:
            Vmon = ret[0] * 1e+1
            Imon = ret[1] * 1e+3
        else:
            Vmon = ret[2] * 1e+1
            Imon = ret[3] * 1e+3
        print('Vmon: ' + str(Vmon) + ' mV')
        print('Imon: ' + str(Imon) + ' uA')
def Loatt(ch=0):
    '''
    DESCRIPTION
    ================

    ARGUMENT
    ================
        1. : 
            Type: 

    RETURN
    ================
    Nothing.
    '''
    signal.signal(signal.SIGINT, signal.SIG_DFL)
    att = Cryo.mixer()
    while 1:
        print('INPUT LO att. 0 -- 100 [mA]')
        ret = raw_input()
        current = float(ret)
        att.set_loatt(att=current, ch=ch)
Beispiel #3
0
#! /usr/bin/env python
# -*- coding: utf-8 -*-

import sys, time
sys.path.append('/home/amigos/NASCORX_System/base/')
import numpy
import matplotlib.pyplot as plt
import Cryo

m = Cryo.mixer()


def debug_sis():
    Vs = 30
    m.set_sisv(Vmix=Vs, ch=1)
    time.sleep(0.1)
    ret = m.monitor_sis()
    for i in ret:
        print(i)
    ohm = (ret[2]*1e-2)/(ret[3]*1e-3)
    print('R = '+str(ohm))
    ret = m.query_sisv()
    print(ret)
    raw_input()

def debug_LOatt():
    m.set_loatt(att=50, ch=0)
    time.sleep(0.5)
    ret = m.query_loatt()
    print(ret)
Beispiel #4
0
 def __init__(self):
     self.mix = Cryo.mixer()
     self.sg = Lo.firstlo(multiplier=6)
     self.pm = ML2437A.ml2437a(IP='192.168.100.113', GPIB=13)
     self.load = CPZ7204.cpz7204()
Beispiel #5
0
 def IVtrace(self,
             ch,
             Vrange=[0, 30],
             average=5,
             pngpath='/home/amigos/data/SISboardcheck/'):
     Vres = 1.0
     Vrres = 5.0
     VADres = (5000. / 2**12) * 1e-2  # mV
     IADres = (5000. / 2**12)  # uA
     if ch == 0:
         DAch = 0
         VADch = 0
         IADch = 1
     else:
         DAch = 1
         VADch = 2
         IADch = 3
     t = datetime.datetime.now()
     ut = t.strftime('%Y%m%d_%H%M%S')
     filename = 'R50ohm_ch' + str(ch) + ut + '.png'
     box = Cryo.mixer()
     V_mon = np.array([])
     Verr_mon = np.array([])
     I_mon = np.array([])
     Ierr_mon = np.array([])
     V_list = np.arange(Vrange[0], Vrange[1], Vres)
     print('Voltage SWEEP:' + str(V_list[0]) + ' to ' + str(V_list[1]) +
           ' mV')
     print('======== START ========')
     for v in V_list:
         print('V = ' + str(round(v, 2)) + ' mV')
         box.set_sisv(Vmix=v, ch=DAch)
         dV = np.array([])
         dI = np.array([])
         time.sleep(0.1)
         for j in range(average):
             ret = box.monitor_sis()
             dV = np.append(dV, ret[VADch] * 1e+1)
             dI = np.append(dI, ret[IADch] * 1e+3)
         dV_mean = np.mean(dV, axis=0)
         dV_std = np.std(dV, axis=0)
         V_mon = np.append(V_mon, dV_mean)
         if dV_std > VADres:
             Verr_mon = np.append(Verr_mon, dV_std)
         else:
             Verr_mon = np.append(Verr_mon, VADres)
         dI_mean = np.mean(dI, axis=0)
         dI_std = np.std(dI, axis=0)
         I_mon = np.append(I_mon, dI_mean)
         if dI_std > IADres:
             Ierr_mon = np.append(Ierr_mon, dI_std)
         else:
             Ierr_mon = np.append(Ierr_mon, IADres)
     R_mon = V_mon / I_mon * 1e+3
     meanR = np.mean(R_mon, axis=0)
     V_rlist = np.arange(Vrange[0], Vrange[1], Vrres)
     V_rlist = np.sort(V_rlist)[::-1]
     for v in V_rlist:
         print('V = ' + str(round(v, 2)) + ' mV')
         box.set_sisv(Vmix=v, ch=DAch)
         time.sleep(0.1)
     print('======== END ========')
     plt.errorbar(V_mon,
                  I_mon,
                  xerr=Verr_mon,
                  yerr=Ierr_mon,
                  fmt='.',
                  ecolor='red',
                  color='red',
                  label='ch=' + str(DAch))
     plt.plot([0, V_mon.max()], [0, V_mon.max() / meanR * 1e+3],
              linestyle='-',
              color='green',
              linewidth=1.0,
              label='Rmean=' + str(round(meanR, 3)))
     plt.title('50 ohm I-V ' + t.strftime('%Y/%m/%d/ %H:%M:%S'))
     plt.xlim(0, V_mon.max())
     plt.ylim(I_mon.min(), I_mon.max())
     plt.xlabel('Bias Voltage [mV]')
     plt.ylabel('Bias Current [uA]')
     plt.grid(True)
     plt.legend(loc='upper left')
     plt.savefig(pngpath + filename)
     plt.show()
Beispiel #6
0
def IVtrace(ch,
            Vrange=[0, 12],
            average=5,
            pngpath='/home/amigos/data/SIS/IV/',
            LOrange=[90, 120],
            LOres=5.0,
            Loatt_list=[20, 20, 20, 20, 20, 20],
            gragh=1):
    '''
    DESCRIPTION
    ================

    ARGUMENT
    ================
        1. : 
            Type: 

    RETURN
    ================
    Nothing.
    '''
    Vres = 0.1
    Vrres = 0.5
    if ch == 0:
        DAch = 0
        VADch = 0
        IADch = 1
    else:
        DAch = 1
        VADch = 2
        IADch = 3
    box = Cryo.mixer()
    Lo.sg = Lo.firstlo(multiplier=6)
    load = CPZ7204.cpz7204()
    pm = ML2437A.ml2437a(IP='192.168.100.113', GPIB=13)
    t = datetime.datetime.now()
    ut = t.strftime('%Y%m%d_%H%M%S')
    V_mon1 = np.array([])
    Verr_mon1 = np.array([])
    I_mon1 = np.array([])
    Ierr_mon1 = np.array([])
    V_list1 = np.arange(Vrange[0], Vrange[1], 0.05)
    V_list2 = np.arange(Vrange[0], Vrange[1], 0.05)
    load.set_home()  # define HOT position
    print('INPUT Room Temperature [℃]')
    tr = raw_input()
    Tamb = float(tr) + 273.2
    print(V_list1)
    print('======== START ========')
    for v in V_list1:
        print('V = ' + str(round(v, 2)) + ' mV')
        box.set_sisv(Vmix=v, ch=DAch)
        Vmon = box.monitor_sis()
        Vmon = Vmon[VADch] * 1e+1
        dV1 = np.array([])
        dI1 = np.array([])
        time.sleep(0.1)
        for j in range(average):
            ret = box.monitor_sis()
            dV1 = np.append(dV1, ret[VADch] * 1e+1)
            dI1 = np.append(dI1, ret[IADch] * 1e+3)
        dV_mean1 = np.mean(dV1, axis=0)
        dV_std1 = np.std(dV1, axis=0)
        V_mon1 = np.append(V_mon1, dV_mean1)
        Verr_mon1 = np.append(Verr_mon1, dV_std1)
        dI_mean1 = np.mean(dI1, axis=0)
        dI_std1 = np.std(dI1, axis=0)
        I_mon1 = np.append(I_mon1, dI_mean1)
        Ierr_mon1 = np.append(Ierr_mon1, dI_std1)
    V_rlist1 = np.arange(Vrange[0], Vrange[1], Vrres)
    V_rlist1 = np.sort(V_rlist1)[::-1]
    for v in V_rlist1:
        print('V = ' + str(round(v, 2)) + ' mV')
        box.set_sisv(Vmix=v, ch=DAch)
        time.sleep(0.1)
    print('======== END ========')
    print(dV1)
    print(dI1)
    time.sleep(1.0)
    print('set SG')
    Lo.sg.start_osci(LOrange[0], 19.0)
    Lo_list = np.arange(LOrange[0], LOrange[1], LOres)
    for i in range(len(Lo_list)):
        Lo.sg.change_freq(freq=Lo_list[i - 1])
        box.set_loatt(att=Loatt_list[i - 1], ch=ch)
        lf = Lo.sg.query_status
        print(V_list2)
        print('======== START ========')
        for v in V_list2:
            print('V = ' + str(round(v, 2)) + ' mV')
            box.set_sisv(Vmix=v, ch=DAch)
            V_mon2 = np.array([])
            Verr_mon2 = np.array([])
            I_mon2 = np.array([])
            Ierr_mon2 = np.array([])
            dV2 = np.array([])
            dI2 = np.array([])
            hot = np.array([])
            cold = np.array([])
            yfac = np.array([])
            trx = np.array([])
            time.sleep(0.1)

            #measure IFV
            Vmon = box.monitor_sis()
            Vmon = Vmon[VADch] * 1e+1
            Phot = pm.measure(ch=1, resolution=3)
            load.rot_angle(speed=3000, angle=-90)  # COLD
            time.sleep(0.5)
            Pcold = pm.measure(ch=1, resolution=3)
            load.go_home(speed=3000)  # HOT

            #measure IV
            for j in range(average):
                ret = box.monitor_sis()
                dV2 = np.append(dV2, ret[VADch] * 1e+1)
                dI2 = np.append(dI2, ret[IADch] * 1e+3)
            dV_mean2 = np.mean(dV2, axis=0)
            dV_std2 = np.std(dV2, axis=0)
            hot = np.append(hot, Phot)
            cold = np.append(cold, Pcold)
            V_mon2 = np.append(V_mon2, dV_mean2)
            Verr_mon2 = np.append(Verr_mon2, dV_std2)
            dI_mean2 = np.mean(dI2, axis=0)
            dI_std2 = np.std(dI2, axis=0)
            I_mon2 = np.append(I_mon2, dI_mean2)
            Ierr_mon2 = np.append(Ierr_mon2, dI_std2)
            yfac_col = Phot - Pcold
            try:
                trx_col = (Tamb - 77.79 * 10**
                           (yfac_col / 10)) / (10**(yfac_col / 10) - 1)
            except ZeroDivisionError:
                trx_col = 1000
            yfac = np.append(yfac, yfac_col)
            trx = np.append(trx, trx_col)
        V_rlist2 = np.arange(Vrange[0], Vrange[1], Vrres)
        V_rlist2 = np.sort(V_rlist2)[::-1]
        for v in V_rlist2:
            print('V = ' + str(round(v, 2)) + ' mV')
            box.set_sisv(Vmix=v, ch=DAch)
            time.sleep(0.1)
        print('======== END ========')
        print(dV2)
        print(dI2)

        #plot part
        filename1 = 'SISIV' + ut + str(Lo_list[i - 1]) + '.png'
        filename2 = 'SISIFV' + ut + str(Lo_list[i - 1]) + '.png'
        filename3 = 'SISTrx and Y-factor' + ut + str(Lo_list[i - 1]) + '.png'
        #plt.errorbar(V_mon1, I_mon1, xerr=Verr_mon1, yerr=Ierr_mon1, fmt='.', ecolor='red', color='red', label='ch='+str(DAch))
        plt.plot(V_mon1,
                 I_mon1,
                 linestyle='-',
                 color='black',
                 linewidth=1.0,
                 label='LO nashi')
        #plt.errorbar(V_mon2, I_mon2, xerr=Verr_mon2, yerr=Ierr_mon1, fmt='.', ecolor='blue', color='blue', label='ch='+str(DAch))
        plt.plot(V_mon2,
                 I_mon2,
                 linestyle='-',
                 color='red',
                 linewidth=1.0,
                 label='LO ari')
        plt.title('SIS Mixer I-V ' +
                  t.strftime('%Y/%m/%d/ %H:%M:%S' + ' LO =' +
                             str(Lo_list[i - 1]) + 'GHz' + ' LOatt=' +
                             str(Loatt_list[i - 1])))
        plt.xlim(0, V_mon1.max())
        plt.ylim(I_mon1.min(), I_mon1.max())
        plt.xlabel('Mixer Voltage [mV]')
        plt.ylabel('Mixer Current [uA]')
        plt.grid()
        plt.legend(loc='upper left')
        plt.savefig(pngpath + 'IV/' + filename1)
        if gragh == 1:
            plt.show()
        else:
            pass

        fig = plt.figure()
        ax1 = fig.add_subplot(111)
        ax2 = ax1.twinx()
        ax1.plot(V_mon2,
                 I_mon2,
                 linestyle='-',
                 color='black',
                 linewidth=1.0,
                 label='I-V')
        ax2.plot(V_mon2,
                 hot,
                 linestyle='-',
                 color='red',
                 linewidth=1.0,
                 label='hot')
        ax2.plot(V_mon2,
                 cold,
                 linestyle='-',
                 color='blue',
                 linewidth=1.0,
                 label='cold')
        plt.title('SIS Mixer I-V ' +
                  t.strftime('%Y/%m/%d/ %H:%M:%S' + ' LO =' +
                             str(Lo_list[i - 1]) + 'GHz' + ' LOatt=' +
                             str(Loatt_list[i - 1])))
        ax1.set_xlim(0, V_mon2.max())
        ax1.set_ylim(I_mon2.min(), I_mon2.max())
        ax2.set_ylim(-40, -20)
        ax1.set_xlabel('Mixer Voltage [mV]')
        ax1.set_ylabel('Mixer Current [uA]')
        ax2.set_ylabel('IF power [dbm]')
        ax1.grid(True)
        plt.legend(loc='upper left')
        plt.savefig(pngpath + 'IFV/' + filename2)
        if gragh == 1:
            plt.show()
        else:
            pass

        fig = plt.figure()
        ax1 = fig.add_subplot(111)
        ax2 = ax1.twinx()
        ax3 = ax1.twinx()
        ax1.plot(V_mon2,
                 I_mon2,
                 linestyle='-',
                 color='black',
                 linewidth=1.0,
                 label='I-V')
        ax2.plot(V_mon2,
                 yfac,
                 linestyle='-',
                 color='green',
                 linewidth=1.0,
                 label='')
        #ax3.plot(V_mon2, trx, linestyle='-', color='yellow', linewidth=1.0, label='cold')
        plt.title('SIS Mixer I-V ' +
                  t.strftime('%Y/%m/%d/ %H:%M:%S' + ' LO =' +
                             str(Lo_list[i - 1]) + 'GHz' + ' LOatt=' +
                             str(Loatt_list[i - 1])))
        ax1.set_xlim(0, V_mon2.max())
        ax1.set_ylim(I_mon2.min(), I_mon2.max())
        ax2.set_ylim(0, 6)
        ax3.set_ylim(0, 300)
        ax1.set_xlabel('Mixer Voltage [mV]')
        ax1.set_ylabel('Mixer Current [uA]')
        ax2.set_ylabel('Y-factor [dbm]')
        ax3.set_ylabel('Trx [K]')
        ax1.grid(True)
        plt.legend(loc='upper left')
        plt.savefig(pngpath + 'IFV/' + filename3)
        if gragh == 1:
            plt.show()
        else:
            pass

    print('END MEASUREMENT')
    Lo.sg.end_osci()
#set LO
print('room temperature [℃]')
ret = raw_input()
Tamb = float(ret) + 273.2
print('INPUT SIS Voltage: 0 -- 30 [mV]')
ret1 = raw_input()
voltage = float(ret1)
print('INPUT LO att. 0 -- 100 [mA]')
ret2 = raw_input()
current2 = float(ret2)
print('INPUT LO frecency [GHz]')
ret3 = raw_input()
frec3 = float(ret3)
Lo.sg = Lo.firstlo(multiplier=6)
Lo.sg.start_osci(frec3, 19.0)
box = Cryo.mixer()
box.set_sisv(Vmix=voltage, ch=0)
box.set_loatt(att=current2, ch=0)
load = CPZ7204.cpz7204()
load.set_home()

print "============"
print "HOT LOAD"
print "Current position is defined as the COLD position"
print "   "
time.sleep(1.0)
# settings of spectrum analyzer
band_start = 2  #[GHz]
band_end = 14  #[GHz]

## Query Setting of Spectrum Analyzer
Beispiel #8
0
 def __init__(self):
     self.hemt = Cryo.hemt()
     self.spec = XFFTS.xffts()
Beispiel #9
0
 def __init__(self):
     self.mix = Cryo.mixer()
     self.spec = XFFTS.xffts()
Beispiel #10
0
def IVtrace(ch,
            Vgap,
            Vrange=[0, 12],
            average=5,
            pngpath='/home/amigos/data/SIS/IV/'):
    '''
    DESCRIPTION
    ================

    ARGUMENT
    ================
        1. : 
            Type: 

    RETURN
    ================
    Nothing.
    '''
    Vres = 0.5
    Vrres = 0.5
    if ch == 0:
        DAch = 0
        VADch = 0
        IADch = 1
    else:
        DAch = 1
        VADch = 2
        IADch = 3
    t = datetime.datetime.now()
    ut = t.strftime('%Y%m%d_%H%M%S')
    filename = 'SISIV' + ut + '.png'
    box = Cryo.mixer()
    V_mon = np.array([])
    Verr_mon = np.array([])
    I_mon = np.array([])
    Ierr_mon = np.array([])
    V_list_low = np.arange(Vrange[0], Vgap - 0.5, Vres)
    V_list_mid = np.arange(Vgap - 0.5, Vgap + 0.5, 0.05)
    V_list_high = np.arange(Vgap + 0.5, Vrange[1], Vres)
    V_list = np.hstack((V_list_low, V_list_mid, V_list_high))
    print(V_list)
    print('======== START ========')
    for v in V_list:
        print('V = ' + str(round(v, 2)) + ' mV')
        box.set_sisv(Vmix=v, ch=DAch)
        dV = np.array([])
        dI = np.array([])
        time.sleep(0.1)
        for j in range(average):
            ret = box.monitor_sis()
            dV = np.append(dV, ret[VADch] * 1e+1)
            dI = np.append(dI, ret[IADch] * 1e+3)
        dV_mean = np.mean(dV, axis=0)
        dV_std = np.std(dV, axis=0)
        V_mon = np.append(V_mon, dV_mean)
        Verr_mon = np.append(Verr_mon, dV_std)
        dI_mean = np.mean(dI, axis=0)
        dI_std = np.std(dI, axis=0)
        I_mon = np.append(I_mon, dI_mean)
        Ierr_mon = np.append(Ierr_mon, dI_std)
    V_rlist = np.arange(Vrange[0], Vrange[1], Vrres)
    V_rlist = np.sort(V_rlist)[::-1]
    for v in V_rlist:
        print('V = ' + str(round(v, 2)) + ' mV')
        box.set_sisv(Vmix=v, ch=DAch)
        time.sleep(0.1)
    print('======== END ========')
    print(dV)
    print(dV)
    plt.errorbar(V_mon,
                 I_mon,
                 xerr=Verr_mon,
                 yerr=Ierr_mon,
                 fmt='.',
                 ecolor='red',
                 color='red',
                 label='ch=' + str(DAch))
    plt.plot(V_mon,
             I_mon,
             linestyle='-',
             color='green',
             linewidth=1.0,
             label='interpolation')
    plt.title('SIS Mixer I-V ' + t.strftime('%Y/%m/%d/ %H:%M:%S'))
    plt.xlim(0, V_mon.max())
    plt.ylim(I_mon.min(), I_mon.max())
    plt.xlabel('Mixer Voltage [mV]')
    plt.ylabel('Mixer Current [uA]')
    plt.grid(True)
    plt.legend(loc='upper left')
    plt.savefig(pngpath + filename)
    plt.show()