plot_fits_grid#

mufasa.visualization.spec_viz.plot_fits_grid(cube, para, model_func, x, y, xarr, ncomp, size=3, xsize=None, ysize=None, xlim=None, ylim=None, figsize=None, origin='lower', mod_all=True, savename=None, **kwargs)[source]#

Plot a grid of model fits from the cube centered at (x, y).

Parameters:
  • cube (SpectralCube) – The spectral cube to plot.

  • para (numpy.ndarray) – The parameter array for the model.

  • model_func (function) – The model function to use for the fit.

  • x (int) – X-coordinate of the central pixel.

  • y (int) – Y-coordinate of the central pixel.

  • xarr (SpectroscopicAxis) – The spectroscopic axis for the x-axis.

  • ncomp (int) – The number of components in the model.

  • size (int, optional) – Size of the grid (must be odd). Default is 3.

  • xsize (int, optional) – Number of columns in the grid. Default is size.

  • ysize (int, optional) – Number of rows in the grid. Default is size.

  • xlim (tuple, optional) – X-axis limits for the plot.

  • ylim (tuple, optional) – Y-axis limits for the plot.

  • figsize (tuple, optional) – Size of the figure.

  • origin ({'lower', 'upper'}, optional) – Origin of the grid. Default is ‘lower’.

  • mod_all (bool, optional) – Whether to plot all model components. Default is True.

  • savename (str, optional) – If provided, save the figure to the given filename.

  • **kwargs (dict) – Additional keyword arguments passed to plot_model.

Returns:

  • fig (matplotlib.figure.Figure) – The figure object.

  • axs (numpy.ndarray of matplotlib.axes.Axes) – The array of axes objects.