def unroll_chans(data):
    """Unroll the spw and channel dims into a single frequency axis.
    Assumes incoming dimensions are (bl, spw, bin, chan, pol)"""
    data = data.transpose((0, 2, 1, 3, 4))
    data = data.reshape((data.shape[0], data.shape[1], data.shape[2] * data
        .shape[3], data.shape[4]))
    return data
