UCubePlus#

class mufasa.UltraCube.UCubePlus(cubefile, cube=None, fittype=None, paraNameRoot=None, paraDir=None, **kwargs)[source]#

Bases: UltraCube

A subclass of UltraCube that includes directory management for parameter maps and model fits.

get_model_fit(ncomp, update=True, **kwargs)[source]#

Load the model fits if they exist, or perform fitting if they don’t.

Parameters:
  • ncomp (int or list of int) – Number of components for the model fit. If a list is provided, a fits will be performed for each component.

  • update (bool, optional) – Whether to update (i.e., re-fit) the cube even if model fits already exist (default is True).

  • **kwargs – Additional keyword arguments passed to pyspeckit.Cube.fiteach if the fitting needs to be updated.

Return type:

None

read_model_fit(ncomps, read_conv=False, **kwargs)[source]#

Load model fits if they exist; otherwise, perform the fitting.

Parameters:
  • ncomps (list of int) – List of the number of components to load or fit.

  • read_conv (bool, optional) – If True, attempts to read fits for convolved cubes as well. Default is False.

  • **kwargs (dict, optional) – Additional keyword arguments passed to the fitting methods.

Return type:

None

Notes

  • If fits files are not found, the fitting process is triggered, and results are saved to disk.

  • File paths for each component are stored in self.paraPaths.

Raises:

FileNotFoundError – If the specified fit files are not found and fitting cannot proceed.