예제 #1
0
# Parse command line
parser = argparse.ArgumentParser(description='Do a thing.')
required_args = parser.add_argument_group('Required arguments')
required_args.add_argument("-i",
                           "--input",
                           type=str,
                           help="Input root",
                           required=True)
required_args.add_argument("-o",
                           "--output",
                           type=str,
                           help="Output root",
                           required=True)
args = parser.parse_args()

out_name = pyfisher.prepare_output(
    args, "save_cmb_fisher.py Planck CMB Fishers run")

param_file = f'./params.txt'
_, fids = pyfisher.get_param_info(param_file, exclude=None)

param_list = list(fids.keys())
F1 = pyfisher.get_planck_cmb_fisher(param_list,
                                    np.arange(2, 31), ['TT'],
                                    args.input,
                                    fsky=1)
F2 = pyfisher.get_planck_cmb_fisher(param_list,
                                    np.arange(30, 2501), ['TT', 'EE', 'TE'],
                                    args.input,
                                    fsky=1)

pyfisher.write_fisher(f'{out_name}_planck_low_ell_TT_fullsky.txt',
예제 #2
0
                    default='tau,r',
                    help="Relative path to directory with experiment info.")
required_args = parser.add_argument_group('Required arguments')
required_args.add_argument("-o",
                           "--output",
                           type=str,
                           help="Output root",
                           required=True)
required_args.add_argument("-p",
                           "--param-file",
                           type=str,
                           help="Parameter file",
                           required=True)
args = parser.parse_args()

out_name = pyfisher.prepare_output(args, "save_cmb.py CMB derivatives run")

lens_exclude = args.exclude_in_lensing.split(',')
shutil.copyfile(args.param_file, args.output + "/params.txt")
jobs, fids = pyfisher.get_param_info(args.param_file, exclude=None)
njobs = len(jobs)
comm, rank, my_tasks = mpi.distribute(njobs)

for task in my_tasks:
    param, val, ptype = jobs[task]
    print(param, val, ptype)
    pparams = dict(fids)
    if param is None:
        assert val is None
        assert ptype == 'f'
    else:
예제 #3
0
                           "--output",
                           type=str,
                           help="Output root",
                           required=True)
required_args.add_argument("-p",
                           "--param-file",
                           type=str,
                           help="Parameter file",
                           required=True)
parser.add_argument("--exclude",
                    type=str,
                    default='tau,r',
                    help="Relative path to directory with experiment info.")
args = parser.parse_args()

output_root = pyfisher.prepare_output(args, "save_s8_derivs.py s8 deriv run")
exclude = args.exclude.split(',')
jobs, fids = pyfisher.get_param_info(args.param_file, exclude, get_range=True)
shutil.copyfile(args.param_file, args.output + "/params.txt")
njobs = len(jobs)
comm, rank, my_tasks = mpi.distribute(njobs)

for task in my_tasks:
    param, pmin, pmax = jobs[task]
    print(param, pmin, pmax)

    vals = np.linspace(pmin, pmax, args.nsteps)
    s8s = []
    pl = io.Plotter(xyscale='linlin',
                    xlabel=pyfisher.latex_mapping[param],
                    ylabel=pyfisher.latex_mapping['s8'])
예제 #4
0
                    default='As,ns,tau,r',
                    help="Relative path to directory with experiment info.")
required_args = parser.add_argument_group('Required arguments')
required_args.add_argument("-o",
                           "--output",
                           type=str,
                           help="Output root",
                           required=True)
required_args.add_argument("-p",
                           "--param-file",
                           type=str,
                           help="Parameter file",
                           required=True)
args = parser.parse_args()

output_root = pyfisher.prepare_output(args,
                                      "save_bao.py BAO Fisher Matrix run")

exclude = args.exclude.split(',')
zs, sig_pers = pyfisher.load_bao_experiment_rs_dV_diagonal(
    args.exp_name, args.input_path, boss_include=args.boss_include.split(','))
jobs, fids = pyfisher.get_param_info(args.param_file, exclude)
shutil.copyfile(args.param_file, args.output + "/params.txt")
njobs = len(jobs)
comm, rank, my_tasks = mpi.distribute(njobs)

for task in my_tasks:
    param, val, ptype = jobs[task]
    print(param, val, ptype)
    pparams = dict(fids)
    if param is None:
        assert val is None