# Getting the desired photo-sensitivity for the peak wavelength (1st approximation) ph_wavelength, photosensitivity = read_pindiode_photo_sensitivity() ph_wavelength_smooth = np.linspace(ph_wavelength.min(), ph_wavelength.max(), 1000) photosensitivity_smooth = spline(ph_wavelength, photosensitivity, ph_wavelength_smooth) pin_diode_wavelength = ph_wavelength_smooth[68] pin_diode_pde = photosensitivity_smooth[68] plt.plot(ph_wavelength_smooth, photosensitivity_smooth) plt.xlabel("wavelength [nm]") plt.ylabel("Photosensitivity [A/W]") x, y, current, current_std, current_time, current_timestamp = read_file(path_to_file=file_flash, scan_type='time') systematic_err = comp.calculate_systematic_error(current) statistic_err = comp.calculate_statistic_error(current_std) total_err = np.sqrt(systematic_err**2 + statistic_err**2) factor = pin_diode_pde * illuminated_area scaling = 1e-6 # to go to micro Watts irradiance = (current / factor) / scaling irradiance_err = (total_err[0] / factor) / scaling initial_bin = 80 final_bin = 350 p, cov = np.polyfit(current_time[initial_bin:final_bin], irradiance[initial_bin:final_bin], deg=1, cov=True) error_bars = np.sqrt(np.diag(cov))
detector_size = [30, 30] #xx = np.array([-450., 450.]) #yy = np.array([-600., 600.]) xx = np.array([-437, 463]) yy = np.array([-681.7, 518.3]) #x_ticks = [150, 180, 210] #y_ticks = [30, 60, 90] extent = [-detector_size[0]/2 + xx.min(), detector_size[0]/2 + xx.max(), -detector_size[1]/2 + yy.min(), detector_size[1]/2 + yy.max()] steps = 11 for cnt in range(0, 12): x, y, flash_current, flash_current_std, flash_current_time, flash_current_timestamp = read_file(flash[cnt], 'space', initial_temperature_time=None) flash_stat_err = calculate_statistic_error(flash_current_std) flash_sys_err = calculate_systematic_error(flash_current) flash_current_err = np.sqrt(flash_stat_err ** 2 + flash_sys_err ** 2) x, y, dark_current, dark_current_std, dark_current_time, dark_current_timestamp = read_file(dark[cnt], 'space', initial_temperature_time=None) dark_stat_err = calculate_statistic_error(dark_current_std) dark_sys_err = calculate_systematic_error(dark_current) dark_current_err = np.sqrt(dark_stat_err ** 2 + dark_sys_err ** 2) result = flash_current - dark_current result_err = np.sqrt(flash_current_err ** 2 + dark_current_err ** 2) flash_current = flash_current.reshape((steps, steps)).T flash_current_err = flash_current_err.reshape((steps, steps)).T dark_current = dark_current.reshape((steps, steps)).T dark_current_err = dark_current_err.reshape((steps, steps)).T