pytrax/__RandomWalk__.py
def _fill_im_big(self, w_id=None, t_id=None, data='t'):
        r'''
        Fill up a copy of the big image with walker data.
        Move untrodden pore space to index -1 and solid to -2

        Parameters
        ----------
        w_id: array of int of max length num_walkers (default = None)
            the indices of the walkers to plot. If None then all are shown
        t_id: array of int of max_length num_timesteps/stride (default = None)
            the indices of the timesteps to plot. If None then all are shown
        data: string (options are 't' or 'w', other)
            t fills image with timestep, w fills image with walker index,
            any other value places a 1 signifiying that a walker is at this
            coordinate.
        '''
        offset = self._check_big_bounds()
        if not hasattr(self, 'im_big'):
            self.im_big = self._build_big_image(offset)
        big_im = self.im_big.copy().astype(int)
        big_im -= 2
        # Number of stored timesteps, walkers dimensions
        [nst, nsw, nd] = np.shape(self.real_coords)
        if w_id is None:
            w_id = np.arange(0, nsw, 1, dtype=int)
        else:
            w_id = np.array([w_id])
        if t_id is None:
            t_id = np.arange(0, nst, 1, dtype=int)
        else:
            t_id = np.array([t_id])
        indices = np.indices(np.shape(self.real_coords))
        coords = self.real_coords + offset*self.shape
        if data == 't':
            # Get timestep indices
            d = indices[0, :, w_id, 0].T
        elif data == 'w':
            # Get walker indices
            d = indices[1, :, w_id, 0].T
        else:
            # Fill with 1 where there is a walker
            d = np.ones_like(indices[0, :, w_id, 0].T, dtype=int)
        if self.dim == 3:
            big_im[coords[:, w_id, 0][t_id],
                   coords[:, w_id, 1][t_id],
                   coords[:, w_id, 2][t_id]] = d[t_id]
        else:
            big_im[coords[:, w_id, 0][t_id],
                   coords[:, w_id, 1][t_id]] = d[t_id]

        return big_im
r'''
        Fill up a copy of the big image with walker data.
        Move untrodden pore space to index -1 and solid to -2

        Parameters
        ----------
        w_id: array of int of max length num_walkers (default = None)
            the indices of the walkers to plot. If None then all are shown
        t_id: array of int of max_length num_timesteps/stride (default = None)
            the indices of the timesteps to plot. If None then all are shown
        data: string (options are 't' or 'w', other)
            t fills image with timestep, w fills image with walker index,
            any other value places a 1 signifiying that a walker is at this
            coordinate.
        
r'''
Fill up a copy of the big image with walker data.
Move untrodden pore space to index -1 and solid to -2

Parameters

array of int of max length num_walkers (default = None)
the indices of the walkers to plot. If None then all are shown
t_id: array of int of max_length num_timesteps/stride (default = None)
the indices of the timesteps to plot. If None then all are shown
data: string (options are 't' or 'w', other)
t fills image with timestep, w fills image with walker index,
any other value places a 1 signifiying that a walker is at this
coordinate.
r ' ' ' Fill up a copy of the big image with walker data . Move untrodden pore space to index - 1 and solid to - 2 Parameters array of int of max length num_walkers ( default = None ) the indices of the walkers to plot . If None then all are shown t_id : array of int of max_length num_timesteps / stride ( default = None ) the indices of the timesteps to plot . If None then all are shown data : string ( options are ' t ' or ' w ' other ) t fills image with timestep w fills image with walker index any other value places a 1 signifiying that a walker is at this coordinate .
def _fill_im_big(self, w_id=None, t_id=None, data='t'):
        offset = self._check_big_bounds()
        if not hasattr(self, 'im_big'):
            self.im_big = self._build_big_image(offset)
        big_im = self.im_big.copy().astype(int)
        big_im -= 2
        [nst, nsw, nd] = np.shape(self.real_coords)
        if w_id is None:
            w_id = np.arange(0, nsw, 1, dtype=int)
        else:
            w_id = np.array([w_id])
        if t_id is None:
            t_id = np.arange(0, nst, 1, dtype=int)
        else:
            t_id = np.array([t_id])
        indices = np.indices(np.shape(self.real_coords))
        coords = self.real_coords + offset*self.shape
        if data == 't':
            d = indices[0, :, w_id, 0].T
        elif data == 'w':
            d = indices[1, :, w_id, 0].T
        else:
            d = np.ones_like(indices[0, :, w_id, 0].T, dtype=int)
        if self.dim == 3:
            big_im[coords[:, w_id, 0][t_id],
                   coords[:, w_id, 1][t_id],
                   coords[:, w_id, 2][t_id]] = d[t_id]
        else:
            big_im[coords[:, w_id, 0][t_id],
                   coords[:, w_id, 1][t_id]] = d[t_id]
        return big_im
def _fill_im_big ( self , w_id = None , t_id = None , data = 't' ) : offset = self . _check_big_bounds ( ) if not hasattr ( self , 'im_big' ) : self . im_big = self . _build_big_image ( offset ) big_im = self . im_big . copy ( ) . astype ( int ) big_im -= 2 [ nst , nsw , nd ] = np . shape ( self . real_coords ) if w_id is None : w_id = np . arange ( 0 , nsw , 1 , dtype = int ) else : w_id = np . array ( [ w_id ] ) if t_id is None : t_id = np . arange ( 0 , nst , 1 , dtype = int ) else : t_id = np . array ( [ t_id ] ) indices = np . indices ( np . shape ( self . real_coords ) ) coords = self . real_coords + offset * self . shape if data == 't' : d = indices [ 0 , : , w_id , 0 ] . T elif data == 'w' : d = indices [ 1 , : , w_id , 0 ] . T else : d = np . ones_like ( indices [ 0 , : , w_id , 0 ] . T , dtype = int ) if self . dim == 3 : big_im [ coords [ : , w_id , 0 ] [ t_id ] , coords [ : , w_id , 1 ] [ t_id ] , coords [ : , w_id , 2 ] [ t_id ] ] = d [ t_id ] else : big_im [ coords [ : , w_id , 0 ] [ t_id ] , coords [ : , w_id , 1 ] [ t_id ] ] = d [ t_id ] return big_im
r'''
Fill up a copy of the big image with walker data.
r ' ' ' Fill up a copy of the big image with walker data .
r'''
        Fill up a copy of the big image with walker data.
        Move untrodden pore space to index -1 and solid to -2

        Parameters
        ----------
        w_id: array of int of max length num_walkers (default = None)
            the indices of the walkers to plot. If None then all are shown
        t_id: array of int of max_length num_timesteps/stride (default = None)
            the indices of the timesteps to plot. If None then all are shown
        data: string (options are 't' or 'w', other)
            t fills image with timestep, w fills image with walker index,
            any other value places a 1 signifiying that a walker is at this
            coordinate.
        ''' # Number of stored timesteps, walkers dimensions # Get timestep indices # Get walker indices # Fill with 1 where there is a walker
self
w_id
t_id
data