Beispiel #1
0
 def _pspec(self, params):
     cc = ClusterCosmology(paramDict=params,
                           constDict=self.constdict,
                           clTTFixFile=self.clttfile)
     clst = Clustering(self.inifile, self.expname, self.gridname,
                       self.version, cc)
     return clst.fine_ps_bar(self.mus)
Beispiel #2
0
    def instantiate_grids(self):
        mubins = list_from_config(self.config, 'general', 'mubins')
        self.mus = np.linspace(mubins[0], mubins[1], int(mubins[2]) + 1)

        cc = ClusterCosmology(paramDict=self.params,
                              constDict=self.constdict,
                              clTTFixFile=self.clttfile)
        clst = Clustering(self.inifile, self.expname, self.gridname,
                          self.version, cc)
        self.ks = clst.HMF.kh
        self.ps_fid = clst.fine_ps_bar(self.mus)
        self.veff_fid = clst.V_eff(self.mus)

        self.deltaks = np.gradient(self.ks)
        self.deltamus = np.gradient(self.mus)
Beispiel #3
0
        fparams[key] = float(val)

expName = 'S4-1.0-CDT'
gridName = 'grid-owl2'
version = '0.6'
cc = ClusterCosmology(fparams, constDict, clTTFixFile=clttfile)
clst = Clustering(INIFILE, expName, gridName, version, cc)

fsky = 1.

ks = clst.HMF.kh
delta_ks = np.gradient(ks)
zs = clst.HMF.zarr[1:-1]
mus = np.linspace(-1, 1, 9)
deltamu = np.gradient(mus)

ps_bars = clst.fine_ps_bar(mus)

v_effs = clst.V_eff(mus)

noise = np.sqrt(8) * np.pi * np.sqrt(
    1 / (deltamu * v_effs * (ks**2)[..., np.newaxis, np.newaxis] *
         delta_ks[..., np.newaxis, np.newaxis])) * ps_bars

snr = ps_bars / noise

print(noise.shape)
print(np.einsum('ijk,ijk', noise, noise))

print(np.sum(snr**2))
Beispiel #4
0
    pass
elif rank % 2 == 1:
    myParam = inParamList[myParamIndex]
    passParams[myParam] = fparams[myParam] + old_div(stepSizes[myParam], 2.)
elif rank % 2 == 0:
    myParam = inParamList[myParamIndex]
    passParams[myParam] = fparams[myParam] - old_div(stepSizes[myParam], 2.)

if rank != 0: print(rank, myParam, fparams[myParam], passParams[myParam])

####FIX THIS

cc = ClusterCosmology(passParams, constDict, clTTFixFile=clttfile)
clst = Clustering(expName, gridName, version, cc)

pbar = clst.fine_ps_bar(mubin_edges)
veff = clst.V_eff(mubin_edges)

fish_fac_err = veff * clst.HMF.kh**2 / pbar**2  # Tegmark 1997

#HMF = Halo_MF(cc,mexp_edges,z_edges)
#HMF.sigN = siggrid.copy()
#SZProf = SZ_Cluster_Model(cc,clusterDict,rms_noises = noise,fwhms=beam,freqs=freq,lknee=lknee,alpha=alpha,v3mode=v3mode,fsky=fsky)

#if (YWLcorrflag == 1):
#    dN_dmqz = HMF.N_of_mqz_SZ_corr(lndM*massMultiplier,qbin_edges,SZProf)
#else:
#dN_dmqz = HMF.N_of_mqz_SZ(lndM*massMultiplier,qbin_edges,SZProf)

if rank == 0:
    #np.save(bigDataDir+"N_dzmq_"+saveId+"_fid",dN_dmqz)