def set_folding(self, folding, width):
     BaseInducedField.set_folding(self, folding, width)
     
     if self.folding is None:
         self.folder = Folder(None, None)
     else:
         if self.folding == 'Gauss':
             self.folder = Folder(self.width, 'ComplexGauss')
         elif self.folding == 'Lorentz':
             self.folder = Folder(self.width, 'ComplexLorentz')
         else:
             raise RuntimeError('unknown folding "' + self.folding + '"')
Exemple #2
0
    def set_folding(self, folding, width):
        BaseInducedField.set_folding(self, folding, width)

        if self.folding is None:
            self.envelope = lambda t: 1.0
        else:
            if self.folding == 'Gauss':
                self.envelope = lambda t: np.exp(-0.5 * self.width**2 * t**2)
            elif self.folding == 'Lorentz':
                self.envelope = lambda t: np.exp(-self.width * t)
            else:
                raise RuntimeError('unknown folding "' + self.folding + '"')
 def set_folding(self, folding, width):
     BaseInducedField.set_folding(self, folding, width)
     
     if self.folding is None:
         self.envelope = lambda t: 1.0
     else:
         if self.folding == 'Gauss':
             self.envelope = lambda t: np.exp(- 0.5 * self.width**2 * t**2)
         elif self.folding == 'Lorentz':
             self.envelope = lambda t: np.exp(- self.width * t)
         else:
             raise RuntimeError('unknown folding "' + self.folding + '"')