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
        self.dk3 = 1./self.L3

        # wavenumber grids
        #self.k1 = self.dk1*np.append( np.arange(0.,self.n1/2), \
        #          np.arange(-self.n1/2+1,0.) )
        self.k1 = np.fft.fftfreq(self.n1, d=self.d1)
        self.k2 = np.fft.fftfreq(self.n2, d=self.d2)
        #self.k2 = self.dk2*np.append( np.arange(0.,self.n2/2), \
        #      np.arange(-self.n2/2,0.) )
        self.k3 = self.dk3*np.arange(0.,self.n3/2+1)

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

        self.kk1 = np.fft.fftshift(self.kk1,axes=0)
        self.kk2 = np.fft.fftshift(self.kk2,axes=0)
        self.kk3 = np.fft.fftshift(self.kk3,axes=0)

        self.kappa2 = self.kk1**2 + self.kk2**2 + self.kk3**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.dk3 = 1./self.L3
        self.k1 = np.fft.fftfreq(self.n1, d=self.d1)
        self.k2 = np.fft.fftfreq(self.n2, d=self.d2)
        self.k3 = self.dk3*np.arange(0.,self.n3/2+1)
        self.kk1,self.kk2,self.kk3 = np.meshgrid(self.k1,self.k2,self.k3)
        self.kk1 = np.fft.fftshift(self.kk1,axes=0)
        self.kk2 = np.fft.fftshift(self.kk2,axes=0)
        self.kk3 = np.fft.fftshift(self.kk3,axes=0)
        self.kappa2 = self.kk1**2 + self.kk2**2 + self.kk3**2
        self.kappa = np.sqrt(self.kappa2)
def calc_freq ( self ) : self . dk1 = 1. / self . L1 self . dk2 = 1. / self . L2 self . dk3 = 1. / self . L3 self . k1 = np . fft . fftfreq ( self . n1 , d = self . d1 ) self . k2 = np . fft . fftfreq ( self . n2 , d = self . d2 ) self . k3 = self . dk3 * np . arange ( 0. , self . n3 / 2 + 1 ) self . kk1 , self . kk2 , self . kk3 = np . meshgrid ( self . k1 , self . k2 , self . k3 ) self . kk1 = np . fft . fftshift ( self . kk1 , axes = 0 ) self . kk2 = np . fft . fftshift ( self . kk2 , axes = 0 ) self . kk3 = np . fft . fftshift ( self . kk3 , axes = 0 ) self . kappa2 = self . kk1 ** 2 + self . kk2 ** 2 + self . kk3 ** 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.k1 = self.dk1*np.append( np.arange(0.,self.n1/2), \ #          np.arange(-self.n1/2+1,0.) ) #self.k2 = self.dk2*np.append( np.arange(0.,self.n2/2), \ #      np.arange(-self.n2/2,0.) )
self