<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _calc_auc(self, model, params, idx):
 """ Helper function to calculate the area under the curve of a model Parameters model : callable Probably either ut.lorentzian or ut.gaussian, but any function will do, as long as its first parameter is an array of frequencies and the third parameter controls its amplitude. params : ndarray Each row of these should contain exactly the number of params that the model function expects after the first (frequency) parameter. The second column should control the amplitude of the function. idx : Indices to the part of the spectrum over which AUC will be calculated. """

        # Here's what we are going to do: For each transient, we generate
        # the spectrum for two distinct sets of parameters: one is exactly as
        # fit to the data, the other is the same expect with amplitude set to
        # 0. To calculate AUC, we take the difference between them:
        auc = np.zeros(params.shape[0])
        delta_f = np.abs(self.f_ppm[1]-self.f_ppm[0])
        p = np.copy(params)
        for t in range(auc.shape[0]):
            model1 = model(self.f_ppm[idx], *p[t])
            # This controls the amplitude in both the Gaussian and the
            # Lorentzian: 
            p[t, 1] = 0
            model0 = model(self.f_ppm[idx], *p[t])
            auc[t] = np.sum((model1 - model0) * delta_f)
        return auc