hispecdrp.primitives.spectral_extraction.extraction_utils
Functions
|
Computes the fractional overlap of pixels with the extraction window. |
- get_extraction_window(yc, window_size, n_pixels=-1)[source]
Computes the fractional overlap of pixels with the extraction window.
- Parameters:
yc (float) – Center of the extraction window (in pixel coordinates).
window_size (float) – Size of the extraction window (in pixels) centered in yc.
n_pixels (int, optional) – When
>= 0, clip candidate indices to[0, n_pixels - 1]so callers never receive out-of-bounds cross-dispersion indices (avoids Numba OOB segfaults when trace positions are extrapolated or non-finite).
- Returns:
idx (np.ndarray) – Indices of the pixels that might have overlap with the extraction window.
W (np.ndarray) – Fractional overlap of each pixel in idx with the extraction window.