def pi_modulus(recon_pattern,
               diffracted_pattern,
               offset_v=1e-12):
    diff_tmp = np.fft.fftn(recon_pattern) / np.sqrt(np.size(recon_pattern))
    index = diffracted_pattern > 0
    diff_tmp[index] = (diffracted_pattern[index] *
                       diff_tmp[index] / (np.abs(diff_tmp[index]) + offset_v))
    return np.fft.ifftn(diff_tmp) * np.sqrt(np.size(diffracted_pattern))
Handle the column selection being changed.
dataset/ETHPy150Open scikit-beam/scikit-beam/skbeam/core/cdi.py/pi_modulus--crossover with--dataset/ETHPy150Open enthought/traitsui/traitsui/qt4/table_editor.py/TableEditor._on_column_selection