pyspec/spectrum.py
def calc_freq(self):
        """ calculate array of spectral variable (frequency or
                wavenumber) in cycles per unit of L """

        # wavenumber one (equals to dk1 and dk2)
        self.dk1 = 1./self.L1
        self.dk2 = 1./self.L2

        # wavenumber grids
        self.k2 = self.dk2*np.append( np.arange(0.,self.n2/2), \
                  np.arange(-self.n2/2,0.) )
        self.k1 = self.dk1*np.arange(0.,self.n1/2+1)

        self.kk1,self.kk2 = np.meshgrid(self.k1,self.k2)

        self.kk1 = np.fft.fftshift(self.kk1,axes=0)
        self.kk2 = np.fft.fftshift(self.kk2,axes=0)
        self.kappa2 = self.kk1**2 + self.kk2**2
        self.kappa = np.sqrt(self.kappa2)
 calculate array of spectral variable (frequency or
                wavenumber) in cycles per unit of L 
calculate array of spectral variable (frequency or
wavenumber) in cycles per unit of L
calculate array of spectral variable ( frequency or wavenumber ) in cycles per unit of L
def calc_freq(self):
        self.dk1 = 1./self.L1
        self.dk2 = 1./self.L2
        self.k2 = self.dk2*np.append( np.arange(0.,self.n2/2), \
                  np.arange(-self.n2/2,0.) )
        self.k1 = self.dk1*np.arange(0.,self.n1/2+1)
        self.kk1,self.kk2 = np.meshgrid(self.k1,self.k2)
        self.kk1 = np.fft.fftshift(self.kk1,axes=0)
        self.kk2 = np.fft.fftshift(self.kk2,axes=0)
        self.kappa2 = self.kk1**2 + self.kk2**2
        self.kappa = np.sqrt(self.kappa2)
def calc_freq ( self ) : self . dk1 = 1. / self . L1 self . dk2 = 1. / self . L2 self . k2 = self . dk2 * np . append ( np . arange ( 0. , self . n2 / 2 ) , np . arange ( - self . n2 / 2 , 0. ) ) self . k1 = self . dk1 * np . arange ( 0. , self . n1 / 2 + 1 ) self . kk1 , self . kk2 = np . meshgrid ( self . k1 , self . k2 ) self . kk1 = np . fft . fftshift ( self . kk1 , axes = 0 ) self . kk2 = np . fft . fftshift ( self . kk2 , axes = 0 ) self . kappa2 = self . kk1 ** 2 + self . kk2 ** 2 self . kappa = np . sqrt ( self . kappa2 )
calculate array of spectral variable (frequency or
wavenumber) in cycles per unit of L
calculate array of spectral variable ( frequency or wavenumber ) in cycles per unit of L
""" calculate array of spectral variable (frequency or
                wavenumber) in cycles per unit of L """ # wavenumber one (equals to dk1 and dk2) # wavenumber grids
self