def _dist(dims):
    dist_sum = []
    shape = np.ones(len(dims))
    for idx, d in enumerate(dims):
        vec = (np.arange(d) - d // 2) ** 2
        shape[idx] = -1
        vec = vec.reshape(*shape)
        shape[idx] = 1
        dist_sum.append(vec)

    return np.sqrt(np.sum(dist_sum, axis=0))
Create array with pixel value equals to the distance from array center.
dataset/ETHPy150Open scikit-beam/scikit-beam/skbeam/core/cdi.py/_dist