processing_library/fourier_transforms/fft_support.py
def extract_mid(a, npixel):
    """
    Extract a section from middle of a map

    Suitable for zero frequencies at npixel/2. This is the reverse
    operation to pad.

    .. note::
    
        Only the two innermost axes are transformed

    :param npixel: desired size of the section to extract
    :param a: grid from which to extract
    """
    ny, nx = a.shape[-2:]
    cx = nx // 2
    cy = ny // 2
    s = npixel // 2
    if npixel % 2 != 0:
        return a[..., cx - s:cx + s + 1, cy - s:cy + s + 1]
    else:
        return a[..., cx - s:cx + s, cy - s:cy + s]

    Extract a section from middle of a map

    Suitable for zero frequencies at npixel/2. This is the reverse
    operation to pad.

    .. note::
    
        Only the two innermost axes are transformed

    :param npixel: desired size of the section to extract
    :param a: grid from which to extract
    
Extract a section from middle of a map
Suitable for zero frequencies at npixel/2. This is the reverse
operation to pad.



Only the two innermost axes are transformed
Extract a section from middle of a map Suitable for zero frequencies at npixel / 2 . This is the reverse operation to pad . Only the two innermost axes are transformed
def extract_mid(a, npixel):
    ny, nx = a.shape[-2:]
    cx = nx // 2
    cy = ny // 2
    s = npixel // 2
    if npixel % 2 != 0:
        return a[..., cx - s:cx + s + 1, cy - s:cy + s + 1]
    else:
        return a[..., cx - s:cx + s, cy - s:cy + s]
def extract_mid ( a , npixel ) : ny , nx = a . shape [ - 2 : ] cx = nx // 2 cy = ny // 2 s = npixel // 2 if npixel % 2 != 0 : return a [ ... , cx - s : cx + s + 1 , cy - s : cy + s + 1 ] else : return a [ ... , cx - s : cx + s , cy - s : cy + s ]
Extract a section from middle of a map
Suitable for zero frequencies at npixel/2.
Extract a section from middle of a map Suitable for zero frequencies at npixel / 2 .
"""
    Extract a section from middle of a map

    Suitable for zero frequencies at npixel/2. This is the reverse
    operation to pad.

    .. note::
    
        Only the two innermost axes are transformed

    :param npixel: desired size of the section to extract
    :param a: grid from which to extract
    """
a
grid from which to extract
grid from which to extract
npixel
desired size of the section to extract
desired size of the section to extract