コード例 #1
0
pol = args.do_pol
if pol: raise NotImplementedError

shape_sim, wcs_sim, shape_dat, wcs_dat = aio.enmaps_from_config(
    Config, sim_section, analysis_section, pol=pol)
if rank == 0:
    print(("Dat shape : ", shape_dat))
    print(("Sim shape : ", shape_sim))
analysis_resolution = np.min(
    enmap.extent(shape_dat, wcs_dat) / shape_dat[-2:]) * 60. * 180. / np.pi
pixratio = analysis_resolution / Config.getfloat(sim_section, "pixel_arcmin")
min_ell = fmaps.minimum_ell(shape_dat, wcs_dat)

parray_dat = aio.patch_array_from_config(Config,
                                         expf_name,
                                         shape_dat,
                                         wcs_dat,
                                         dimensionless=False)
parray_sim = aio.patch_array_from_config(Config,
                                         expf_name,
                                         shape_sim,
                                         wcs_sim,
                                         dimensionless=False)

# Efficiently distribute sims over MPI cores
num_each, each_tasks = mpi_distribute(Nsims, numcores)
# Initialize a container for stats and stacks
mpibox = MPIStats(comm, num_each, tag_start=333)
if rank == 0: print(("At most ", max(num_each), " tasks..."))
# What am I doing?
my_tasks = each_tasks[rank]
コード例 #2
0
ファイル: test_window.py プロジェクト: veragluscevic/orphics
min_ell = fmaps.minimum_ell(shape_dat, wcs_dat)
if rank == 0: print("Ell bounds...")

lb = aio.ellbounds_from_config(Config, "reconstruction_sigurd", min_ell)
tellmin = lb['tellminY']
tellmax = lb['tellmaxY']
pellmin = lb['pellminY']
pellmax = lb['pellmaxY']
kellmin = lb['kellmin']
kellmax = lb['kellmax']

if rank == 0: print("Patches data...")

parray_dat = aio.patch_array_from_config(Config,
                                         expf_name,
                                         shape_dat,
                                         wcs_dat,
                                         dimensionless=True)

if rank == 0: print("Attributes...")

lxmap_dat, lymap_dat, modlmap_dat, angmap_dat, lx_dat, ly_dat = fmaps.get_ft_attributes_enmap(
    shape_dat, wcs_dat)

if rank == 0: print("Binners...")

lbin_edges = np.arange(kellmin, kellmax, 200)
lbinner_dat = stats.bin2D(modlmap_dat, lbin_edges)

if rank == 0: print("Cosmology...")