Exemplo n.º 1
0
 /// <summary>
 /// Adds the intensities from the other TimeIntensities to the intensities in this.
 /// The returned TimeIntensities will have the same set of times as this.
 /// </summary>
 public TimeIntensities AddIntensities(TimeIntensities other)
 {
     if (!Times.Equals(other.Times))
     {
         other = other.Interpolate(Times, false);
     }
     float[] newIntensities = new float[Times.Count];
     for (int i = 0; i < Times.Count; i++)
     {
         // Avoid arithmetic overflow
         double intensitySum = Intensities[i] + other.Intensities[i];
         newIntensities[i] = intensitySum < float.MaxValue ? (float)intensitySum : float.MaxValue;
     }
     return(new TimeIntensities(Times, newIntensities, null, null));
 }
Exemplo n.º 2
0
        public void Interpolate(float[] timesNew, bool inferZeros)
        {
            var chromatogramTimeIntensities = new TimeIntensities(RawTimes, RawIntensities, RawMassErrors, RawScanIds);

            TimeIntensities = chromatogramTimeIntensities.Interpolate(timesNew, inferZeros);
        }