replace_para#
- mufasa.master_fitter.replace_para(pcube, pcube_ref, mask, multicore=None)[source]#
Replace parameter values in a parameter cube with those from a reference cube for specific pixels.
This function updates the parcube, errcube, and has_fit attributes of the input pcube based on a mask, using the corresponding values from the reference cube (pcube_ref).
- Parameters:
pcube (pyspeckit.cube.ParCube) – The parameter cube to be updated. This cube contains the current fitted parameters and their errors.
pcube_ref (pyspeckit.cube.ParCube) – The reference parameter cube containing the values to replace in pcube.
mask (numpy.ndarray) – A boolean 2D array indicating the spatial pixels to update. Pixels with True in the mask will be updated.
multicore (int or None, optional) – Number of cores to use for parallel computation. Defaults to None, in which case a single core is used.
- Return type:
None
Notes
Updates the following attributes of pcube: - parcube (fitted parameters) - errcube (parameter errors) - has_fit (boolean map indicating successful fits)
Also updates the _modelcube attribute of pcube with the corresponding model values from pcube_ref.
If multicore is specified, it controls the parallelism when computing the model cube from pcube_ref.
Examples
>>> replace_para(pcube, pcube_ref, mask, multicore=4) >>> # Updates `pcube` with values from `pcube_ref` for pixels specified by `mask`.