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)
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))
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) np.save(sfisher.fid_file(bigDataDir, saveId), fish_fac_err)
INIFILE = "input/pipeline.ini" expName = 'S4-1.0-CDT' gridName = 'grid-owl2' version = '0.6' clst = Clustering(INIFILE, expName, gridName, version) fsky = 1. ks = clst.HMF.kh zs = clst.HMF.zarr[1:-1] mus = np.array([0]) v0s = clst.v0(fsky, 1000) v_effs = clst.V_eff(mus, fsky, 1000) plt.plot(zs, v0s, label=r"$V_0$") plt.plot(zs, v_effs[43, :, :], label=r"$V_{eff}(k\approx 0.001)$") plt.plot(zs, v_effs[114, :, :], label=r"$V_{eff}(k\approx 0.05)$") plt.plot(zs, v_effs[127, :, :], label=r"$V_{eff}(k\approx 0.1)$") plt.plot(zs, v_effs[139, :, :], label=r"$V_{eff}(k\approx 0.2)$") #plt.plot(ks, v_effs[0]) #plt.xscale('log') plt.xlim((0, 1.8)) plt.yscale('log') plt.xlabel(r'$z$') plt.ylabel(r'$V_{eff}(k)$') plt.legend(loc='best') plt.savefig('volumes_test.svg')