pyspec/spectrum.py
def calc_var(self):
        """ compute variance of p from Fourier coefficients ph """
        self.var_dens = np.fft.fftshift(self.spec.copy(),axes=0)
        # only half of coefs [0] and [nx/2+1] due to symmetry in real fft2

        if self.n1even:
            self.var_dens[:,0],self.var_dens[:,-1] = self.var_dens[:,0]/2.,\
                    self.var_dens[:,-1]/2.
            self.var = self.var_dens.sum()*self.dk1*self.dk2
        else:
            self.var_dens[:,0],self.var_dens[:,-1] = self.var_dens[:,0]/2.,\
                    self.var_dens[:,-1]
            self.var = self.var_dens.sum()*self.dk1*self.dk2
 compute variance of p from Fourier coefficients ph 
compute variance of p from Fourier coefficients ph
compute variance of p from Fourier coefficients ph
def calc_var(self):
        self.var_dens = np.fft.fftshift(self.spec.copy(),axes=0)
        if self.n1even:
            self.var_dens[:,0],self.var_dens[:,-1] = self.var_dens[:,0]/2.,\
                    self.var_dens[:,-1]/2.
            self.var = self.var_dens.sum()*self.dk1*self.dk2
        else:
            self.var_dens[:,0],self.var_dens[:,-1] = self.var_dens[:,0]/2.,\
                    self.var_dens[:,-1]
            self.var = self.var_dens.sum()*self.dk1*self.dk2
def calc_var ( self ) : self . var_dens = np . fft . fftshift ( self . spec . copy ( ) , axes = 0 ) if self . n1even : self . var_dens [ : , 0 ] , self . var_dens [ : , - 1 ] = self . var_dens [ : , 0 ] / 2. , self . var_dens [ : , - 1 ] / 2. self . var = self . var_dens . sum ( ) * self . dk1 * self . dk2 else : self . var_dens [ : , 0 ] , self . var_dens [ : , - 1 ] = self . var_dens [ : , 0 ] / 2. , self . var_dens [ : , - 1 ] self . var = self . var_dens . sum ( ) * self . dk1 * self . dk2
compute variance of p from Fourier coefficients ph
compute variance of p from Fourier coefficients ph
""" compute variance of p from Fourier coefficients ph """ # only half of coefs [0] and [nx/2+1] due to symmetry in real fft2
self