def ij2xy(i, j, gt, origin='ul'):
    """
    Transforms global/world system coordinates to pixel coordinates/indexes.

    Parameters
    ----------
    i : int
        Column number in pixels.
    j : int
        Row number in pixels.
    gt : dict
        Geo-transformation parameters/dictionary.
    origin: str, optional
        Defines the world system origin of the pixel. It can be:
            - upper left ("ul")
            - upper right ("ur", default)
            - lower right ("lr")
            - lower left ("ll")
            - center ("c")

    Returns
    -------
    x : float
        World system coordinate in X direction.
    y : float
        World system coordinate in Y direction.
    """
    px_shift_map = {'ul': (0, 0), 'ur': (1, 0), 'lr': (1, 1), 'll': (0, 1),
        'c': (0.5, 0.5)}
    if origin in px_shift_map.keys():
        px_shift = px_shift_map[origin]
    else:
        user_wrng = (
            "Pixel origin '{}' unknown. Upper left origin 'ul' will be taken instead"
            .format(origin))
        raise Warning(user_wrng)
        px_shift = 0, 0
    i += px_shift[0]
    j += px_shift[1]
    x = gt[0] + i * gt[1] + j * gt[2]
    y = gt[3] + i * gt[4] + j * gt[5]
    return x, y
