kinextract.grow_boolean_mask_A

kinextract.grow_boolean_mask_A(mask: ndarray, x: ndarray, grow_A: float) ndarray[source]

Dilate a boolean mask by approximately a fixed wavelength on each side.

Converts grow_A (in Angstroms) to a pixel count using the median pixel spacing of x, then calls grow_boolean_mask. This is the wavelength-aware counterpart of grow_boolean_mask, useful when the desired growth is naturally expressed in Angstroms (e.g. “grow the emission mask by 4 Å”) rather than in pixels.

Parameters:
  • mask (ndarray of bool) – Input mask where True means rejected/masked/excluded.

  • x (ndarray) – Wavelength array (Å) corresponding to mask, used only to estimate the pixel scale.

  • grow_A (float) – Approximate growth distance in Angstroms on each side. Values <= 0 return a copy of mask unchanged.

Returns:

Grown mask, same shape as mask.

Return type:

ndarray of bool