replace_rss#

mufasa.master_fitter.replace_rss(ucube, ucube_ref, ncomp, mask)[source]#

Replace RSS-related maps in a UltraCube object for specific components.

This function updates the rss_maps, NSamp_maps, and AICc_maps of the input ucube object with the corresponding values from a reference ucube_ref object for a specified number of components. The updates are applied only to pixels indicated by the mask.

Parameters:
  • ucube (UltraCube) – The UltraCube object whose RSS-related maps will be updated.

  • ucube_ref (UltraCube) – The reference UltraCube object containing the updated RSS-related map values.

  • ncomp (int) – The number of components for which the RSS-related maps will be updated.

  • mask (numpy.ndarray) – A 2D boolean mask indicating the spatial pixels where the maps should be updated. Only True pixels in the mask are modified.

Notes

  • If an RSS-related map does not exist for the specified number of components (ncomp), the function logs a debug message and skips that update.

  • The function automatically recalculates the AICc map for the specified number of components using the updated data.

Examples

>>> replace_rss(ucube, ucube_ref, ncomp=2, mask=mask)
>>> # Updates the RSS-related maps of `ucube` for 2 components using values from `ucube_ref` at masked locations.