def __init__(self): # Lya P3D defined at this redshift self.zref=2.25 # Cosmological model self.cosmo = cCAMB.Cosmology(self.zref) # Lya P3D theory self.LyaP3D = P3D.TheoryLyaP3D(self.cosmo) # quasar luminosity function self.QLF = qLF.QuasarLF() # spectrograph self.spec = sp.Spectrograph(band='g') # survey (should probably be its own object at some point...) self.area_deg2 = 14000.0 # each mini-survey will cover only (lmin,lmax) self.lmin = 3501.0 self.lmax = 3701.0 # quasar redshift range self.zq_min = 2.0 self.zq_max = 4.0 # magnitude range self.mag_min = 16.5 self.mag_max = 23.0 # pixel width and resolution in km/s (for now) self.pix_kms = 50.0 self.res_kms = 70.0 # definition of forest (lrmin,lrmax) self.lrmin = 985.0 self.lrmax = 1200.0 # S/N weights evaluated at this Fourier mode self.kt_w_deg=7.0 # ~ 0.1 h/Mpc self.kp_w_kms=0.001 # ~ 0.1 h/Mpc # verbosity level self.verbose = 1
def __init__(self, cosmo=None): """cosmo is an optional cosmoCAMB.Cosmology object""" if cosmo: self.cosmo = cosmo self.zref = cosmo.pk_zref else: self.zref = 2.25 self.cosmo = cCAMB.Cosmology(self.zref) # get linear power spectrum self.kmin = 1.e-4 self.kmax = 1.e1 self.linPk = self.cosmo.LinPk_hMpc(self.kmin, self.kmax, 1000)
def __init__(self, cosmo=None): """ cosmo is an optional cosmoCAMB.Cosmology object since our LyA reference values are at redshift 2.4, we set z_ref = 2.4 """ if cosmo: self.cosmo = cosmo self.zref = cosmo.pk_zref else: self.zref = 2.4 self.cosmo = cCAMB.Cosmology(self.zref) # get linear power spectrum self.kmin = 1.e-4 self.kmax = 1.e1 self.linPk = self.cosmo.LinPk_hMpc(self.kmin, self.kmax, 1000)
z = 2.4 #redshift value headFile = "run89" #subfolder of "output" to write fitting results to # make the output folder if it does not already exist if not os.path.exists('../output/' + headFile): os.makedirs('../output/' + headFile) ###################################################################### ## Define fiducial parameter values and the 1D power spectrum model ## ###################################################################### q1_f, q2_f, kp_f, kvav_f, av_f, bv_f = getFiducialValues(z) p0 = [q1_f, q2_f, kp_f, kvav_f, av_f, bv_f] ndims = len(p0) cosmo = cCAMB.Cosmology(z) th = tLyA.TheoryLya(cosmo) dkMz = th.cosmo.dkms_dhMpc(z) data = npd.LyA_P1D(z) k_vals = data.k P = data.Pk Perr = data.Pk_stat k_res = k_vals * dkMz def model(k, q1, q2, kp, kvav, av, bv): m = th.FluxP1D_hMpc( z, k * dkMz, q1=q1, q2=q2, kp=kp, kvav=kvav, av=av, bv=bv) * dkMz return m
import numpy as np import matplotlib.pyplot as plt import cosmoCAMB as cCAMB # setup cosmological model zref = 2.25 cosmo = cCAMB.Cosmology(zref) # compute linear power at zref kmin = 1.e-4 kmax = 1.e1 linPk = cosmo.LinPk_hMpc(kmin, kmax, 1000) # plot power k = np.logspace(np.log10(kmin), np.log10(0.99 * kmax), 1000) plt.loglog(k, linPk(k)) plt.xlim(1.e-4, 1.0) plt.ylim(ymin=10.0) plt.xlabel('k [h/Mpc]') plt.ylabel('P(k) [Mpc/h]') plt.title('Linear density power at z =' + str(zref)) plt.show()