kalebswartz7/excercise_01/parse.py
def create_image(matrix, initial_data):
    """
    Creates 2D image based on data points in matrix
    Parameters
    ----------
    matrix : 2D array 
        array that contains data for image
    
    Notes
    -----
    
    """
    plt.figure(1)
    plt.subplot(211)
    im = plt.imshow(matrix, aspect=2,
                    extent=(
                        initial_data['horizontal']['initial_position']*1e6, initial_data['horizontal']['final_position']*1e6,
                        initial_data['vertical']['initial_position']*1e6, initial_data['vertical']['final_position']*1e6
                    ))
    # plt.colorbar(im, orientation='vertical')
    plt.xlabel('Horizontal Position [µm]')
    plt.ylabel('Vertical Position [µm]')
    plt.title(f'Photon energy: {initial_data["photon"]["final_energy"]} eV')
    plt.show()

    Creates 2D image based on data points in matrix
    Parameters
    ----------
    matrix : 2D array 
        array that contains data for image
    
    Notes
    -----
    
    
Creates 2D image based on data points in matrix
Parameters

matrix : 2D array
array that contains data for image

Notes
Creates 2D image based on data points in matrix Parameters matrix : 2D array array that contains data for image Notes
def create_image(matrix, initial_data):
    plt.figure(1)
    plt.subplot(211)
    im = plt.imshow(matrix, aspect=2,
                    extent=(
                        initial_data['horizontal']['initial_position']*1e6, initial_data['horizontal']['final_position']*1e6,
                        initial_data['vertical']['initial_position']*1e6, initial_data['vertical']['final_position']*1e6
                    ))
    plt.xlabel('Horizontal Position [µm]')
    plt.ylabel('Vertical Position [µm]')
    plt.title(f'Photon energy: {initial_data["photon"]["final_energy"]} eV')
    plt.show()
def create_image ( matrix , initial_data ) : plt . figure ( 1 ) plt . subplot ( 211 ) im = plt . imshow ( matrix , aspect = 2 , extent = ( initial_data [ 'horizontal' ] [ 'initial_position' ] * 1e6 , initial_data [ 'horizontal' ] [ 'final_position' ] * 1e6 , initial_data [ 'vertical' ] [ 'initial_position' ] * 1e6 , initial_data [ 'vertical' ] [ 'final_position' ] * 1e6 ) ) plt . xlabel ( 'Horizontal Position [µm]') plt . ylabel ( 'Vertical Position [µm]') plt . title ( f'Photon energy: {initial_data["photon"]["final_energy"]} eV' ) plt . show ( )
Creates 2D image based on data points in matrix
Parameters
Creates 2D image based on data points in matrix Parameters
"""
    Creates 2D image based on data points in matrix
    Parameters
    ----------
    matrix : 2D array 
        array that contains data for image
    
    Notes
    -----
    
    """ # plt.colorbar(im, orientation='vertical')
matrix
initial_data