예제 #1
0
def run(n, group_path, plotFlag, saveFlag):

    # Loading setups configurations
    config = setup()

    #rm-list_resources() to find address for smu
    address_2612b = 26
    address_2400 = 24

    clear_all()

    #running tests (smua measures iv and smub measures r)

    [smu_2612b, smu_2400, rm] = gpib(address_2612b, address_2400)

    [readingsV_sipm, readingsI_sipm, readingsV_led, readingsI_led,
     readingsR] = SelfHeating(smu_2612b, smu_2400, config[0], config[1],
                              config[2], config[3], config[4], config[5],
                              config[6], config[7], config[8], config[9],
                              config[10], config[11], config[12], config[13],
                              config[14], config[15], config[16], config[17],
                              config[18], config[19], config[20], config[21])

    smu_2612b.write('reset()')

    smu_2612b.write('smua.nvbuffer1.clear()')
    smu_2612b.write('smub.nvbuffer1.clear()')
    smu_2400.write('*CLS')

    rm.close

    Number = []
    led_power = []
    for i in range(0, len(readingsR)):
        Number.append(i)
        led_power.append(readingsV_led[i] * readingsI_led[i])

    if plotFlag == 1:
        graphR = plot(Number, readingsR, 'N', 'R', 1)
        graphIV = plot(readingsI_led,
                       readingsI_sipm,
                       'Iled',
                       'Isipm',
                       2,
                       log=True,
                       errorbars_2612=True)
        graphIVLed = plot(readingsV_led, readingsI_led, 'Vled', 'I', 3)

    else:
        graphR = 'NULL'
        graphIV = 'NULL'

    if saveFlag == 1:
        save(readingsV_sipm, readingsI_sipm, readingsV_led, readingsI_led,
             readingsR, graphIV, graphR, n, group_path)

    return
예제 #2
0
파일: k2612B.py 프로젝트: labosat/Labo-7
def run(n, test, group_path, plotFlag, saveFlag):

    clear_all()
    # Loading setups configurations
    config = setup()

    #rm-list_resources() to find address for smu
    address_2612b = 26

    #running tests (smua measures iv and smub measures r)

    [smu_2612b, rm] = gpib(address_2612b)

    [readingsV_sipm, readingsI_sipm] = IVComplete(smu_2612b, config)

    readingsV_sipm_neg, readingsV_sipm_pos, readingsI_sipm_neg, readingsI_sipm_pos = split(
        readingsV_sipm, readingsI_sipm)

    if plotFlag == 1:
        graphIV_neg = plot(readingsV_sipm_neg,
                           readingsI_sipm_neg,
                           'Vsipm',
                           'Isipm',
                           1,
                           log=False,
                           errorbars_2612=True)
        graphIV_pos = plot(readingsV_sipm_pos,
                           readingsI_sipm_pos,
                           'Vsipm',
                           'Isipm',
                           2,
                           log=False,
                           errorbars_2612=True)

    else:
        graphIV_neg = 'NULL'
        graphIV_pos = 'NULL'

    if saveFlag == 1:
        group_path_pos = group_path + " (rq)"
        group_path_neg = group_path + " (vbr)"
        save_iv(readingsV_sipm_neg, readingsI_sipm_neg, graphIV_neg, n,
                group_path_pos)

        save_iv(readingsV_sipm_pos, readingsI_sipm_pos, graphIV_pos, n,
                group_path_neg)

    time.sleep(0)
    readingsI_sipm_dark = DarkCurrent(smu_2612b, config)

    number = []
    for g in range(len(readingsI_sipm_dark)):
        number.append(g)

    if plotFlag == 1:
        graphIV = plot(number,
                       readingsI_sipm_dark,
                       'N',
                       'Isipm',
                       3,
                       log=False,
                       errorbars_2612=True)
    else:
        graphIV = 'NULL'

    if saveFlag == 1:
        group_path_dark = group_path + " (idark)"
        save_dark(readingsI_sipm_dark, graphIV, n, group_path_dark)

    [readingsI_sipm_led, readingsI_led,
     readingsV_led] = LEDTest(smu_2612b, config)

    if plotFlag == 1:
        graphIV_led = plot(readingsI_led,
                           readingsI_sipm_led,
                           'Iled',
                           'Isipm',
                           4,
                           log=True,
                           errorbars_2612=True,
                           xflag='I')
    else:
        graphIV_led = 'NULL'

    if saveFlag == 1:
        group_path_dark = group_path + " (LED)"
        save_led(readingsI_sipm_led, readingsI_led, readingsV_led, graphIV_led,
                 n, group_path_dark)

    rm.close

    return
예제 #3
0
def run(n, test, group_path, plotFlag, saveFlag):

    # Loading setups configurations
    config = setup()

    #rm-list_resources() to find address for smu
    address_2612b = 26
    address_2400 = 24

    clear_all()

    #running tests (smua measures iv and smub measures r)

    [smu_2612b, smu_2400, rm] = gpib(address_2612b, address_2400)

    if test == 'iv':

        [readingsV_sipm, readingsI_sipm,
         readingsR] = IVComplete(smu_2612b, smu_2400, config)

        smu_2612b.write('reset()')

        smu_2612b.write('smua.nvbuffer1.clear()')
        smu_2612b.write('smub.nvbuffer1.clear()')
        smu_2400.write('*CLS')

        readingsV_sipm_neg, readingsV_sipm_pos, readingsI_sipm_neg, readingsI_sipm_pos, readingsR_neg, readingsR_pos = split(
            readingsV_sipm, readingsI_sipm, readingsR)

        number_neg = []
        number_pos = []

        for g in range(len(readingsR_neg)):
            number_neg.append(g)

        for g in range(len(readingsR_pos)):
            number_pos.append(g)

        if plotFlag == 1:
            graphR_neg = plot(number_neg,
                              readingsR_neg,
                              'N',
                              'R',
                              1,
                              log=False,
                              errorbars_2400=True)
            graphR_pos = plot(number_pos,
                              readingsR_pos,
                              'N',
                              'R',
                              2,
                              log=False,
                              errorbars_2400=True)
            graphIV_neg = plot(readingsV_sipm_neg,
                               readingsI_sipm_neg,
                               'Vsipm',
                               'Isipm',
                               3,
                               log=False,
                               errorbars_2612=True)
            graphIV_pos = plot(readingsV_sipm_pos,
                               readingsI_sipm_pos,
                               'Vsipm',
                               'Isipm',
                               4,
                               log=False,
                               errorbars_2612=True)

        else:
            graphR_neg = 'NULL'
            graphR_pos = 'NULL'
            graphIV_neg = 'NULL'
            graphIV_pos = 'NULL'

        if saveFlag == 1:
            group_path_pos = group_path + " (rq)"
            group_path_neg = group_path + " (vbr)"
            save_iv(readingsV_sipm_neg, readingsI_sipm_neg, readingsR_neg,
                    graphIV_neg, graphR_neg, n, group_path_pos)

            save_iv(readingsV_sipm_pos, readingsI_sipm_pos, readingsR_pos,
                    graphIV_pos, graphR_pos, n, group_path_neg)

        time.sleep(45)
        [readingsI_sipm, readingsR] = DarkCurrent(smu_2612b, smu_2400, config)

        smu_2612b.write('reset()')

        smu_2612b.write('smua.nvbuffer1.clear()')
        smu_2612b.write('smub.nvbuffer1.clear()')
        smu_2400.write('*CLS')

        number = []
        for g in range(len(readingsR)):
            number.append(g)

        if plotFlag == 1:
            graphR = plot(number,
                          readingsI_sipm,
                          'N',
                          'Isipm',
                          5,
                          log=False,
                          errorbars_2612=True)
        else:
            graphR = 'NULL'

        if saveFlag == 1:
            group_path_dark = group_path + " (idark)"
            save_dark(readingsI_sipm, readingsR, graphR, n, group_path_dark)

        rm.close
        return

    elif test == 'self_heating':

        [
            readingsV_sipm, readingsI_sipm, readingsV_led, readingsI_led,
            readingsR
        ] = SelfHeating(smu_2612b, smu_2400, config)

        smu_2612b.write('reset()')

        smu_2612b.write('smua.nvbuffer1.clear()')
        smu_2612b.write('smub.nvbuffer1.clear()')
        smu_2400.write('*CLS')

        rm.close

        Number = []
        for i in range(0, len(readingsR)):
            Number.append(i)

        if plotFlag == 1:
            graphR = plot(Number, readingsR, 'N', 'R', 1)
            graphIV = plot(readingsI_led,
                           readingsI_sipm,
                           'Iled',
                           'Isipm',
                           2,
                           log=True,
                           errorbars_2612=True)

        else:
            graphR = 'NULL'
            graphIV = 'NULL'

        if saveFlag == 1:
            save(readingsV_sipm, readingsI_sipm, readingsV_led, readingsI_led,
                 readingsR, graphIV, graphR, n, group_path)

        return

    else:
        print(str(test) + " is not a valid mode")
        return
예제 #4
0
def run(n, mode, group_path, plotFlag, saveFlag, wait_time):

    # Loading setups configurations
    config = setup()

    #rm-list_resources() to find address for smu
    address_2612b = 26
    address_2400 = 24

    clear_all()

    #running tests (smua measures iv and smub measures r)

    if mode == 'iv':
        [smu, rm] = gpib(address_2612b)

        [readingsV, readingsI, readingsR, readingsIR
         ] = ivr(smu, config[0], config[1], config[2], config[3], config[4],
                 config[5], config[6], config[7], config[8], config[9],
                 config[10], config[11], config[12], config[13], config[14],
                 config[15], config[16], config[18], wait_time)

        smu.write('reset()')

        smu.write('smua.nvbuffer1.clear()')
        smu.write('smub.nvbuffer1.clear()')

        rm.close

        Number = []
        for i in range(0, len(readingsR)):
            Number.append(i)

        if plotFlag == 1:
            graphR = plot(Number, readingsR, 'N', 'R', 1)
            graphIV = plot(readingsV, readingsI, 'V', 'I', 2)
        else:
            graphR = 'NULL'
            graphIV = 'NULL'

        if saveFlag == 1:
            save(readingsV, readingsI, readingsR, readingsIR, graphIV, graphR,
                 n, group_path)

        return

    elif mode == 'led1':

        [smu_2612b, smu_2400, rm] = gpib2(address_2612b, address_2400)

        #polarization voltage for sipm on led1 test
        vPolarization_sipm = 30

        [readingsI_sipm, readingsV_led, readingsI_led, readingsR, readingsIR
         ] = led1(smu_2612b, smu_2400, config[0], config[1], config[2],
                  config[3], config[4], config[5], config[6], config[7],
                  config[8], config[9], config[13], config[14], config[15],
                  config[19], vPolarization_sipm, wait_time)

        smu_2612b.write('reset()')

        smu_2612b.write('smua.nvbuffer1.clear()')
        smu_2612b.write('smub.nvbuffer1.clear()')
        smu_2400.write('*CLS')

        rm.close

        Number = []
        for i in range(0, len(readingsR)):
            Number.append(i)

        if plotFlag == 1:
            graphR = plot(Number, readingsR, 'N', 'R', 1)
            graphIV = plot(readingsI_led, readingsI_sipm, 'Iled', 'Isipm', 2)
        else:
            graphR = 'NULL'
            graphIV = 'NULL'

        if saveFlag == 1:
            save_led(readingsI_sipm, readingsV_led, readingsI_led, readingsR,
                     readingsIR, graphIV, graphR, n, group_path)

        return

    elif mode == 'led2':

        [smu_2612b, smu_2400, rm] = gpib2(address_2612b, address_2400)

        #polarization current for led on led2 test
        iPolarization_led = 100 * P('m')
        vPolarization_sipm = 30

        [readingsI_sipm, readingsV_led, readingsR, readingsIR
         ] = led2(smu_2612b, smu_2400, config[0], config[1], config[2],
                  config[3], config[4], config[5], config[6], config[7],
                  config[8], config[9], config[17], config[20],
                  vPolarization_sipm, iPolarization_led, wait_time)

        smu_2612b.write('reset()')

        smu_2612b.write('smua.nvbuffer1.clear()')
        smu_2612b.write('smub.nvbuffer1.clear()')
        smu_2400.write('*CLS')

        rm.close

        Time = []
        for i in range(0, len(readingsR)):
            Time.append(i * wait_time)

        if plotFlag == 1:
            graphR = plot(Time, readingsR, 't', 'R', 1)
            graphI = plot(Time, readingsI_sipm, 't', 'Isipm', 2)
        else:
            graphR = 'NULL'
            graphI = 'NULL'

        if saveFlag == 1:
            save_led(Time, readingsI_sipm, readingsV_led, readingsR,
                     readingsIR, graphI, graphR, n, group_path)

        return