bias = ((pkh['power'].real / pkd['power'].real)[1:6]**0.5).mean()
if rank == 0: print('Bias = %0.2f' % bias)

Rsm = 8
Rbao = Rsm / 2**0.5
ff = cosmo.scale_independent_growth_rate(zz)
beta = bias / ff

usenoise = True
if usenoise:
    if rank == 0: print('Use noise')
    truth_noise_model = mapnoise.ThermalNoise(truth_pm,
                                              seed=100,
                                              aa=aa,
                                              att=stage2,
                                              spread=spread,
                                              hex=hex,
                                              limk=2,
                                              Ns=Ndish,
                                              checkbase=False,
                                              nmin=None)
    data_p = truth_noise_model.add_noise(data_p)

position = truth_pm.generate_uniform_particle_grid(shift=0)
layout = truth_pm.decompose(position)

rho = data_p.mapp
if aa == 0.1429 and cfg['mods']['wopt'] == 'opt':
    rho = std.gauss(data_p.mapp, 2 * bs / ncd)
else:
    rho = std.decic(rho)
rho = std.apply_wedge(rho, kmin, angle)
Exemple #2
0
noise = None
if rank == 0: print('Noise : ', noise)

#########################################
#dynamics
stages = numpy.linspace(0.01, aa, nsteps, endpoint=True)
if pmdisp: dynamic_model = NBodyModel(cosmo, truth_pm, B=B, steps=stages)
else: dynamic_model = ZAModel(cosmo, truth_pm, B=B, steps=stages)
if rank == 0: print(dynamic_model)

#noise
if stage2 is not None:
    truth_noise_model = mapnoise.ThermalNoise(truth_pm,
                                              seed=100,
                                              aa=aa,
                                              att=stage2,
                                              spread=spread,
                                              hex=hex,
                                              limk=2,
                                              Ns=Ndish)
else:
    truth_noise_model = mapnoise.ThermalNoise(truth_pm,
                                              seed=None,
                                              aa=aa,
                                              att=stage2,
                                              spread=spread,
                                              hex=hex,
                                              Ns=Ndish)
wedge_noise_model = mapnoise.WedgeNoiseModel(pm=truth_pm,
                                             power=1,
                                             seed=100,
                                             kmin=kmin,
Exemple #3
0
if rank == 0: print('RSD factor is : ', rsdfac)
noise = None
if rank == 0: print('Noise : ', noise)

stages = numpy.linspace(0.01, aa, nsteps, endpoint=True)
if pmdisp: dynamic_model = NBodyModel(cosmo, new_pm, B=B, steps=stages)
else: dynamic_model = ZAModel(cosmo, new_pm, B=B, steps=stages)
if rank == 0: print(dynamic_model)

#noise
if stage2 is not None:
    truth_noise_model = mapnoise.ThermalNoise(new_pm,
                                              seed=100,
                                              aa=aa,
                                              att=stage2,
                                              spread=spread,
                                              hex=hex,
                                              limk=2,
                                              Ns=Ndish,
                                              checkbase=True)
else:
    truth_noise_model = mapnoise.ThermalNoise(new_pm,
                                              seed=None,
                                              aa=aa,
                                              att=stage2,
                                              spread=spread,
                                              hex=hex,
                                              Ns=Ndish)
wedge_noise_model = mapnoise.WedgeNoiseModel(pm=new_pm,
                                             power=1,
                                             seed=100,
d_truth = new_pm.paint(dyn['Position'], layout=dlayout)




##
#Model
params = numpy.loadtxt(optfolder + '/params.txt')

stages = numpy.linspace(0.01, aa, nsteps, endpoint=True)
if pmdisp: dynamic_model = NBodyModel(cosmo, new_pm, B=B, steps=stages)
else: dynamic_model = ZAModel(cosmo, new_pm, B=B, steps=stages)
if rank == 0: print(dynamic_model)

#noise
if stage2 is not None: truth_noise_model = mapnoise.ThermalNoise(new_pm, seed=100, aa=aa, att=stage2,spread=spread, hex=hex, limk=2, Ns=Ndish)
else: truth_noise_model = mapnoise.ThermalNoise(new_pm, seed=None, aa=aa, att=stage2,spread=spread, hex=hex, Ns=Ndish)
wedge_noise_model = mapnoise.WedgeNoiseModel(pm=new_pm, power=1, seed=100, kmin=kmin, angle=angle)
#Create and save data if not found


#################

mock_model = map.MockModel(dynamic_model, params=params, rsdpos=rsdpos, rsdfac=rsdfac)
try: data_p = map.Observable.load(optfolder+'/datap_up')
except: 
    data_p = map.Observable(hmesh, d_truth, s_truth)
    data_p.save(optfolder+'datap_up/')


try: 
Exemple #5
0
##rankweight       = sum((masswt**2).compute())
##totweight2        = comm.allreduce(rankweight)
#noise = bs**3 / (hmesh.csum()**2 / (hmesh**2).csum())
noise = None 
if rank == 0 : print('Noise : ', noise)


#########################################
#dynamics
stages = numpy.linspace(0.01, aa, nsteps, endpoint=True)
if pmdisp: dynamic_model = NBodyModel(cosmo, truth_pm, B=B, steps=stages)
else: dynamic_model = ZAModel(cosmo, truth_pm, B=B, steps=stages)
if rank == 0: print(dynamic_model)

#noise
if stage2 is not None: truth_noise_model = mapnoise.ThermalNoise(truth_pm, seed=100, aa=aa, att=stage2,spread=spread, hex=hex)
else: truth_noise_model = mapnoise.ThermalNoise(truth_pm, seed=None, aa=aa, att=stage2,spread=spread, hex=hex)
#Create and save data if not found

s_truth = BigFileMesh(dfolder + 'linear', 'LinearDensityK').paint()
dyn = BigFileCatalog(dfolder + 'fastpm_%0.4f/1'%aa)
dlayout = truth_pm.decompose(dyn['Position'])
d_truth = truth_pm.paint(dyn['Position'], layout=dlayout)


try: data_p = map.Observable.load(optfolder+'/datap')
except: 
    data_p = map.Observable(hmesh, d_truth, s_truth)
    data_p.save(optfolder+'datap/')

try: