def print_pixel_array_features(projections, num_pixels_x2, start_index, 
                               fov_horz_span, fov_vert_span, 
                               directory='log', world_name='', name='',
                               interp='nearest'):
    num_blocks = len(projections)
    for block_index in range(num_blocks):
        for feature_index in range(len(projections[block_index])):
            states_per_feature = 2 ** (block_index + 1)
            plt.close(99)
            feature_fig = plt.figure(num=99)
            projection_image_list = (visualize_pixel_array_feature(projections[
                    block_index][feature_index][
                    start_index:start_index + num_pixels_x2,:], fov_horz_span,
                    fov_vert_span, array_only=True)) 
            for state_index in range(states_per_feature): 
                left =  (float(state_index) / float(states_per_feature))
                bottom = 0.
                width =  1. /  float(states_per_feature)
                height =  1
                rect = (left, bottom, width, height)
                ax = feature_fig.add_axes(rect)
                plt.gray()
                ax.imshow(projection_image_list[state_index], 
                          interpolation=interp, vmin=0., vmax=1.)
            # create a plot of individual features
            filename = '_'.join(('block', str(block_index).zfill(2),
                                 'feature',str(feature_index).zfill(4),
                                 world_name, 'world', name, 'image.png'))
            full_filename = os.path.join(directory, filename)
            plt.title(filename)
            plt.savefig(full_filename, format='png')
Interpret an array of center-surround pixels as an image
dataset/ETHPy150Open matt2000/becca/worlds/world_tools.py/print_pixel_array_features