def METHOD_NAME(obj):
    sdims = spatial_dims(obj, relaxed=True)
    if sdims is None:
        return None, None
    yy, xx = (obj[dim] for dim in sdims)
    fallback_res = (coord.attrs.get('resolution', None) for coord in (xx, yy))
    return affine_from_axis(xx.values, yy.values, fallback_res), sdims