ToolPythonBeginner Numerical integration with scipy.integrate: the area under a measured peak net = counts - np.polyval(np.polyfit(lam[edge], counts[edge], 1), lam)p, C = np.polyfit(lam[flank] - peak, counts[flank], 1, cov=True)P = np.polyfit(lam[flank] - peak, reruns[:, flank].T, 1) # one fit per rerun