pytrax/__RandomWalk__.py
def plot_walk_2d(self, w_id=None, data='t', check_solid=False):
        r'''
        Plot the walker paths in a big image that shows real and reflected
        domains. The starts are temporarily shifted and then put back

        Parameters
        ----------
        w_id: array of int and any length (default = None)
            the indices of the walkers to plot. If None then all are shown
        data: string (options are 't' or 'w')
            t fills image with timestep, w fills image with walker index

        '''
        if self.dim == 3:
            print('Method is not implemented for 3d images')
            print('Please use export for visualizing 3d walks in paraview')
        else:
            offset = self._check_big_bounds()
            if not hasattr(self, 'im_big'):
                self.im_big = self._build_big_image(offset)
            sb = np.sum(self.im_big == self.solid_value)
            big_im = self._fill_im_big(w_id=w_id, data=data).astype(int)
            sa = np.sum(big_im == self.solid_value - 2)
            fig, ax = plt.subplots(figsize=[6, 6])
            ax.set(aspect=1)
            solid = big_im == self.solid_value-2
            solid = solid.astype(float)
            solid[np.where(solid == 0)] = np.nan
            porous = big_im == self.solid_value-1
            porous = porous.astype(float)
            porous[np.where(porous == 0)] = np.nan
            plt.imshow(big_im, cmap=cmap)
#             Make Solid Black
            plt.imshow(solid, cmap='binary', vmin=0, vmax=1)
#             Make Untouched Porous White
            plt.imshow(porous, cmap='gist_gray', vmin=0, vmax=1)
            if check_solid:
                print('Solid pixel match?', sb == sa, sb, sa)
r'''
        Plot the walker paths in a big image that shows real and reflected
        domains. The starts are temporarily shifted and then put back

        Parameters
        ----------
        w_id: array of int and any length (default = None)
            the indices of the walkers to plot. If None then all are shown
        data: string (options are 't' or 'w')
            t fills image with timestep, w fills image with walker index

        
r'''
Plot the walker paths in a big image that shows real and reflected
domains. The starts are temporarily shifted and then put back

Parameters

array of int and any length (default = None)
the indices of the walkers to plot. If None then all are shown
data: string (options are 't' or 'w')
t fills image with timestep, w fills image with walker index
r ' ' ' Plot the walker paths in a big image that shows real and reflected domains . The starts are temporarily shifted and then put back Parameters array of int and any length ( default = None ) the indices of the walkers to plot . If None then all are shown data : string ( options are ' t ' or ' w ' ) t fills image with timestep w fills image with walker index
def plot_walk_2d(self, w_id=None, data='t', check_solid=False):
        if self.dim == 3:
            print('Method is not implemented for 3d images')
            print('Please use export for visualizing 3d walks in paraview')
        else:
            offset = self._check_big_bounds()
            if not hasattr(self, 'im_big'):
                self.im_big = self._build_big_image(offset)
            sb = np.sum(self.im_big == self.solid_value)
            big_im = self._fill_im_big(w_id=w_id, data=data).astype(int)
            sa = np.sum(big_im == self.solid_value - 2)
            fig, ax = plt.subplots(figsize=[6, 6])
            ax.set(aspect=1)
            solid = big_im == self.solid_value-2
            solid = solid.astype(float)
            solid[np.where(solid == 0)] = np.nan
            porous = big_im == self.solid_value-1
            porous = porous.astype(float)
            porous[np.where(porous == 0)] = np.nan
            plt.imshow(big_im, cmap=cmap)
            plt.imshow(solid, cmap='binary', vmin=0, vmax=1)
            plt.imshow(porous, cmap='gist_gray', vmin=0, vmax=1)
            if check_solid:
                print('Solid pixel match?', sb == sa, sb, sa)
def plot_walk_2d ( self , w_id = None , data = 't' , check_solid = False ) : if self . dim == 3 : print ( 'Method is not implemented for 3d images' ) print ( 'Please use export for visualizing 3d walks in paraview' ) else : offset = self . _check_big_bounds ( ) if not hasattr ( self , 'im_big' ) : self . im_big = self . _build_big_image ( offset ) sb = np . sum ( self . im_big == self . solid_value ) big_im = self . _fill_im_big ( w_id = w_id , data = data ) . astype ( int ) sa = np . sum ( big_im == self . solid_value - 2 ) fig , ax = plt . subplots ( figsize = [ 6 , 6 ] ) ax . set ( aspect = 1 ) solid = big_im == self . solid_value - 2 solid = solid . astype ( float ) solid [ np . where ( solid == 0 ) ] = np . nan porous = big_im == self . solid_value - 1 porous = porous . astype ( float ) porous [ np . where ( porous == 0 ) ] = np . nan plt . imshow ( big_im , cmap = cmap ) plt . imshow ( solid , cmap = 'binary' , vmin = 0 , vmax = 1 ) plt . imshow ( porous , cmap = 'gist_gray' , vmin = 0 , vmax = 1 ) if check_solid : print ( 'Solid pixel match?' , sb == sa , sb , sa )
r'''
Plot the walker paths in a big image that shows real and reflected
domains.
r ' ' ' Plot the walker paths in a big image that shows real and reflected domains .
r'''
        Plot the walker paths in a big image that shows real and reflected
        domains. The starts are temporarily shifted and then put back

        Parameters
        ----------
        w_id: array of int and any length (default = None)
            the indices of the walkers to plot. If None then all are shown
        data: string (options are 't' or 'w')
            t fills image with timestep, w fills image with walker index

        ''' #             Make Solid Black #             Make Untouched Porous White
self
w_id
data
check_solid