Esempio n. 1
0
def binning3d(tod, factors):
    shape = tod.shape
    if len(shape) is not 3:
        raise ValueError('Expected 3d shape')
    B0 = lo.binning(shape, factor=factors[0], axis=0, dtype=np.float64)
    shape1 = np.asarray(copy(shape))
    shape1[0] /= factors[0]
    B1 = lo.binning(shape1, factor=factors[1], axis=1, dtype=np.float64)
    shape2 = np.asarray(copy(shape1))
    shape2[1] /= factors[1]
    B2 = lo.binning(shape2, factor=factors[2], axis=2, dtype=np.float64)
    return B2 * B1 * B0
Esempio n. 2
0
def binning3d(tod, factors):
    shape = tod.shape
    if len(shape) is not 3:
        raise ValueError('Expected 3d shape')
    B0 = lo.binning(shape, factor=factors[0], axis=0, dtype=np.float64)
    shape1 = np.asarray(copy(shape))
    shape1[0] /= factors[0]
    B1 = lo.binning(shape1, factor=factors[1], axis=1, dtype=np.float64)
    shape2 = np.asarray(copy(shape1))
    shape2[1] /= factors[1]
    B2 = lo.binning(shape2, factor=factors[2], axis=2, dtype=np.float64)
    return B2 * B1 * B0
Esempio n. 3
0
def averaging(tod, factor, dtype=np.float64):
    """Averaging compression mode"""
    shape = tod.shape
    nsamples = tod.nsamples
    shapes = [(tod.shape[0], n) for n in nsamples]
    Bs = [lo.binning(s, factor=factor, axis=1, dtype=dtype) for s in shapes]
    B = lo.block_diagonal(Bs)
    S = lo.ndhomothetic(shape, 1. / factor, dtype=dtype)
    return B * S
Esempio n. 4
0
def averaging(tod, factor, dtype=np.float64):
    """Averaging compression mode"""
    shape = tod.shape
    nsamples = tod.nsamples
    shapes = [(tod.shape[0], n) for n in nsamples]
    Bs = [lo.binning(s, factor=factor, axis=1, dtype=dtype) for s in shapes]
    B = lo.block_diagonal(Bs)
    S = lo.ndhomothetic(shape, 1. / factor, dtype=dtype)
    return B * S