def read_data_products_bandpowers(exp='bicep1', root=""):

    if exp == 'bicep1':
        file_in="B1_3yr_likelihood_bandpowers_20131003.txt"
    elif exp == 'bicep2':
        file_in="B2_3yr_likelihood_bandpowers_20140314.txt"
    else:
        print 'exp must be "bicep1" or "bicep2" to load the proper files'

    print "### Reading fiducial, real, and noise bias bandpowers from file: %s"\
        %file_in

    values = list()
    try:
        fin = file(os.path.join(root, file_in), 'r')
    except IOerror:
        print "Error reading %s. Make sure it is in root directory" %file_in
    for line in fin:
        if "#" not in line:
            lst = line.split(' ')
            if len(lst) > 3:
                b = []
                for elem in lst:
                    if elem != '':
                        b.append( float( elem ) )
                values.append(b)

    bandpowers = []
    for i in range(3):
        c = list()
        for j in range(9):
            c.append(values[ i*27 + j * 3: i*27 + j * 3 + 3 ])
        bandpowers.append(c)

    return bandpowers


#####################################################################
# Loads the M_cc matrix
# for bicep1 see details as defined in Barkats et al section 9.1
dataset/ETHPy150Open baudren/montepython_public/montepython/likelihoods/bicep2/bicep_util.py/read_data_products_bandpowers/original