Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Background Calculations #1148

Closed
wants to merge 127 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
0c68867
first commit
nikfilippas Mar 16, 2023
790bc13
Merge branch 'master' into CCLObject_eq
nikfilippas Mar 19, 2023
437f5df
remove warning in the first spin of CCL
nikfilippas Mar 19, 2023
12961f4
kernels chk ok, transfers almost done
nikfilippas Mar 20, 2023
52df271
more tests
nikfilippas Mar 20, 2023
87c8639
halo profiles in their own directory
nikfilippas Mar 20, 2023
1bfab13
finished tracer eq tests
nikfilippas Mar 21, 2023
c510aca
ported changes in halos/profiles
nikfilippas Mar 21, 2023
9474b15
Merge branch 'master' into v3_wip
damonge Mar 21, 2023
b8bb8e9
concentrations in their own directory
nikfilippas Mar 21, 2023
c40cf0c
mass functions & halo biases in their own directory
nikfilippas Mar 21, 2023
4da043f
moved CIB stuff to profiles & 2pts
nikfilippas Mar 21, 2023
ee5e535
split halo model into 1/2/4-pt
nikfilippas Mar 21, 2023
8c20b40
fix imports
nikfilippas Mar 21, 2023
fa9e215
Merge branch 'v3_wip' of https://github.com/LSSTDESC/CCL into v3_wip
nikfilippas Mar 21, 2023
8f29fa2
remove empty module
nikfilippas Mar 21, 2023
5b84d70
Merge branch 'v3_wip' into halos_v3
nikfilippas Mar 21, 2023
8df3d79
fix typo
nikfilippas Mar 21, 2023
ad286d8
Merge branch 'v3_wip' into halos_v3
nikfilippas Mar 21, 2023
2bb015c
changes from star in halos/ (no tests)
nikfilippas Mar 21, 2023
388629a
Baryons in v3 (#1039)
damonge Mar 22, 2023
af2dcb0
Merge branch 'v3_wip' into halos_v3
nikfilippas Mar 22, 2023
13c1206
refactor concentration, mass_function, halo_bias; improvements in HMC…
nikfilippas Mar 23, 2023
5d67de8
HaloProfile subclasses & HaloProfile.normprof attribute
nikfilippas Mar 23, 2023
d8b0d85
simplify imports
nikfilippas Mar 23, 2023
ef815c4
Tracers v3 (#1040)
damonge Mar 24, 2023
3267901
done
damonge Mar 24, 2023
4162fed
Merge branch 'master' into v3_wip
nikfilippas Mar 24, 2023
909695d
Background, boltzmann, and cls in v3 (#1041)
damonge Mar 24, 2023
2e22ce3
Merge branch 'v3_wip' into nu_param_power_v3
damonge Mar 24, 2023
7772dd6
Covariances in v3 (#1046)
damonge Mar 24, 2023
f1c1546
Correlations v3 (#1042)
damonge Mar 24, 2023
16968a0
first commit
nikfilippas Mar 24, 2023
67c537c
rename TNCDM to T_ncdm but preserve API
nikfilippas Mar 24, 2023
606d6fb
T_CMB directly into cosmo struct
nikfilippas Mar 25, 2023
2eb6cc8
Omega_g in ccl_parameters_create; no split between C/Python
nikfilippas Mar 25, 2023
4704831
physical_constants.T_CMB doesn't mutate anymore!
nikfilippas Mar 25, 2023
73a1b24
force mutate T_CMB in benchmarks
nikfilippas Mar 25, 2023
3ca9f53
define defaults on instantiation just in case constants mutate
nikfilippas Mar 25, 2023
3cf0d3c
A_s & sigma8: don't play with numbers
nikfilippas Mar 25, 2023
d1b5fd9
simplify
nikfilippas Mar 25, 2023
7587021
remove leftover mallocs
nikfilippas Mar 25, 2023
5aa7dfb
temporarily preserve API for CCLv3
nikfilippas Mar 25, 2023
9f4dde5
remove HaloProfile.name
nikfilippas Mar 25, 2023
6408590
cleaned up pk_Npt
nikfilippas Mar 25, 2023
5896fa4
add extrap_pk argument
nikfilippas Mar 25, 2023
99dc8eb
FFTLogParams class instead of dictionary in HaloProfile
nikfilippas Mar 26, 2023
fe3a6a3
simplified code
nikfilippas Mar 26, 2023
b46fb44
coverage for _repr.py
nikfilippas Mar 26, 2023
4e2214c
more coverage
nikfilippas Mar 26, 2023
22e348b
more coverage
nikfilippas Mar 26, 2023
675c142
super comprehensive tests & full coverage
nikfilippas Mar 26, 2023
1ad69a5
add a final extra test
nikfilippas Mar 26, 2023
1205e95
removed mass_def from HMIngredients; comprehensive code review 1
nikfilippas Mar 29, 2023
1b7f385
re-implementation, bugfixes, tests
nikfilippas Mar 30, 2023
fdefd88
c_m_relation >> concentration; code improvements; A_SPLINE_MAX in Python
nikfilippas Mar 30, 2023
6a45e72
HMIngredients initializers - no repeated code
nikfilippas Mar 30, 2023
f59089d
rogue file
nikfilippas Mar 30, 2023
551c173
Merge branch 'v3_wip' into halos_v3
nikfilippas Mar 30, 2023
55817de
patch for new changes
nikfilippas Mar 30, 2023
043bfaa
updated Build Status badge website
nikfilippas Mar 30, 2023
f96aab2
fix websites
nikfilippas Mar 30, 2023
4d27c79
added a DOI badge & links
nikfilippas Mar 30, 2023
a1b41ac
added nonbreaking space
nikfilippas Mar 30, 2023
a668101
removed extra space
nikfilippas Mar 30, 2023
c6a30c5
FancyRepr out of CCLObject to simplify
nikfilippas Mar 30, 2023
41b92dd
split base.py and restructured into its own dir to simplify
nikfilippas Mar 30, 2023
b71a210
Merge branch 'v3_wip' into halos_v3
nikfilippas Mar 30, 2023
b96caae
update tests to match changes
nikfilippas Mar 30, 2023
e4aed50
coverage
nikfilippas Mar 30, 2023
0d4623b
simple test for tkkssc
nikfilippas Mar 31, 2023
a58bdbc
more tests for tkkssc
nikfilippas Mar 31, 2023
167658e
addressed comments 1
nikfilippas Apr 1, 2023
055793b
addressed comments 1
nikfilippas Apr 1, 2023
edc09cb
Merge branch 'master' into nu_Tncdm_v3
nikfilippas Apr 1, 2023
cfeadd8
addressed comments 2: mass_def defaults are name strings etc.
nikfilippas Apr 1, 2023
88dfeb0
deprecate Gaussian & PowerLaw profiles
nikfilippas Apr 1, 2023
4c50da9
bugfix in master: sometimes mass_def_strict=False fails unexpectedly
nikfilippas Apr 1, 2023
091b8d3
typo
nikfilippas Apr 1, 2023
b995fe5
first commit
nikfilippas Apr 4, 2023
574755b
OmNuh2 fix
damonge Apr 4, 2023
3a7c5f9
addressed comments
nikfilippas Apr 4, 2023
51f249a
keep only massive
damonge Apr 4, 2023
1e1f9af
first step
damonge Apr 4, 2023
594c4a1
temp commit
nikfilippas Apr 4, 2023
047db91
debug neutrinos & deprecate Omnuh2
nikfilippas Apr 4, 2023
7fb728b
addressed comments
nikfilippas Apr 4, 2023
c26902e
New feature: Arbitrary function for profile normalization
nikfilippas Apr 5, 2023
de223da
gain efficiency
nikfilippas Apr 5, 2023
58ceb58
comments + deprecate k_min from HMCalculator
nikfilippas Apr 5, 2023
5e3e2f8
ccl_omega_x & ccl_Omeganuh2 consistency
nikfilippas Apr 5, 2023
c48fb75
renamed initialize_from_input --> create_instance
nikfilippas Apr 5, 2023
8d56fa5
brought in CCLNamedClass from docs_v3
nikfilippas Apr 5, 2023
ff884ed
brought in from docs_v3: directly callable HMIngredients
nikfilippas Apr 5, 2023
2e0ed76
prep for Davids input
nikfilippas Apr 5, 2023
43591ce
renamed HMCalculator --> HaloModel
nikfilippas Apr 5, 2023
598c253
fix typo
nikfilippas Apr 5, 2023
23d5adf
Merge branch 'halos_v3' into codata_v3
nikfilippas Apr 6, 2023
4eb9a18
brought in from docs_v3: initialize mass_def from any string (e.g. 400c)
nikfilippas Apr 6, 2023
2fd7cd2
first commit
nikfilippas Apr 6, 2023
c449caf
first commit
nikfilippas Apr 6, 2023
db75d30
Merge branch 'halos_v3' of https://github.com/LSSTDESC/CCL into halos_v3
nikfilippas Apr 6, 2023
590cc0e
Revert "renamed HMCalculator --> HaloModel"
nikfilippas Apr 6, 2023
208f8c1
counterterms func inside of 4pt func
nikfilippas Apr 6, 2023
096cfbd
replace deprecated abstractproperty
nikfilippas Apr 6, 2023
4da0f8f
abstract linked methods for HaloProfile, MassFunc, HaloBias, Concentr…
nikfilippas Apr 6, 2023
1f923a7
fully working implementation
nikfilippas Apr 7, 2023
8e77d88
renamed lM --> log10M etc.
nikfilippas Apr 7, 2023
b471c24
minor cosmetic fix
nikfilippas Apr 7, 2023
693bb67
Neutrinos, parameters, power in v3 (#1047)
damonge Apr 7, 2023
af0ee48
Merge branch 'v3_wip' into CCLObject_eq
nikfilippas Apr 7, 2023
c2a016d
fix tests
nikfilippas Apr 7, 2023
9482791
Merge branch 'halos_v3' into CCLObject_eq
nikfilippas Apr 7, 2023
1314f42
fully merged
nikfilippas Apr 7, 2023
a0b3397
(1) Allow mutation for CCLv2.final; (2) Completely remove cached_prop…
nikfilippas Apr 7, 2023
adddaeb
Merge branch 'v3_wip' into halos_v3
nikfilippas Apr 7, 2023
5dab496
Merge branch 'halos_v3' into eq_v3
nikfilippas Apr 7, 2023
cc2bea6
use the new constants; improvementes; passing tests
nikfilippas Apr 8, 2023
bdcc155
Merge branch 'halos_v3' into codata_v3
nikfilippas Apr 8, 2023
4581151
Merge branch 'eq_v3' into codata_v3
nikfilippas Apr 8, 2023
e8c9fe2
rename function & replace some calls
nikfilippas Apr 8, 2023
640ae7f
remove all this C code!
nikfilippas Apr 8, 2023
8131708
first commit
nikfilippas Apr 13, 2023
8de2ca6
flaked
nikfilippas Apr 13, 2023
f2e64a7
fix typo
nikfilippas Apr 13, 2023
d6e7eba
coverage
nikfilippas Apr 16, 2023
c8b63f1
scale factor
nikfilippas Apr 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ported changes in halos/profiles
nikfilippas committed Mar 21, 2023
commit c510aca01c518419014ca90ff926e8ae66d095e0
132 changes: 131 additions & 1 deletion pyccl/base.py
Original file line number Diff line number Diff line change
@@ -2,9 +2,11 @@
import functools
from collections import OrderedDict
import numpy as np
from inspect import signature
from inspect import signature, Parameter
from _thread import RLock
from abc import ABC
import warnings
from .errors import CCLDeprecationWarning


def _to_hashable(obj):
@@ -619,3 +621,131 @@ def __repr__(self):
from ._repr import _build_string_from_attrs
return _build_string_from_attrs(self)
return object.__repr__(self)


def warn_api(func=None, *, pairs=[], reorder=[]):
""" This decorator translates old API to new API for:
- functions/methods whose arguments have been ranamed,
- functions/methods with changed argument order,
- constructors in the ``halos`` sub-package where ``cosmo`` is removed,
- functions/methods where ``normprof`` is now a required argument.

Parameters:
pairs : list of pairs, optional
List of renaming pairs ``('old', 'new')``.
reorder : list, optional
List of the **previous** order of the arguments whose order
has been changed, under their **new** name.

Example:
We have the legacy constructor:

>>> def __init__(self, cosmo, a, b, c=0, d=1, normprof=False):
# do something
return a, b, c, d, normprof

and we want to change the API to

>>> def __init__(self, a, *, see=0, bee, d=1, normprof=None):
# do the same thing
return a, bee, see, d, normprof

Then, adding this decorator to our new function would preserve API

>>> @warn_api(pairs=[('b', 'bee'), ('c', 'see')],
reorder=['bee', 'see'])

- ``cosmo`` is automatically detected for all constructors in ``halos``
- ``normprof`` is automatically detected for all decorated functions.
"""
if func is None:
# called with parentheses
return functools.partial(warn_api, pairs=pairs, reorder=reorder)

name = func.__qualname__
plural = lambda expr: "" if not len(expr)-1 else "s" # noqa: final 's'
params = signature(func).parameters
POK = Parameter.POSITIONAL_OR_KEYWORD
KWO = Parameter.KEYWORD_ONLY
pos_names = [k for k, v in params.items() if v.kind == POK]
kwo_names = [k for k, v in params.items() if v.kind == KWO]
npos = len(pos_names)
rename = dict(pairs)

@functools.wraps(func)
def wrapper(*args, **kwargs):
# Custom definition of `isinstance` to avoic cyclic imports.
is_instance = lambda obj, cl: cl in obj.__class__.__name__ # noqa

# API compatibility with `cosmo` as a first argument in `halos`.
catch_cosmo = args[1] if len(args) > 1 else kwargs.get("cosmo")
if ("pyccl.halos" in func.__module__
and func.__name__ == "__init__"
and is_instance(catch_cosmo, "Cosmology")):
warnings.warn(
f"Use of argument `cosmo` has been deprecated in {name}. "
"This will trigger an exception in the future.",
CCLDeprecationWarning)
# `cosmo` may be in `args` or in `kwargs`, so we check both.
args = tuple(
item for item in args if not is_instance(item, "Cosmology"))
kwargs.pop("cosmo", None)

# API compatibility for reordered positionals in `fourier_2pt`.
first_arg = args[1] if len(args) > 1 else None
if (func.__name__ == "fourier_2pt"
and is_instance(first_arg, "HaloProfile")):
api = dict(zip(["prof", "cosmo", "k", "M", "a"], args[1: 6]))
args = (args[0],) + args[6:] # discard args [1-5]
kwargs.update(api) # they are now kwargs
warnings.warn(
"API for Profile2pt.fourier_2pt has changed. "
"Argument order (prof, cosmo, k, M, a) has been replaced by "
"(cosmo, k, M, a, prof).", CCLDeprecationWarning)

# API compatibility for renamed arguments.
warn_names = set(kwargs) - set(params)
if warn_names:
s = plural(warn_names)
warnings.warn(
f"Use of argument{s} {list(warn_names)} is deprecated "
f"in {name}. Pass the new name{s} of the argument{s} "
f"{[rename[k] for k in warn_names]}, respectively.",
CCLDeprecationWarning)
for param in warn_names:
kwargs[rename[param]] = kwargs.pop(param)

# API compatibility for star operator.
if len(args) > npos:
# API compatibility for shuffled order.
if reorder:
# Pick up the positions of the common elements.
mask = [param in reorder for param in kwo_names]
start = mask.index(True)
stop = start + len(reorder)
# Sort the reordered part of `kwo_names` by `reorder` indexing.
kwo_names[start: stop] = sorted(kwo_names[start: stop],
key=reorder.index)
extras = dict(zip(kwo_names, args[npos:]))
kwargs.update(extras)
s = plural(extras)
warnings.warn(
f"Use of argument{s} {list(extras)} as positional is "
f"deprecated in {func.__qualname__}.", CCLDeprecationWarning)

# API compatibility for `normprof` as a required argument.
if "normprof" in set(params) - set(kwargs):
kwargs["normprof"] = False
warnings.warn(
"Halo profile normalization `normprof` has become a required "
f"argument in {name}. Not specifying it will trigger an "
"exception in the future", CCLDeprecationWarning)

# Collect what's remaining and sort to preserve signature order.
pos = dict(zip(pos_names, args))
kwargs.update(pos)
kwargs = {param: kwargs[param]
for param in sorted(kwargs, key=list(params).index)}

return func(**kwargs)
return wrapper
36 changes: 19 additions & 17 deletions pyccl/halos/profiles/einasto.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from ...base import warn_api
from ...power import sigmaM
from ..concentration import Concentration
from ..massdef import MassDef
@@ -31,22 +32,24 @@ class HaloProfileEinasto(HaloProfile):
By default, this profile is truncated at :math:`r = R_\\Delta(M)`.

Args:
c_M_relation (:obj:`Concentration`): concentration-mass
c_m_relation (:obj:`Concentration`): concentration-mass
relation to use with this profile.
truncated (bool): set to `True` if the profile should be
truncated at :math:`r = R_\\Delta` (i.e. zero at larger
radii.
alpha (float, 'cosmo'): Set the Einasto alpha parameter or set to
'cosmo' to calculate the value from cosmology. Default: 'cosmo'
"""
__repr_attrs__ = ("cM", "truncated", "alpha", "precision_fftlog",)
__repr_attrs__ = ("c_m_relation", "truncated", "alpha",
"precision_fftlog",)
name = 'Einasto'

def __init__(self, c_M_relation, truncated=True, alpha='cosmo'):
if not isinstance(c_M_relation, Concentration):
raise TypeError("c_M_relation must be of type `Concentration`")
@warn_api(pairs=[("c_M_relation", "c_m_relation")])
def __init__(self, *, c_m_relation, truncated=True, alpha='cosmo'):
if not isinstance(c_m_relation, Concentration):
raise TypeError("c_m_relation must be of type `Concentration`")

self.cM = c_M_relation
self.c_m_relation = c_m_relation
self.truncated = truncated
self.alpha = alpha
super(HaloProfileEinasto, self).__init__()
@@ -68,19 +71,18 @@ def update_parameters(self, alpha=None):
if alpha is not None and alpha != self.alpha:
self.alpha = alpha

def _get_cM(self, cosmo, M, a, mdef=None):
return self.cM.get_concentration(cosmo, M, a, mdef_other=mdef)

def _get_alpha(self, cosmo, M, a, mdef):
def _get_alpha(self, cosmo, M, a, mass_def):
if self.alpha == 'cosmo':
mdef_vir = MassDef('vir', 'matter')
Mvir = mdef.translate_mass(cosmo, M, a, mdef_vir)
Mvir = mass_def.translate_mass(
cosmo, M, a, mass_def_other=MassDef('vir', 'matter'))
sM = sigmaM(cosmo, Mvir, a)
nu = 1.686 / sM
alpha = 0.155 + 0.0095 * nu * nu
else:
alpha = np.full_like(M, self.alpha)
return alpha
return 0.155 + 0.0095 * nu * nu
return np.full_like(M, self.alpha)

def _get_c_m_relation(self, cosmo, M, a, mass_def=None):
return self.c_m_relation.get_concentration(cosmo, M, a,
mass_def_other=mass_def)

def _norm(self, M, Rs, c, alpha):
# Einasto normalization from mass, radius, concentration and alpha
@@ -94,7 +96,7 @@ def _real(self, cosmo, r, M, a, mass_def):

# Comoving virial radius
R_M = mass_def.get_radius(cosmo, M_use, a) / a
c_M = self._get_cM(cosmo, M_use, a, mdef=mass_def)
c_M = self._get_c_m_relation(cosmo, M_use, a, mass_def=mass_def)
R_s = R_M / c_M

alpha = self._get_alpha(cosmo, M_use, a, mass_def)
14 changes: 8 additions & 6 deletions pyccl/halos/profiles/gaussian.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from ...base import warn_api
from .profile_base import HaloProfile
import numpy as np

@@ -14,19 +15,20 @@ class HaloProfileGaussian(HaloProfile):
Args:
r_scale (:obj:`function`): the width of the profile.
The signature of this function should be
`f(cosmo, M, a, mdef)`, where `cosmo` is a
`f(cosmo, M, a, mass_def)`, where `cosmo` is a
:class:`~pyccl.core.Cosmology` object, `M` is a halo mass in
units of M_sun, `a` is the scale factor and `mdef`
units of M_sun, `a` is the scale factor and `mass_def`
is a :class:`~pyccl.halos.massdef.MassDef` object.
rho0 (:obj:`function`): the amplitude of the profile.
It should have the same signature as `r_scale`.
"""
__repr_attrs__ = ("r_s", "rho_0", "precision_fftlog",)
__repr_attrs__ = ("r_scale", "rho_0", "precision_fftlog",)
name = 'Gaussian'

def __init__(self, r_scale, rho0):
@warn_api
def __init__(self, *, r_scale, rho0):
self.rho_0 = rho0
self.r_s = r_scale
self.r_scale = r_scale
super(HaloProfileGaussian, self).__init__()
self.update_precision_fftlog(padding_lo_fftlog=0.01,
padding_hi_fftlog=100.,
@@ -37,7 +39,7 @@ def _real(self, cosmo, r, M, a, mass_def):
M_use = np.atleast_1d(M)

# Compute scale
rs = self.r_s(cosmo, M_use, a, mass_def)
rs = self.r_scale(cosmo, M_use, a, mass_def)
# Compute normalization
rho0 = self.rho_0(cosmo, M_use, a, mass_def)
# Form factor
27 changes: 15 additions & 12 deletions pyccl/halos/profiles/hernquist.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from ...base import warn_api
from ..concentration import Concentration
from .profile_base import HaloProfile
import numpy as np
@@ -27,7 +28,7 @@ class HaloProfileHernquist(HaloProfile):
By default, this profile is truncated at :math:`r = R_\\Delta(M)`.

Args:
c_M_relation (:obj:`Concentration`): concentration-mass
c_m_relation (:obj:`Concentration`): concentration-mass
relation to use with this profile.
fourier_analytic (bool): set to `True` if you want to compute
the Fourier profile analytically (and not through FFTLog).
@@ -42,19 +43,20 @@ class HaloProfileHernquist(HaloProfile):
truncated at :math:`r = R_\\Delta` (i.e. zero at larger
radii.
"""
__repr_attrs__ = ("cM", "fourier_analytic", "projected_analytic",
__repr_attrs__ = ("c_m_relation", "fourier_analytic", "projected_analytic",
"cumul2d_analytic", "truncated", "precision_fftlog",)
name = 'Hernquist'

def __init__(self, c_M_relation,
@warn_api(pairs=[("c_M_relation", "c_m_relation")])
def __init__(self, *, c_m_relation,
truncated=True,
fourier_analytic=False,
projected_analytic=False,
cumul2d_analytic=False):
if not isinstance(c_M_relation, Concentration):
raise TypeError("c_M_relation must be of type `Concentration`")
if not isinstance(c_m_relation, Concentration):
raise TypeError("c_m_relation must be of type `Concentration`")

self.cM = c_M_relation
self.c_m_relation = c_m_relation
self.truncated = truncated
self.fourier_analytic = fourier_analytic
self.projected_analytic = projected_analytic
@@ -79,8 +81,9 @@ def __init__(self, c_M_relation,
n_per_decade=1000,
plaw_fourier=-2.)

def _get_cM(self, cosmo, M, a, mdef=None):
return self.cM.get_concentration(cosmo, M, a, mdef_other=mdef)
def _get_c_m_relation(self, cosmo, M, a, mass_def=None):
return self.c_m_relation.get_concentration(cosmo, M, a,
mass_def_other=mass_def)

def _norm(self, M, Rs, c):
# Hernquist normalization from mass, radius and concentration
@@ -92,7 +95,7 @@ def _real(self, cosmo, r, M, a, mass_def):

# Comoving virial radius
R_M = mass_def.get_radius(cosmo, M_use, a) / a
c_M = self._get_cM(cosmo, M_use, a, mdef=mass_def)
c_M = self._get_c_m_relation(cosmo, M_use, a, mass_def=mass_def)
R_s = R_M / c_M

norm = self._norm(M_use, R_s, c_M)
@@ -131,7 +134,7 @@ def _projected_analytic(self, cosmo, r, M, a, mass_def):

# Comoving virial radius
R_M = mass_def.get_radius(cosmo, M_use, a) / a
c_M = self._get_cM(cosmo, M_use, a, mdef=mass_def)
c_M = self._get_c_m_relation(cosmo, M_use, a, mass_def=mass_def)
R_s = R_M / c_M

x = r_use[None, :] / R_s[:, None]
@@ -170,7 +173,7 @@ def _cumul2d_analytic(self, cosmo, r, M, a, mass_def):

# Comoving virial radius
R_M = mass_def.get_radius(cosmo, M_use, a) / a
c_M = self._get_cM(cosmo, M_use, a, mdef=mass_def)
c_M = self._get_c_m_relation(cosmo, M_use, a, mass_def=mass_def)
R_s = R_M / c_M

x = r_use[None, :] / R_s[:, None]
@@ -190,7 +193,7 @@ def _fourier_analytic(self, cosmo, k, M, a, mass_def):

# Comoving virial radius
R_M = mass_def.get_radius(cosmo, M_use, a) / a
c_M = self._get_cM(cosmo, M_use, a, mdef=mass_def)
c_M = self._get_c_m_relation(cosmo, M_use, a, mass_def=mass_def)
R_s = R_M / c_M

x = k_use[None, :] * R_s[:, None]
Loading