BGlib.be.translators.df_utils.be_utils.maxReadPixels¶
- BGlib.be.translators.df_utils.be_utils.maxReadPixels(max_memory, tot_pix, bins_per_step, bytes_per_bin=4)[source]¶
- Calculates the maximum number of pixels that can be loaded into the specified memory size. This is particularly useful when applying a (typically parallel) operation / processing on each pixel. Example - Fitting response to a model. - Parameters:
- max_memory (unsigned int) – Maximum memory (in bytes) that can be used. For example 4 GB would be = 4*((2**10)**3) bytes 
- tot_pix (unsigned int) – Total number of pixels in dataset 
- bins_per_step (unsigned int) – Number of bins that will be read (can be portion of each pixel) 
- bytes_per_bin ((Optional) unsigned int) – size of each bin - set to 4 bytes 
 
- Returns:
- max_pix – Maximum number of pixels that will be loaded 
- Return type:
- unsigned int