def eval(m, pars, k, mu): if not m.use_so_correction: return numpy.zeros(len(k)) kprime = k_AP(k, mu, m.alpha_perp, m.alpha_par) muprime = mu_AP(mu, m.alpha_perp, m.alpha_par) G = m.FOG(kprime, muprime, m.sigma_c) G2 = m.FOG(kprime, muprime, m.sigma_so) Gprime = m.FOG.derivative_sigma(kprime, muprime, m.sigma_so) with m.preserve(use_so_correction=False): # Pcc with no FOG kernels m.sigma_c = 0. Pcc = m.Pgal_cc(k, mu) # derivative of the SO correction terms term1 = 2 * m.f_so * (1 - m.f_so) * G * Pcc term2 = 2 * m.f_so**2 * G2 * Pcc term3 = 2 * G * m.f_so * m.fcB * m.NcBs / (m.alpha_perp**2 * m.alpha_par) toret = (term1 + term2 + term3) * Gprime return (1 - m.fs)**2 * toret
def eval(m, pars, k, mu): kprime = k_AP(k, mu, m.alpha_perp, m.alpha_par) muprime = mu_AP(mu, m.alpha_perp, m.alpha_par) G = m.FOG(kprime, muprime, m.sigma_sB) return (m.fs * m.fsB * G)**2 / (m.alpha_perp**2 * m.alpha_par)
def eval(m, pars, k, mu): kprime = k_AP(k, mu, m.alpha_perp, m.alpha_par) muprime = mu_AP(mu, m.alpha_perp, m.alpha_par) G = m.FOG(kprime, muprime, m.sigma_c) Gprime = m.FOG.derivative_sigma(kprime, muprime, m.sigma_c) with m.preserve(): m.sigma_c = 0 if not m.use_so_correction: term1 = 2 * G * Gprime * m.Pgal_cc(k, mu) else: # turn off SO correction m.use_so_correction = False Pcc = m.Pgal_cc(k, mu) # derivative of the SO correction terms G2 = m.FOG(kprime, muprime, m.sigma_so) term1_a = 2 * G * (1 - m.f_so)**2 * Pcc term1_b = 2 * m.f_so * (1 - m.f_so) * G2 * Pcc term1_c = 2 * G2 * m.f_so * m.fcB * m.NcBs / (m.alpha_perp**2 * m.alpha_par) term1 = (term1_a + term1_b + term1_c) * Gprime term2 = Gprime * m.Pgal_cs(k, mu) return (1 - m.fs)**2 * term1 + 2 * m.fs * (1 - m.fs) * term2
def eval(m, pars, k, mu): kprime = k_AP(k, mu, m.alpha_perp, m.alpha_par) muprime = mu_AP(mu, m.alpha_perp, m.alpha_par) # finger of god G = m.FOG(kprime, muprime, m.sigma_fog) # do the volume rescaling rescaling = (m.alpha_drag**3) / (m.alpha_perp**2 * m.alpha_par) mu2 = muprime**2 return rescaling * G**2 * mu2 * (m.P_mu2(kprime) + 2 * m.P_mu4(kprime) * mu2) / m.f
def eval(m, pars, k, mu): kprime = k_AP(k, mu, m.alpha_perp, m.alpha_par) muprime = mu_AP(mu, m.alpha_perp, m.alpha_par) G = m.FOG(kprime, muprime, m.sigma_fog) if hasattr(G, 'values'): G = G.values Gprime = m.FOG.derivative_sigma(kprime, muprime, m.sigma_fog) toret = np.zeros_like(G) valid = np.nonzero(G) toret[valid] = 2 * Gprime[valid] * m.power(k, mu)[valid] / G[valid] return toret
def eval(m, pars, k, mu): kprime = k_AP(k, mu, m.alpha_perp, m.alpha_par) muprime = mu_AP(mu, m.alpha_perp, m.alpha_par) # derivative of scale-dependent bias term dbtot_db1 = 1 + 2 * m.f_nl * m.delta_crit / m.alpha_png(kprime) # finger-of-god G = m.FOG(kprime, muprime, m.sigma_fog) # the final derivative btot = m.btot(kprime) rescaling = (m.alpha_drag**3) / (m.alpha_perp**2 * m.alpha_par) return rescaling * G**2 * (2 * m.P_mu0(kprime) + muprime**2 * m.P_mu2(kprime)) * dbtot_db1 / btot
def eval(m, pars, k, mu): kprime = k_AP(k, mu, m.alpha_perp, m.alpha_par) muprime = mu_AP(mu, m.alpha_perp, m.alpha_par) # finger-of-god G = m.FOG(kprime, muprime, m.sigma_fog) # derivative of scale-dependent bias term ddb_dfnl = 2 * (m.b1 - m.p) * m.delta_crit / m.alpha_png(kprime) # do the volume rescaling rescaling = (m.alpha_drag**3) / (m.alpha_perp**2 * m.alpha_par) # the final derivative btot = m.btot(kprime) return rescaling * G**2 * (2 * m.P_mu0(kprime) + m.P_mu2(kprime) * muprime**2) / btot * ddb_dfnl
def eval(m, pars, k, mu): # AP shifted kprime = k_AP(k, mu, m.alpha_perp, m.alpha_par) muprime = mu_AP(mu, m.alpha_perp, m.alpha_par) Gc = m.FOG(kprime, muprime, m.sigma_c) GsA = m.FOG(kprime, muprime, m.sigma_sA) GsB = m.FOG(kprime, muprime, m.sigma_sB) toret = 2*m.fs*(1-m.fs)*m.fcB*Gc * ((1-m.fsB)*GsA + m.fsB*GsB) # additional term from SO correction if m.use_so_correction: G1 = m.FOG(kprime, muprime, m.sigma_c) G2 = m.FOG(kprime, muprime, m.sigma_so) toret += (1-m.fs)**2 * 2*G1*G2*m.f_so*m.fcB return toret / (m.alpha_perp**2 * m.alpha_par)
def eval(m, pars, k, mu): term1 = 2 * (-(1 - m.fcB) * m.Pgal_cAcA(k, mu) + (1 - 2 * m.fcB) * m.Pgal_cAcB(k, mu) + m.fcB * m.Pgal_cBcB(k, mu)) term2 = (1 - m.fsB) * (-m.Pgal_cAsA(k, mu) + m.Pgal_cBsA( k, mu)) + m.fsB * (-m.Pgal_cAsB(k, mu) + m.Pgal_cBsB(k, mu)) # AP shifted kprime = k_AP(k, mu, m.alpha_perp, m.alpha_par) muprime = mu_AP(mu, m.alpha_perp, m.alpha_par) # additional term from SO correction if m.use_so_correction: G1 = m.FOG(kprime, muprime, m.sigma_c) G2 = m.FOG(kprime, muprime, m.sigma_so) term1 *= (((1 - m.f_so) * G1)**2 + 2 * m.f_so * (1 - m.f_so) * G1 * G2 + (m.f_so * G2)**2) term1 += 2 * G1 * G2 * m.f_so * m.NcBs / (m.alpha_perp**2 * m.alpha_par) return (1 - m.fs)**2 * term1 + 2 * m.fs * (1 - m.fs) * term2
def eval(m, pars, k, mu): if not m.use_so_correction: return numpy.zeros(len(k)) # sum the individual components of Pcc PcAcA = (1. - m.fcB)**2 * m.Pgal_cAcA(k, mu) PcAcB = 2 * m.fcB * (1 - m.fcB) * m.Pgal_cAcB(k, mu) PcBcB = m.fcB**2 * m.Pgal_cBcB(k, mu) Pcc = PcAcA + PcAcB + PcBcB # FOG kprime = k_AP(k, mu, m.alpha_perp, m.alpha_par) muprime = mu_AP(mu, m.alpha_perp, m.alpha_par) G1 = m.FOG(kprime, muprime, m.sigma_c) G2 = m.FOG(kprime, muprime, m.sigma_so) # the SO correction term1 = -2 * (1. - m.f_so) * G1**2 * Pcc term2 = 2 * (1 - 2 * m.f_so) * G1 * G2 * Pcc term3 = 2 * m.f_so * G2**2 * Pcc term4 = 2 * G1 * G2 * m.fcB * m.NcBs / m.alpha_perp**2 / m.alpha_par return (1 - m.fs)**2 * (term1 + term2 + term3 + term4)