def data_for_idx(face_idx, dem, grid, data):
    """get data for cell with face_idx face_idx"""
    face = grid['face_coordinates'][face_idx]
    affine = dem['affine']
    idx = (face - (affine.xoff, affine.yoff)) / (affine.a, affine.e)
    i_min, i_max = int(idx[:, (0)].min()), int(idx[:, (0)].max())
    j_min, j_max = int(idx[:, (1)].min()), int(idx[:, (1)].max())
    dem_i = dem['band'][j_min:j_max, i_min:i_max]
    vol_i = data['vol1'][face_idx]
    data = dict(face=face, dem=dem_i, vol=vol_i)
    return data
