Пример #1
0
    newp.filterW(3)

    dark_mean = np.zeros_like(test_ms)
    dark_var = np.zeros_like(test_ms)
    for ind, integ_ms in enumerate(test_ms):
        sens.set_aper(integ_ms)
        frame1 = sens.get_spect()[roi_ind1:roi_ind2]
        frame2 = sens.get_spect()[roi_ind1:roi_ind2]
        var = np.var([frame1, frame2], 0, ddof=1)
        var_av = np.mean(var)
        dark_var[ind] = var_av
        mean = np.mean([frame1, frame2])
        dark_mean[ind] = mean

    dark_curr = keys.get_current()
    print("Dark current: ", dark_curr, " Amps")
    """
    Light values and noise:
        filter 1
        10-70% of saturation exposure
        2 images at each level
        variance, mean, stdev
        photons:
            PD current - dark current
            current -> light power
            light power -> photons at lambda
    """

    newp.filterW(1)
Пример #2
0
    """ Initialize """
    keys.set_range(
        max_amps)  # experiment with different ranges for best performance.
    keys.set_output_voltage(
        bias_voltage)  # Bit of an arbitrary choice. Shouldn't matter much.
    keys.auto_aper(True)

    time.sleep(1)

    curr_array = np.array([])
    temp_array = np.array([])

    while time.time() - t < time_s:
        """ Read sensor """
        #print("Reading Sony Sensor...")
        curr = keys.get_current()
        temp = keys.get_temperature()
        curr_array = np.append(curr_array, curr)
        temp_array = np.append(temp_array, temp)

    fig = plt.figure(figsize=(12, 9))
    plt.plot(curr_array)
    fig = plt.figure(figsize=(12, 9))
    plt.plot(temp_array)

    print("Avg current: ", np.mean(curr_array), " Amps")
    print("Temperature: ", np.mean(temp_array), " Celcius")

    print("Predicted dark current: ", diode.dark(np.mean(temp_array)), " Amps")

    if save_file:
Пример #3
0
    curr_av = np.array([])
    average_points = 2
    aper_time = 0.05
    # keys.set_aper(aper_time)

    for lam in test_lam:
        _ = newp.set_lambda(lam)
        TLS_lam = np.append(TLS_lam, newp.get_lambda())

        #    curr_points = np.array([])
        #    for ind in range(average_points):
        #        curr = keys.get_current()
        #        curr_points = np.append(curr_points, curr)
        #
        #    curr_av = np.append(curr_av, np.mean(curr_points))
        curr_av = np.append(curr_av, keys.get_current())

    newp.set_lambda(550)  #reset it to something we can see.

    plt.figure(figsize=(9, 7))
    plt.plot(TLS_lam, curr_av)
    plt.ylabel('current')
    plt.xlabel('wavelength (nm)')

    pd_cal = diodeCal().func
    watts = np.divide(curr_av, pd_cal(TLS_lam))

    plt.figure(figsize=(9, 7))
    plt.plot(TLS_lam, watts)
    plt.ylabel('power (W)')
    plt.xlabel('wavelength (nm)')