tsadar.utils.plotting.lineout_plot#
Functions
|
Plots lineouts of data and their fits, along with residuals, and saves the figure to a file. |
- tsadar.utils.plotting.lineout_plot.lineout_plot(data, fits, sqdev, yaxis, ylim, s_ind, e_ind, titlestr, include_uncert, filename, td, tag)Source#
Plots lineouts of data and their fits, along with residuals, and saves the figure to a file. :param data: List containing data arrays to plot. The list can have one or 2 elements being the electron and ion data. :type data: list of np.ndarray :param fits: List containing fit arrays corresponding to the data. Must be the same shape as data. :type fits: list of np.ndarray :param sqdev: List containing squared deviation (residual) arrays. Must be the same shape as data. :type sqdev: list of np.ndarray :param yaxis: List containing y-axis (e.g., wavelength) arrays for each plot. :type yaxis: list of np.ndarray :param ylim: Tuple specifying the y-axis limits for the data plots. :type ylim: tuple :param s_ind: List of start indices to start the plotting, based of the wavelength set in the default deck. :type s_ind: list of int :param e_ind: List of end to end the plotting, based of the wavelength set in the default deck :type e_ind: list of int :param titlestr: Title string for the plots. :type titlestr: str :param filename: Name of the file to save the figure as. :type filename: str :param td: Directory path where the figure will be saved. :type td: str :param tag: String denoting which lineouts are being plotted, the “best” or “worst” :type tag: str
- Returns:
None – The function saves the plots to a file in the specified directory.
Notes
The function creates a 2-row subplot where the first row contains the data and fit plots, and the second row contains the residuals.
The function uses matplotlib for plotting and saves the figure to a specified directory.
The function handles both electron and ion data if provided.