get_local_bad#

mufasa.master_fitter.get_local_bad(lnkmap, lnk_thresh=5, block_size=15, offset=0, bad_size_max=225)[source]#

Identify local pixels with significantly lower relative log-likelihood (lnk) values compared to their neighbors.

Parameters:
  • lnkmap (ndarray) – The relative log-likelihood map

  • lnk_thresh (float, optional) – Global threshold for the relative log-likelihood values. Only pixels with lnk values above this threshold are evaluated (default is 5).

  • block_size (int, optional) – Size of the local region (in pixels) used to compute the threshold for each pixel. Must be an odd number (default is 15).

  • offset (float, optional) – Constant subtracted from the computed local threshold to adjust sensitivity. Higher values make the threshold more lenient (default is 0).

  • bad_size_max (int, optional) – Maximum area (in pixels) for isolated regions of bad pixels. Larger regions remain unaffected (default is 225).

Returns:

mask – A boolean array of the same shape as lnkmap, where True indicates “bad” pixels.

Return type:

ndarray