pymks/datasets/microstructure_generator.py
def generate(self):
        """
        Generates a microstructure of dimensions of self.size and grains
        with dimensions self.grain_size.

        Returns:
          periodic microstructure
        """
        if len(self.size) != len(self.grain_size):
            raise RuntimeError("Dimensions of size and grain_size are"
                               " not equal.")
        X = np.random.random((self.n_samples,) + self.size)
        gaussian = fourier_gaussian(np.ones(self.grain_size),
                                    np.ones(len(self.size)))
        filter_ = Filter(np.fft.fftn(gaussian)[None, ..., None])
        filter_.resize(self.size)
        X_blur = filter_.convolve(X[..., None])
        return self._assign_phases(X_blur).astype(int)

        Generates a microstructure of dimensions of self.size and grains
        with dimensions self.grain_size.

        Returns:
          periodic microstructure
        
Generates a microstructure of dimensions of self.size and grains
with dimensions self.grain_size.
Generates a microstructure of dimensions of self . size and grains with dimensions self . grain_size .
def generate(self):
        if len(self.size) != len(self.grain_size):
            raise RuntimeError("Dimensions of size and grain_size are"
                               " not equal.")
        X = np.random.random((self.n_samples,) + self.size)
        gaussian = fourier_gaussian(np.ones(self.grain_size),
                                    np.ones(len(self.size)))
        filter_ = Filter(np.fft.fftn(gaussian)[None, ..., None])
        filter_.resize(self.size)
        X_blur = filter_.convolve(X[..., None])
        return self._assign_phases(X_blur).astype(int)
def generate ( self ) : if len ( self . size ) != len ( self . grain_size ) : raise RuntimeError ( "Dimensions of size and grain_size are" " not equal." ) X = np . random . random ( ( self . n_samples , ) + self . size ) gaussian = fourier_gaussian ( np . ones ( self . grain_size ) , np . ones ( len ( self . size ) ) ) filter_ = Filter ( np . fft . fftn ( gaussian ) [ None , ... , None ] ) filter_ . resize ( self . size ) X_blur = filter_ . convolve ( X [ ... , None ] ) return self . _assign_phases ( X_blur ) . astype ( int )
Generates a microstructure of dimensions of self.size and grains
with dimensions self.grain_size.
Generates a microstructure of dimensions of self . size and grains with dimensions self . grain_size .
"""
        Generates a microstructure of dimensions of self.size and grains
        with dimensions self.grain_size.

        Returns:
          periodic microstructure
        """
None
self