Temperature compensation of diode detectors