def array_xy_offsets(test_geo, test_xy):
    """Return upper left array coordinates of test_xy in test_geo

    Parameters
    ----------
    test_geo (): GDAL Geotransform used to calcululate the offset
    test_xy (): x/y coordinates in the same projection as test_geo
        passed as a list or tuple

    Returns
    -------
    x_offset: x coordinate of the upper left of the array
    y_offset: y coordinate of the uppler left of the array

    """
    x_offset = int((test_xy[0] - test_geo[0]) / test_geo[1])
    y_offset = int((test_xy[1] - test_geo[3]) / test_geo[5])
    return x_offset, y_offset
