/// <summary>
        /// Find again absorbtion edge wavelength around clicked point.
        /// Rewrite corresponding temperature and time.
        /// </summary>
        /// <param name="clickedWavelength"></param>
        public double AnalyzeMeasurement(double clickedWavelength)
        {
            // clickedWavelength => clickedIndex.
            // Apply any defensive coding here as necessary.
            var wavelengths   = MSpectraProcessor.Wavelengths;
            var minDifference = double.MaxValue;
            int clickedIndex  = 0;

            for (int i = 0; i < wavelengths.Length; i++)
            {
                double difference = Math.Abs(wavelengths[i] - clickedWavelength);
                if (difference < minDifference)
                {
                    minDifference = difference;
                    clickedIndex  = i;
                }
            }
            MTemperatureHistory.RemoveLast();
            MSpectraProcessor.MaxDerivativeIndex = clickedIndex;
            MSpectraProcessor.OnDataReady(reanalyze: true);

            // RETRIGGER ANALYSE MEASUREMENT

            return(AnalyzeMeasurement());
        }
        /// <summary>
        /// Find absorbtion edge wavelength
        /// Add corresponding temperature and time
        /// to their respective fields.
        /// </summary>
        public double AnalyzeMeasurement()
        {
            double?temperature = MSpectraProcessor.Temperature;

            if (temperature != null)
            {
                MTemperatureHistory.Add((double)temperature, MSpectraProcessor.Time);
            }
            return((double)temperature);
        }
 public void ResetTemperatureHistory()
 {
     MTemperatureHistory.Clear();
 }