def repack_blockheader(dic):
    """
    Repack blockheader dic bit flag parameters into status and mode.
    """
    dic['status'] = dic['S_DATA'] * 1 + dic['S_SPEC'] * 2 + dic['S_32'
        ] * 4 + dic['S_FLOAT'] * 8 + dic['S_COMPLEX'] * 16 + dic[
        'S_HYPERCOMPLEX'] * 32 + dic['MORE_BLOCKS'] * 128 + dic['NP_CMPLX'
        ] * 256 + dic['NF_CMPLX'] * 512 + dic['NI_CMPLX'] * 1024 + dic[
        'NI2_CMPLX'] * 2048
    dic['mode'] = dic['NP_PHMODE'] * 1 + dic['NP_AVMODE'] * 2 + dic[
        'NP_PWRMODE'] * 4 + dic['NF_PHMODE'] * 16 + dic['NF_AVMODE'
        ] * 32 + dic['NF_PWRMODE'] * 64 + dic['NI_PHMODE'] * 256 + dic[
        'NI_AVMODE'] * 512 + dic['NI_PWRMODE'] * 1024 + dic['NI2_PHMODE'
        ] * 4096 + dic['NI2_AVMODE'] * 8192 + dic['NI2_PWRMODE'] * 16384
    return dic
