I have two separate ranges of data. The first range is a graph of a wavelength range vs light intensity. Both are lists with lengths of 651. The second range is a graph of a different wavelength range vs quantum efficiency. Both are lists with lengths of 472. The quantum efficiency is a percentage of how well my camera captures light intensity from wavelengths 400-872 nm. I want to find the intensity within this range and divide it by the quantum efficiency to account make my intensity values more real.
y = wavelength_range_axis_values.index(400) #find the index that contains 400
print(y)
g = 0
for wl in quantum_wavelength:
g += 1 #used to see how many times my loop iterates
i = final_peaks[y+ wl-400] #find the peak intensity at wl nanometers
adjusted_value = round((i/quantum_efficiency[wl-400]),2) #adjust peak intensity based on quantum efficiency
print(g,quantum_efficiency[wl-400])
The loop iterates 386 times until it says that quantum_efficiency[wl-400] is out of range. I don't understand what the issue is. Could someone help me understand what I'm doing wrong?
All I want to do is find the light intensity at 400 nanometers (I do this by finding the index of the wavelength at 400 since they have the same list) and adjust it based on the quantum efficiency at 400 nanometers, and continue this process until I reach the end of my second wavelength (472 iterations).