processing_components/image/gradients.py
def image_gradients(im: Image):
    """Calculate image gradients numerically
    
    Gradient units are (incoming unit)/pixel e.g. Jy/beam/pixel
    
    :param im: Image
    :return: Gradient images
    """
    assert isinstance(im, Image)
    nchan, npol, ny, nx = im.shape
    
    gradientx = create_empty_image_like(im)
    gradientx.data[..., :, 1:nx] = im.data[..., :, 1:nx] - im.data[..., :, 0:(nx - 1)]
    gradienty = create_empty_image_like(im)
    gradienty.data[..., 1:ny, :] = im.data[..., 1:ny, :] - im.data[..., 0:(ny - 1), :]
    
    return gradientx, gradienty
Calculate image gradients numerically
    
    Gradient units are (incoming unit)/pixel e.g. Jy/beam/pixel
    
    :param im: Image
    :return: Gradient images
    
Calculate image gradients numerically
Gradient units are (incoming unit)/pixel e.g. Jy/beam/pixel
Calculate image gradients numerically Gradient units are ( incoming unit ) / pixel e . g . Jy / beam / pixel
def image_gradients(im: Image):
    assert isinstance(im, Image)
    nchan, npol, ny, nx = im.shape
    gradientx = create_empty_image_like(im)
    gradientx.data[..., :, 1:nx] = im.data[..., :, 1:nx] - im.data[..., :, 0:(nx - 1)]
    gradienty = create_empty_image_like(im)
    gradienty.data[..., 1:ny, :] = im.data[..., 1:ny, :] - im.data[..., 0:(ny - 1), :]
    return gradientx, gradienty
def image_gradients ( im : Image ) : assert isinstance ( im , Image ) nchan , npol , ny , nx = im . shape gradientx = create_empty_image_like ( im ) gradientx . data [ ... , : , 1 : nx ] = im . data [ ... , : , 1 : nx ] - im . data [ ... , : , 0 : ( nx - 1 ) ] gradienty = create_empty_image_like ( im ) gradienty . data [ ... , 1 : ny , : ] = im . data [ ... , 1 : ny , : ] - im . data [ ... , 0 : ( ny - 1 ) , : ] return gradientx , gradienty
Calculate image gradients numerically
Gradient units are (incoming unit)/pixel e.g.
Calculate image gradients numerically Gradient units are ( incoming unit ) / pixel e . g .
"""Calculate image gradients numerically
    
    Gradient units are (incoming unit)/pixel e.g. Jy/beam/pixel
    
    :param im: Image
    :return: Gradient images
    """
None
im
Image
None