run/simple_data_use_ex.py
def plot_td_sinogram(td_data, ini_t=0, fin_t=6e-9, title='', save_fig=False,
                     save_str='', transparent=False, dpi=300, cmap='inferno'):
    """Plots a time-domain sinogram

     Displays a sinogram in the time domain (transferred to the time domain
     via the ICZT).

     Parameters
     ----------
     td_data : array_like
         S-parameters in the time domain
     ini_t : float
         The initial time-point in the time-domain, in seconds
     fin_t : float
         The final time-point in the time-domain, in seconds
     title : str
         The title used for displaying the data
     save_fig : bool
         If true, will save the figure to a .png file - default is False
     save_str : str
         The title of the .png file to be saved if save_image is true -
         default is empty str, triggering the save_string to be set to
         the title
     transparent : bool
        If True, will save the figure with transparent=True, else will
        save with default white background
     dpi : int
         The DPI to use if saving the figure
     cmap : str
         The colormap that will be used to display the sinogram
     """

    td_data = np.abs(td_data)  # Take the abs-value of the complex vals

    n_time_pts = np.size(td_data, axis=0)  # Find number of time-pts

    # Find the vector of temporal points in the time domain used in the
    # scan
    scan_times = np.linspace(ini_t, fin_t, n_time_pts)

    # Declare the extent for the plot, along x-axis from antenna
    # position 1 to N, with N being the number of antenna positions used
    # in the scan, along y-axis from user specified points in
    # time-domain
    plot_extent = [1, 360, scan_times[-1] * 1e9, scan_times[0] * 1e9]

    # Determine the aspect ratio for the plot to make it have equal axes
    plot_aspect_ratio = 360 / (scan_times[-1] * 1e9)

    # Make the figure for displaying the reconstruction
    plt.figure()

    # Declare the default font for our figure to be Times New Roman
    plt.rc('font', family='Times New Roman')

    # Plot the sinogram
    plt.imshow(td_data, cmap=cmap, extent=plot_extent,
               aspect=plot_aspect_ratio)

    # Set the size for the x,y ticks and set which ticks to display
    plt.tick_params(labelsize=14)
    scan_times *= 1e9
    plt.gca().set_yticks([round(ii, 2)
                          for ii in scan_times[::n_time_pts // 8]])
    plt.gca().set_xticks([round(ii)
                          for ii in np.linspace(0, 360, 360)[::75]])

    # Create the colorbar and set the colorbar tick size, also set
    # the format specifier to be as entered by user - default is '%.3f'
    plt.colorbar(format='%.3f').ax.tick_params(labelsize=14)

    # Label the plot axes and assign the plot a title
    plt.title(title, fontsize=20)
    plt.xlabel('Rotational Position (' + r'$^\circ$' + ')', fontsize=16)
    plt.ylabel('Time of Response (ns)', fontsize=16)
    plt.tight_layout()

    # If the user set save_data to True, and therefore wanted to save
    # the figure as a png file
    if save_fig:

        # If the user did not specify a save string, then set the
        # save string to be the title string, without spaces
        if not save_str:
            # Define a string for saving the figure, replace any spaces
            # in the title with underscores
            save_str = title.replace(' ', '_') + '.png'

        # If the user did specify a save string, then add '.png' file
        # extension to it for saving purposes
        else:
            save_str += '.png'

        # Save the figure to a png file
        plt.savefig(save_str, transparent=transparent, dpi=dpi)

    else:  # If not saving the figure, then show the figure
        plt.show()
Plots a time-domain sinogram

     Displays a sinogram in the time domain (transferred to the time domain
     via the ICZT).

     Parameters
     ----------
     td_data : array_like
         S-parameters in the time domain
     ini_t : float
         The initial time-point in the time-domain, in seconds
     fin_t : float
         The final time-point in the time-domain, in seconds
     title : str
         The title used for displaying the data
     save_fig : bool
         If true, will save the figure to a .png file - default is False
     save_str : str
         The title of the .png file to be saved if save_image is true -
         default is empty str, triggering the save_string to be set to
         the title
     transparent : bool
        If True, will save the figure with transparent=True, else will
        save with default white background
     dpi : int
         The DPI to use if saving the figure
     cmap : str
         The colormap that will be used to display the sinogram
     
Plots a time-domain sinogram
Displays a sinogram in the time domain (transferred to the time domain
via the ICZT).
Plots a time - domain sinogram Displays a sinogram in the time domain ( transferred to the time domain via the ICZT ) .
def plot_td_sinogram(td_data, ini_t=0, fin_t=6e-9, title='', save_fig=False,
                     save_str='', transparent=False, dpi=300, cmap='inferno'):
    td_data = np.abs(td_data)  
    n_time_pts = np.size(td_data, axis=0)  
    scan_times = np.linspace(ini_t, fin_t, n_time_pts)
    plot_extent = [1, 360, scan_times[-1] * 1e9, scan_times[0] * 1e9]
    plot_aspect_ratio = 360 / (scan_times[-1] * 1e9)
    plt.figure()
    plt.rc('font', family='Times New Roman')
    plt.imshow(td_data, cmap=cmap, extent=plot_extent,
               aspect=plot_aspect_ratio)
    plt.tick_params(labelsize=14)
    scan_times *= 1e9
    plt.gca().set_yticks([round(ii, 2)
                          for ii in scan_times[::n_time_pts // 8]])
    plt.gca().set_xticks([round(ii)
                          for ii in np.linspace(0, 360, 360)[::75]])
    plt.colorbar(format='%.3f').ax.tick_params(labelsize=14)
    plt.title(title, fontsize=20)
    plt.xlabel('Rotational Position (' + r'$^\circ$' + ')', fontsize=16)
    plt.ylabel('Time of Response (ns)', fontsize=16)
    plt.tight_layout()
    if save_fig:
        if not save_str:
            save_str = title.replace(' ', '_') + '.png'
        else:
            save_str += '.png'
        plt.savefig(save_str, transparent=transparent, dpi=dpi)
    else:  
        plt.show()
def plot_td_sinogram ( td_data , ini_t = 0 , fin_t = 6e-9 , title = '' , save_fig = False , save_str = '' , transparent = False , dpi = 300 , cmap = 'inferno' ) : td_data = np . abs ( td_data ) n_time_pts = np . size ( td_data , axis = 0 ) scan_times = np . linspace ( ini_t , fin_t , n_time_pts ) plot_extent = [ 1 , 360 , scan_times [ - 1 ] * 1e9 , scan_times [ 0 ] * 1e9 ] plot_aspect_ratio = 360 / ( scan_times [ - 1 ] * 1e9 ) plt . figure ( ) plt . rc ( 'font' , family = 'Times New Roman' ) plt . imshow ( td_data , cmap = cmap , extent = plot_extent , aspect = plot_aspect_ratio ) plt . tick_params ( labelsize = 14 ) scan_times *= 1e9 plt . gca ( ) . set_yticks ( [ round ( ii , 2 ) for ii in scan_times [ : : n_time_pts // 8 ] ] ) plt . gca ( ) . set_xticks ( [ round ( ii ) for ii in np . linspace ( 0 , 360 , 360 ) [ : : 75 ] ] ) plt . colorbar ( format = '%.3f' ) . ax . tick_params ( labelsize = 14 ) plt . title ( title , fontsize = 20 ) plt . xlabel ( 'Rotational Position (' + r'$^\circ$' + ')' , fontsize = 16 ) plt . ylabel ( 'Time of Response (ns)' , fontsize = 16 ) plt . tight_layout ( ) if save_fig : if not save_str : save_str = title . replace ( ' ' , '_' ) + '.png' else : save_str += '.png' plt . savefig ( save_str , transparent = transparent , dpi = dpi ) else : plt . show ( )
Plots a time-domain sinogram
Displays a sinogram in the time domain (transferred to the time domain
via the ICZT).
Plots a time - domain sinogram Displays a sinogram in the time domain ( transferred to the time domain via the ICZT ) .
"""Plots a time-domain sinogram

     Displays a sinogram in the time domain (transferred to the time domain
     via the ICZT).

     Parameters
     ----------
     td_data : array_like
         S-parameters in the time domain
     ini_t : float
         The initial time-point in the time-domain, in seconds
     fin_t : float
         The final time-point in the time-domain, in seconds
     title : str
         The title used for displaying the data
     save_fig : bool
         If true, will save the figure to a .png file - default is False
     save_str : str
         The title of the .png file to be saved if save_image is true -
         default is empty str, triggering the save_string to be set to
         the title
     transparent : bool
        If True, will save the figure with transparent=True, else will
        save with default white background
     dpi : int
         The DPI to use if saving the figure
     cmap : str
         The colormap that will be used to display the sinogram
     """ # Take the abs-value of the complex vals
 # Find number of time-pts
 # Find the vector of temporal points in the time domain used in the
 # scan
 # Declare the extent for the plot, along x-axis from antenna
 # position 1 to N, with N being the number of antenna positions used
 # in the scan, along y-axis from user specified points in
 # time-domain
 # Determine the aspect ratio for the plot to make it have equal axes
 # Make the figure for displaying the reconstruction
 # Declare the default font for our figure to be Times New Roman
 # Plot the sinogram
 # Set the size for the x,y ticks and set which ticks to display
 # Create the colorbar and set the colorbar tick size, also set
 # the format specifier to be as entered by user - default is '%.3f'
 # Label the plot axes and assign the plot a title
 # If the user set save_data to True, and therefore wanted to save
 # the figure as a png file
 # If the user did not specify a save string, then set the
 # save string to be the title string, without spaces
 # Define a string for saving the figure, replace any spaces
 # in the title with underscores
 # If the user did specify a save string, then add '.png' file
 # extension to it for saving purposes
 # Save the figure to a png file
 # If not saving the figure, then show the figure

td_data
S-parameters in the time domain
S - parameters in the time domain
ini_t
The initial time-point in the time-domain, in seconds
The initial time - point in the time - domain in seconds
fin_t
The final time-point in the time-domain, in seconds
The final time - point in the time - domain in seconds
title
The title used for displaying the data
The title used for displaying the data
save_fig
If true, will save the figure to a .png file - default is False
If true will save the figure to a . png file - default is False
False
save_str
The title of the .png file to be saved if save_image is true
default is empty str, triggering the save_string to be set to
the title
The title of the . png file to be saved if save_image is true default is empty str triggering the save_string to be set to the title
empty
transparent
If True, will save the figure with transparent=True, else will
save with default white background
If True will save the figure with transparent = True else will save with default white background
white
dpi
The DPI to use if saving the figure
The DPI to use if saving the figure
cmap
The colormap that will be used to display the sinogram
The colormap that will be used to display the sinogram