save_file = False file_suffix = "PD" """ Code """ t = time.time() keys = Keysight() diode = diodeCal() try: """ 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)
keys = Keysight() newp = TLS() def closeall(): sens.close() keys.close() newp.close() try: """ Initialize devices """ keys.set_output_voltage(bias_voltage) keys.set_range(max_amps) keys.set_aper(0.1) # long exposure for better averageing sens.set_reps(1) """ Set lambda """ newp.set_lambda(lam) """ Saturation level: Granular data Find maximum variance point """ if find_sat_ms: newp.filterW(1) # Light mode