LimberJack.jl
Core
Core
performs the main computations of LimberJack.jl
. When using LimberJack.jl
, the first step is to create an instance of the Cosmology
structure. This is as easy as calling:
using LimberJack
cosmology = Cosmology()
This will generate the an instance of Cosmology
given the vanilla $\Lambda$CDM cosmology of CCL
. Cosmology()
then computes the value of the comoving distance, the growth factor, the growth rate and matter power spectrum at an array of values and generates interpolators for said quantites. The user can acces the value of these interpolator at an arbitrary input using the public functions of the model. Moreover, the Cosmology
structure has its own type called Cosmology
.
LimberJack.Settings
— TypeSettings(;kwargs...)
Constructor of settings structure constructor.
Kwargs:
nz::Int=300
: number of nodes in the general redshift array.nk::Int=500
: number of nodes in the k-scale array used to compute matter power spectrum grid.nℓ::Int=300
: number of nodes in the multipoles array.using_As::Bool=false
:True
if using theAs
parameter.cosmo_type::Type=Float64
: type of cosmological parameters.tk_mode::String=:EisHu
: choice of transfer function.Dz_mode::String=:RK2
: choice of method to compute the linear growth factor.pk_mode::String=:linear
: choice of method to apply non-linear corrections to the matter power spectrum.
Returns:
mutable struct Settings
nz::Int
nk::Int
nℓ::Int
xs
zs
ks
ℓs
logk
dlogk
using_As::Bool
cosmo_type::DataType
tk_mode::Symbol
Dz_mode::Symbol
pk_mode::Symbol
end
LimberJack.CosmoPar
— TypeCosmoPar(kwargs...)
Cosmology parameters structure constructor.
Kwargs:
Ωm::Dual=0.30
: cosmological matter density.Ωb::Dual=0.05
: cosmological baryonic density.h::Dual=0.70
: reduced Hubble parameter.ns::Dual=0.96
: Harrison-Zeldovich spectral index.As::Dual=2.097e-9
: Harrison-Zeldovich spectral amplitude.σ8::Dual=0.81
: variance of the matter density field in a sphere of 8 Mpc.Y_p::Dual=0.24
: primordial helium fraction.N_ν::Dual=3.046
: effective number of relativisic species (PDG25 value).Σm_ν::Dual=0.0
: sum of neutrino masses (eV), Planck 15 default ΛCDM value.θCMB::Dual=2.725/2.7
: CMB temperature over 2.7.Ωg::Dual=2.38163816E-5*θCMB^4/h^2
: cosmological density of relativistic species.Ωr::Dual=Ωg*(1.0 + N_ν * (7.0/8.0) * (4.0/11.0)^(4.0/3.0))
: cosmological radiation density.
Returns:
mutable struct CosmoPar{T}
Ωm::T
Ωb::T
h::T
ns::T
As::T
σ8::T
θCMB::T
Y_p::T
N_ν::T
Σm_ν::T
Ωg::T
Ωr::T
Ωc::T
ΩΛ::T
end
LimberJack.Cosmology
— TypeCosmology(cpar::CosmoPar, settings::Settings)
Base cosmology structure constructor.
Calculates the LCDM expansion history based on the different species densities provided in CosmoPar
.
The comoving distance is then calculated integrating the expansion history.
Depending on the choice of transfer function in the settings, the primordial power spectrum is calculated using:
tk_mode = :EisHu
: the Eisenstein & Hu formula (arXiv:astro-ph/9710252)tk_mode = :EmuPk
: the Mootoovaloo et al 2021 emulatorEmuPk
(arXiv:2105.02256v2)
Depending on the choice of power spectrum mode in the settings, the matter power spectrum is either:
pk_mode = :linear
: the linear matter power spectrum.pk_mode = :halofit
: the Halofit non-linear matter power spectrum (arXiv:astro-ph/0207664).
Arguments:
Settings::MutableStructure
: cosmology constructure settings.CosmoPar::Structure
: cosmological parameters.
Returns:
mutable struct Cosmology
settings::Settings
cpar::CosmoPar
chi::AbstractInterpolation
z_of_chi::AbstractInterpolation
t_of_z::AbstractInterpolation
chi_max
chi_LSS
Dz::AbstractInterpolation
fs8z::AbstractInterpolation
PkLz0::AbstractInterpolation
Pk::AbstractInterpolation
end
Cosmology(;kwargs...)
Short form to call Cosmology(cpar::CosmoPar, settings::Settings)
. kwargs
are passed to the constructors of CosmoPar
and Settings
. Returns:
Cosmology
: cosmology structure.
LimberJack.Ez
— FunctionEz(cosmo::Cosmology, z)
Given a Cosmology
instance, it returns the expansion rate (H(z)/H0).
Arguments:
cosmo::Cosmology
: cosmology structurez::Dual
: redshift
Returns:
Ez::Dual
: expansion rate
LimberJack.Hmpc
— FunctionHmpc(cosmo::Cosmology, z)
Given a Cosmology
instance, it returns the expansion history (H(z)) in Mpc.
Arguments:
cosmo::Cosmology
: cosmology structurez::Dual
: redshift
Returns:
Hmpc::Dual
: expansion rate
LimberJack.comoving_radial_distance
— Functioncomoving_radial_distance(cosmo::Cosmology, z)
Given a Cosmology
instance, it returns the comoving radial distance.
Arguments:
cosmo::Cosmology
: cosmology structurez::Dual
: redshift
Returns:
Chi::Dual
: comoving radial distance
LimberJack.growth_factor
— Functiongrowth_factor(cosmo::Cosmology, z)
Given a Cosmology
instance, it returns the growth factor (D(z) = log(δ)).
Arguments:
cosmo::Cosmology
: cosmological structurez::Dual
: redshift
Returns:
Dz::Dual
: comoving radial distance
LimberJack.growth_rate
— Functiongrowth_rate(cosmo::Cosmology, z)
Given a Cosmology
instance, it returns growth rate.
Arguments:
cosmo::Cosmology
: cosmology structurez::Dual
: redshift
Returns:
f::Dual
: f
LimberJack.sigma8
— Functionsigma8(cosmo::Cosmology, z)
Given a Cosmology
instance, it returns s8.
Arguments:
cosmo::Cosmology
: cosmological structurez::Dual
: redshift
Returns:
s8::Dual
: comoving radial distance
LimberJack.fs8
— Functionfs8(cosmo::Cosmology, z)
Given a Cosmology
instance, it returns fs8.
Arguments:
cosmo::Cosmology
: cosmology structurez::Dual
: redshift
Returns:
fs8::Dual
: fs8
LimberJack.lin_Pk
— Functionlin_Pk(cosmo::Cosmology, k, z)
Given a Cosmology
instance, it returns the linear matter power spectrum (P(k,z))
Arguments:
cosmo::Cosmology
: cosmology structurek::Dual
: scalez::Dual
: redshift
Returns:
Pk::Dual
: linear matter power spectrum
LimberJack.nonlin_Pk
— Functionnonlin_Pk(cosmo::Cosmology, k, z)
Given a Cosmology
instance, it returns the non-linear matter power spectrum (P(k,z)) using the Halofit fitting formula (arXiv:astro-ph/0207664).
Arguments:
cosmo::Cosmology
: cosmology structurek::Dual
: scalez::Dual
: redshift
Returns:
Pk::Dual
: non-linear matter power spectrum
Tracers
In LimberJack.jl
each tracer is structure
containing at least of three fields:
wint
: an interpolator betweenchis
andwarr
.F
: an interpolator betweenchis
andwarr
.
On top of these, tracers might contain the value of any nuisance parameter associated with them. Moreover, tracers within LimberJack.jl
tracer objects have their own type called Tracer
.
LimberJack.NumberCountsTracer
— TypeNumberCountsTracer(warr, chis, wint, b, lpre)
Number counts tracer structure. Arguments:
wint::Interpolation
: interpolation of the radial kernel over comoving distance.F::Function
: prefactor.
Returns:
NumberCountsTracer::NumberCountsTracer
: Number counts tracer structure.
LimberJack.WeakLensingTracer
— TypeWeakLensingTracer(cosmo::Cosmology, z_n, nz; kwargs...)
Weak lensing tracer structure constructor. Arguments:
cosmo::Cosmology
: cosmology structure.z_n::Vector{Dual}
: redshift array.nz::Interpolation
: distribution of sources over redshift.
Kwargs:
mb::Dual = 1
: multiplicative bias.IA_params::Vector{Dual} = [A_IA, alpha_IA]
: instrinsic aligment parameters.
Returns:
WeakLensingTracer::WeakLensingTracer
: Weak lensing tracer structure.
LimberJack.CMBLensingTracer
— TypeCMBLensingTracer(warr, chis, wint, lpre)
CMB lensing tracer structure. Arguments:
wint::Interpolation
: interpolation of the radial kernel over comoving distance.F::Function
: prefactor.
Returns:
CMBLensingTracer::CMBLensingTracer
: CMB lensing tracer structure.
LimberJack.get_IA
— Functionget_IA(cosmo::Cosmology, zs, IA_params)
CMB lensing tracer structure. Arguments:
cosmo::Cosmology
: cosmology structure.zs::Vector{Dual}
: redshift array.IA_params::Vector{Dual}
: Intrinsic aligment parameters.
Returns:
IA_corr::Vector{Dual}
: Intrinsic aligment correction to radial kernel.
Spectra
Performs the computation of the angular power spectra of any two tracers.
LimberJack.Cℓintegrand
— FunctionCℓintegrand(cosmo::Cosmology, t1::Tracer, t2::Tracer, logk, ℓ)
Returns the integrand of the angular power spectrum. Arguments:
cosmo::Cosmology
: cosmology structure.t1::Tracer
: tracer structure.t2::Tracer
: tracer structure.logk::Vector{Float}
: log scale array.ℓ::Float
: multipole.
Returns:
integrand::Vector{Real}
: integrand of the angular power spectrum.
LimberJack.angularCℓs
— FunctionangularCℓs(cosmo::Cosmology, t1::Tracer, t2::Tracer, ℓs)
Returns the angular power spectrum. Arguments:
cosmo::Cosmology
: cosmology structure.t1::Tracer
: tracer structure.t2::Tracer
: tracer structure.ℓs::Vector{Float}
: multipole array.
Returns:
Cℓs::Vector{Real}
: angular power spectrum.
Data Utils
Parses sacc
and YAML
files.
LimberJack.make_data
— Functionmake_data(sacc_file, yaml_file)
Process sacc
and yaml
files into a Meta
structure containing the instructions of how to compose the theory vector and a npz
file with the neccesary redshift distributions of the tracers involved.
Arguments:
sacc_file
: sacc fileyaml_file
: yaml_file
Returns:
struct Instructions
names : names of tracers.
pairs : pairs of tracers to compute angular spectra for.
types : types of the tracers.
idx : positions of cls in theory vector.
data : data vector.
cov : covariance of the data.
inv_cov : inverse covariance of the data.
end
-files: npz file
Theory
Performs the computation of complex theory vectors given sacc
and YAML
files.
LimberJack.Theory
— FunctionTheory(cosmology::Cosmology,
instructions::Instructions, files;
Nuisances=Dict())
Composes a theory vector given a Cosmology
object, a Meta
objectm, a files
npz file and a dictionary of nuisance parameters.
Arguments:
cosmology::Cosmology
:Cosmology
object.meta::Meta
:Meta
object.files
:files
npz
file.Nuisances::Dict
: dictonary of nuisace parameters.
Returns:
- Meta: structure
struct Meta
names : names of tracers.
pairs : pairs of tracers to compute angular spectra for.
types : types of the tracers.
idx : positions of cls in theory vector.
data : data vector.
cov : covariance of the data.
inv_cov : inverse covariance of the data.
end
- files: npz file