Skip to content

Preprocessing

megatop.pipeline.preprocesser.homemade_unbin_cell(binned_cell, nmt_bins)

Necessary to unbin cell that are complex numbers

Source code in src/megatop/pipeline/preprocesser.py
def homemade_unbin_cell(binned_cell, nmt_bins):
    """
    Necessary to unbin cell that are complex numbers
    """
    output_shape = np.array(binned_cell.shape)
    output_shape[-1] = nmt_bins.lmax + 1
    unbinned_cell = np.zeros(output_shape, dtype=np.complex128)
    for bin in range(binned_cell.shape[-1]):
        unbinned_cell[..., nmt_bins.get_ell_list(bin)] = binned_cell[..., bin]
    return unbinned_cell