Plotter#

class mufasa.visualization.spec_viz.Plotter(ucube, fittype, ncomp_list=None, spec_unit='km/s', bunit=None)[source]#

Bases: object

plot_fit(x, y, ax=None, ncomp=None, **kwargs)[source]#

Plot a model fit for a spectrum at (x, y).

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

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

  • ax (matplotlib.axes.Axes, optional) – Axes object to plot on. If None, a new figure and axes are created.

  • ncomp (int) – The component number to plot.

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

plot_fits_grid(x, y, 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 centered at (x, y).

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

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

  • ncomp (int) – The component number to plot.

  • 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_fits_grid.

plot_spec(x, y, ax=None, xlab=None, ylab=None, **kwargs)[source]#

Plot a single spectrum at (x, y).

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

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

  • ax (matplotlib.axes.Axes, optional) – Axes object to plot on. If None, a new figure and axes are created.

  • xlab (str, optional) – X-axis label. Default is the LSR velocity label.

  • ylab (str, optional) – Y-axis label. Default is the main beam temperature label.

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

Returns:

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

  • ax (matplotlib.axes.Axes) – The axes object.

plot_spec_grid(x, y, size=3, xsize=None, ysize=None, xlim=None, ylim=None, figsize=None, **kwargs)[source]#

Plot a grid of spectra centered at (x, y).

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

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

  • 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, in their native units.

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

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

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