pyspec/spectrum.py
def calc_spectrum(self):
        """ compute the 1d spectrum of a field phi """

        self.phih = np.fft.rfft(self.phi)

        # the factor of 2 comes from the symmetry of the Fourier coeffs
        self.spec = 2.*(self.phih*self.phih.conj()).real / self.df /\
                self.n**2

        # the zeroth frequency should be counted only once
        self.spec[0] = self.spec[0]/2.
        if self.neven:
            self.spec[-1] = self.spec[-1]/2.
 compute the 1d spectrum of a field phi 
compute the 1d spectrum of a field phi
compute the 1d spectrum of a field phi
def calc_spectrum(self):
        self.phih = np.fft.rfft(self.phi)
        self.spec = 2.*(self.phih*self.phih.conj()).real / self.df /\
                self.n**2
        self.spec[0] = self.spec[0]/2.
        if self.neven:
            self.spec[-1] = self.spec[-1]/2.
def calc_spectrum ( self ) : self . phih = np . fft . rfft ( self . phi ) self . spec = 2. * ( self . phih * self . phih . conj ( ) ) . real / self . df / self . n ** 2 self . spec [ 0 ] = self . spec [ 0 ] / 2. if self . neven : self . spec [ - 1 ] = self . spec [ - 1 ] / 2.
compute the 1d spectrum of a field phi
compute the 1d spectrum of a field phi
""" compute the 1d spectrum of a field phi """ # the factor of 2 comes from the symmetry of the Fourier coeffs # the zeroth frequency should be counted only once
self