replace_bad_pix#

mufasa.master_fitter.replace_bad_pix(ucube, mask, snr_min, guesses, ncomp=2, lnk21=None, simpfit=True, multicore=True, return_good_mask=False)[source]#

Refit pixels marked by the mask as “bad” and adopt the new model if it is determined to be better.

Parameters:
  • ucube (UltraCube object) – The UltraCube object containing the spectral data to be refitted.

  • mask (ndarray) – A boolean mask indicating the pixels to be refitted.

  • snr_min (float) – Minimum signal-to-noise ratio required for refitting.

  • guesses (ndarray) – Initial guesses for the refitting process.

  • lnk21 (None, optional) – Deprecated. This argument is retained for backward compatibility but will be removed in a future update.

  • simpfit (bool, optional) – If True, use simplified fitting (default is True).

  • multicore (bool or int, optional) – Number of CPU cores to use for parallel processing (default is True, which uses all available CPUs minus 1). If an integer is provided, it specifies the number of CPU cores to use.

  • return_good_mask (bool) – If True, return the number of pixels with good fits

Return type:

None