// Subtract baseline.
final double mz = dp.getMZ();
final int bin = mzRange.binNumber(numBins, mz);
final double baselineIntenstity = baselines[bin][scanIndex];
newDataPoints[i++] = baselineIntenstity <= 0.0
? new SimpleDataPoint(dp)
: new SimpleDataPoint(mz, Math.max(0.0, dp.getIntensity()
* (1.0 - baselineIntenstity)));
}
// Return the new data points.
return newDataPoints;