diff --git a/.github/workflows/build_check.yml b/.github/workflows/build_check.yml index cd2c2d4fe..a87a0a0bc 100644 --- a/.github/workflows/build_check.yml +++ b/.github/workflows/build_check.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: conda-incubator/setup-miniconda@v2 - name: Install prereq using conda run: | @@ -33,10 +33,10 @@ jobs: pip install . - name: Install CCL from source run: | - conda install -c conda-forge cmake swig + conda install -c conda-forge cmake swig --override-channels git clone https://github.com/LSSTDESC/CCL cd CCL - git checkout 1a351df + git checkout v3.0.0 pip install . - name: Analysing the code with pylint run: | diff --git a/INSTALL.md b/INSTALL.md index 56d21be17..16df96a02 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -18,7 +18,7 @@ To create a specific conda environment for CLMM, we recommend you to check the b ### Theory backend installation First, choose and install a theory backend for CLMM. -This can be CCL (versions between 2.6.0 and 2.7.1.dev9+g1a351df6), +This can be CCL (versions between 2.7.1.dev10+gf81b59a4 and 3), NumCosmo (v0.15 or later), or cluster_toolkit and they are installable as follows. diff --git a/README.md b/README.md index 04228a536..e05debf93 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ CLMM requires Python version 3.8 or later. CLMM has the following dependencies: For the theoretical predictions of the signal, CLMM relies on existing libraries and **at least one of the following must be installed as well**: - [cluster-toolkit](https://cluster-toolkit.readthedocs.io/en/latest/) -- [CCL](https://ccl.readthedocs.io/en/latest/) (versions between 2.6.0 and 2.7.1.dev9+g1a351df6) +- [CCL](https://ccl.readthedocs.io/en/latest/) (versions between 2.7.1.dev10+gf81b59a4 and 3) - [NumCosmo](https://numcosmo.github.io/) (v0.15 or later) diff --git a/clmm/__init__.py b/clmm/__init__.py index f2e5e440d..4071ee026 100644 --- a/clmm/__init__.py +++ b/clmm/__init__.py @@ -26,4 +26,4 @@ ) from . import support -__version__ = "1.8.2" +__version__ = "1.9.0" diff --git a/clmm/cosmology/ccl.py b/clmm/cosmology/ccl.py index 1998bcd13..def7c9927 100644 --- a/clmm/cosmology/ccl.py +++ b/clmm/cosmology/ccl.py @@ -113,7 +113,7 @@ def _eval_sigma_crit_core(self, z_len, z_src): a_len = self.get_a_from_z(z_len) a_src = self.get_a_from_z(z_src) - return self.be_cosmo.sigma_critical(a_len, a_src) * self.cor_factor + return self.be_cosmo.sigma_critical(a_lens=a_len, a_source=a_src) * self.cor_factor def _eval_linear_matter_powerspectrum(self, k_vals, redshift): return ccl.linear_matter_power(self.be_cosmo, k_vals, self.get_a_from_z(redshift)) diff --git a/clmm/theory/_ccl_supported_versions.py b/clmm/theory/_ccl_supported_versions.py index 52ab799ff..9d6c62bf2 100644 --- a/clmm/theory/_ccl_supported_versions.py +++ b/clmm/theory/_ccl_supported_versions.py @@ -1,5 +1,5 @@ """@file _ccl_supported_versions.py Versions of CCL supported by the current CLMM version """ -VMIN = '2.6.0' -VMAX = '2.7.1.dev9+g1a351df6' +VMIN = "2.7.1.dev10+gf81b59a4" +VMAX = "3" diff --git a/clmm/theory/ccl.py b/clmm/theory/ccl.py index 654af72b2..e95271031 100644 --- a/clmm/theory/ccl.py +++ b/clmm/theory/ccl.py @@ -30,11 +30,11 @@ class CCLCLMModeling(CLMModeling): backend: str Name of the backend being used massdef : str - Profile mass definition (`mean`, `critical`, `virial` - letter case independent) + Profile mass definition ("mean", "critical", "virial" - letter case independent) delta_mdef : int Mass overdensity definition. halo_profile_model : str - Profile model parameterization (`nfw`, `einasto`, `hernquist` - letter case independent) + Profile model parameterization ("nfw", "einasto", "hernquist" - letter case independent) cosmo: Cosmology Cosmology object hdpm: Object @@ -94,12 +94,22 @@ def __init__( self.set_halo_density_profile(halo_profile_model, massdef, delta_mdef) self.set_cosmo(None) + def _set_projected_quad(self, use_projected_quad): + if hasattr(self.hdpm, "projected_quad"): + self.hdpm_opts["einasto"]["projected_quad"] = use_projected_quad + self._update_halo_density_profile() + else: + raise NotImplementedError("projected_quad is not available on this version of CCL.") + # Functions implemented by child class def _update_halo_density_profile(self): """updates halo density profile with set internal properties""" # prepare mdef object - self.mdef = ccl.halos.MassDef(self.delta_mdef, self.mdef_dict[self.massdef]) + if self.massdef == "virial": + self.mdef = ccl.halos.MassDef("vir", self.mdef_dict[self.massdef]) + else: + self.mdef = ccl.halos.MassDef(self.delta_mdef, self.mdef_dict[self.massdef]) # setting concentration (also updates hdpm) self.cdelta = self.cdelta if self.hdpm else 4.0 # ccl always needs an input concentration @@ -113,13 +123,9 @@ def _get_mass(self): def _set_concentration(self, cdelta): """set concentration. Also sets/updates hdpm""" - # pylint: disable=protected-access - self.conc = ccl.halos.ConcentrationConstant(c=cdelta, mdef=self.mdef) - if hasattr(ccl, 'UnlockInstance'): - ccl.UnlockInstance.Funlock(type(self.mdef), "_concentration_init", True) - self.mdef._concentration_init(self.conc) + self.conc = ccl.halos.ConcentrationConstant(c=cdelta, mass_def=self.mdef) self.hdpm = self.hdpm_dict[self.halo_profile_model]( - self.conc, **self.hdpm_opts[self.halo_profile_model] + concentration=self.conc, mass_def=self.mdef, **self.hdpm_opts[self.halo_profile_model] ) self.hdpm.update_precision_fftlog(padding_lo_fftlog=1e-4, padding_hi_fftlog=1e3) @@ -140,7 +146,7 @@ def _get_einasto_alpha(self, z_cl=None): a_cl = 1 # a_cl does not matter in this case else: a_cl = self.cosmo.get_a_from_z(z_cl) - return self.hdpm._get_alpha(self.cosmo.be_cosmo, self.__mdelta_cor, a_cl, self.mdef) + return self.hdpm._get_alpha(self.cosmo.be_cosmo, self.__mdelta_cor, a_cl) def _eval_3d_density(self, r3d, z_cl): """eval 3d density""" @@ -188,7 +194,6 @@ def _call_ccl_profile_lens(self, ccl_hdpm_func, radius, z_lens, ndim=2): radius / a_lens, self.__mdelta_cor, a_lens, - self.mdef, ) * self.cor_factor / a_lens**ndim @@ -203,9 +208,8 @@ def _call_ccl_profile_lens_src(self, ccl_hdpm_func, radius, z_lens, z_src): self.cosmo.be_cosmo, radius / a_lens, self.__mdelta_cor, - a_lens, - a_src, - self.mdef, + a_lens=a_lens, + a_source=a_src, ) diff --git a/clmm/theory/cluster_toolkit.py b/clmm/theory/cluster_toolkit.py index 2dd3a7d69..6b9e33400 100644 --- a/clmm/theory/cluster_toolkit.py +++ b/clmm/theory/cluster_toolkit.py @@ -25,7 +25,7 @@ def _assert_correct_type_ct(arg): Returns ------- - scale_factor : array_like + scale_factor : numpy.ndarray Scale factor """ if np.isscalar(arg): @@ -41,11 +41,11 @@ class CTCLMModeling(CLMModeling): backend: str Name of the backend being used massdef : str - Profile mass definition (`mean`, `critical`, `virial` - letter case independent) + Profile mass definition ("mean", "critical" - letter case independent) delta_mdef : int Mass overdensity definition. halo_profile_model : str - Profile model parameterization (`nfw`, `einasto`, `hernquist` - letter case independent) + Profile model parameterization ("nfw" - letter case independent) cosmo: Cosmology Cosmology object hdpm: Object @@ -85,7 +85,6 @@ def __init__( self.mdef_dict = { "mean": self.cosmo.get_E2Omega_m, "critical": self.cosmo.get_E2, - "virial": self.cosmo.get_E2, } self.set_halo_density_profile(halo_profile_model, massdef, delta_mdef) @@ -145,7 +144,7 @@ def _eval_surface_density(self, r_proj, z_cl): ) # pc**-2 to Mpc**-2 def _eval_mean_surface_density(self, r_proj, z_cl): - r"""Computes the mean value of surface density inside radius r_proj + r"""Computes the mean value of surface density inside radius `r_proj` Parameters ---------- @@ -156,7 +155,7 @@ def _eval_mean_surface_density(self, r_proj, z_cl): Returns ------- - array_like, float + numpy.ndarray, float Excess surface density in units of :math:`M_\odot\ Mpc^{-2}`. Note diff --git a/clmm/theory/func_layer.py b/clmm/theory/func_layer.py index c3695453b..0eb2d50c5 100644 --- a/clmm/theory/func_layer.py +++ b/clmm/theory/func_layer.py @@ -5,7 +5,7 @@ # pylint: disable=invalid-name # Thin functonal layer on top of the class implementation of CLMModeling . # The functions expect a global instance of the actual CLMModeling named -# `_modeling_object'. +# "_modeling_object". import numpy as np @@ -109,6 +109,7 @@ def compute_surface_density( massdef="mean", alpha_ein=None, verbose=False, + use_projected_quad=False, validate_input=True, ): r"""Computes the surface mass density @@ -154,6 +155,10 @@ def compute_surface_density( verbose : boolean, optional If True, the Einasto slope (alpha_ein) is printed out. Only available for the NC and CCL backends. + use_projected_quad : bool + Only available for Einasto profile with CCL as the backend. If True, CCL will use + quad_vec instead of default FFTLog to calculate the surface density profile. + Default: False validate_input : bool, optional If True (default), the types of the arguments are checked before proceeding. @@ -176,6 +181,8 @@ def compute_surface_density( _modeling_object.set_mass(mdelta) if halo_profile_model == "einasto" or alpha_ein is not None: _modeling_object.set_einasto_alpha(alpha_ein) + if halo_profile_model == "einasto" and _modeling_object.backend=="ccl": + _modeling_object.set_projected_quad(use_projected_quad) sigma = _modeling_object.eval_surface_density(r_proj, z_cl, verbose=verbose) @@ -358,7 +365,7 @@ def compute_excess_surface_density_2h( .. math:: \Delta\Sigma_{\text{2h}}(R) = \frac{\rho_m(z)b(M)}{(1 + z)^3D_A(z)^2} - \int\frac{ldl}{(2\pi)} P_{\rm mm}(k_l, z)J_2(l\theta) + \int\frac{ldl}{(2\pi)} P_{\text{mm}}(k_l, z)J_2(l\theta) where @@ -424,13 +431,13 @@ def compute_surface_density_2h( r"""Computes the 2-halo term surface density from eq.(13) of Oguri & Hamana (2011) .. math:: - \Sigma_{\rm 2h}(R) = \frac{\rho_m(z)b(M)}{(1 + z)^3D_A(z)^2} \int\frac{ldl}{(2\pi)} - P_{\rm mm}(k_l, z)J_0(l\theta) + \Sigma_{\text{2h}}(R) = \frac{\rho_\text{m}(z)b(M)}{(1 + z)^3D_A(z)^2} + \int\frac{ldl}{(2\pi)}P_{\text{mm}}(k_l, z)J_0(l\theta) where .. math:: - k_l = \frac{l}{D_A(z)(1 +z)} + k_l = \frac{l}{D_A(z)(1 + z)} and :math:`b(M)` is the halo bias @@ -481,14 +488,14 @@ def compute_critical_surface_density_eff(cosmo, z_cluster, pzbins, pzpdf, valida r"""Computes the 'effective critical surface density' .. math:: - \langle \Sigma_{\rm crit}^{-1}\rangle^{-1} = \left(\int \frac{1}{\Sigma_{\rm crit}(z)} - p(z) dz\right)^{-1} + \langle \Sigma_{\text{crit}}^{-1}\rangle^{-1} = + \left(\int \frac{1}{\Sigma_{\text{crit}}(z)}p(z) \mathrm{d}z\right)^{-1} where :math:`p(z)` is the source photoz probability density function. This comes from the maximum likelihood estimator for evaluating a :math:`\Delta\Sigma` profile. - For the standard :math:`\Sigma_{\rm crit}(z)` definition, use the `eval_sigma_crit` method of + For the standard :math:`\Sigma_{\text{crit}}(z)` definition, use the `eval_sigma_crit` method of the CLMM cosmology object. Parameters @@ -841,9 +848,9 @@ def compute_reduced_tangential_shear( massdef : str, optional Profile mass definition, with the following supported options (letter case independent): - * `mean` (default); - * `critical` - not in cluster_toolkit; - * `virial` - not in cluster_toolkit; + * 'mean' (default); + * 'critical' - not in cluster_toolkit; + * 'virial' - not in cluster_toolkit; alpha_ein : float, None, optional If `halo_profile_model=='einasto'`, set the value of the Einasto slope. diff --git a/clmm/theory/generic.py b/clmm/theory/generic.py index 4e6a68c4a..e28754d7c 100644 --- a/clmm/theory/generic.py +++ b/clmm/theory/generic.py @@ -85,7 +85,7 @@ def compute_rdelta(mdelta, redshift, cosmo, massdef="mean", delta_mdef=200): cosmo : clmm.Cosmology Cosmology object massdef : str, None - Profile mass definition (`mean`, `critical`, `virial`). + Profile mass definition ("mean", "critical", "virial"). delta_mdef : int, None Mass overdensity definition. @@ -151,11 +151,11 @@ def compute_profile_mass_in_radius( cdelta : float Concentration of the profile. massdef : str, None - Profile mass definition (`mean`, `critical`, `virial`). + Profile mass definition ("mean", "critical", "virial"). delta_mdef : int, None Mass overdensity definition. halo_profile_model : str - Profile model parameterization (`nfw`, `einasto`, `hernquist`). + Profile model parameterization ("nfw", "einasto", "hernquist"). alpha : float, None Einasto slope, required when `halo_profile_model='einasto'`. @@ -209,19 +209,19 @@ def convert_profile_mass_concentration( cosmo : clmm.Cosmology Cosmology object massdef : str, None - Input profile mass definition (`mean`, `critical`, `virial`). + Input profile mass definition ("mean", "critical", "virial"). delta_mdef : int, None Input mass overdensity definition. halo_profile_model : str, None - Input profile model parameterization (`nfw`, `einasto`, `hernquist`). + Input profile model parameterization ("nfw", "einasto", "hernquist"). massdef2 : str, None - Profile mass definition to convert to (`mean`, `critical`, `virial`). + Profile mass definition to convert to ("mean", "critical", "virial"). If None, `massdef2=massdef`. delta_mdef2 : int, None Mass overdensity definition to convert to. If None, `delta_mdef2=delta_mdef`. halo_profile_model2 : str, None - Profile model parameterization to convert to (`nfw`, `einasto`, `hernquist`). + Profile model parameterization to convert to ("nfw", "einasto", "hernquist"). If None, `halo_profile_model2=halo_profile_model`. alpha : float, None Input Einasto slope when `halo_profile_model='einasto'`. diff --git a/clmm/theory/numcosmo.py b/clmm/theory/numcosmo.py index 556c22bd5..8902abee4 100644 --- a/clmm/theory/numcosmo.py +++ b/clmm/theory/numcosmo.py @@ -23,11 +23,11 @@ class NumCosmoCLMModeling(CLMModeling): backend: str Name of the backend being used massdef : str - Profile mass definition (`mean`, `critical`, `virial` - letter case independent) + Profile mass definition ("mean", "critical", "virial" - letter case independent) delta_mdef : int Mass overdensity definition. halo_profile_model : str - Profile model parameterization (`nfw`, `einasto`, `hernquist` - letter case independent) + Profile model parameterization ("nfw", "einasto", "hernquist" - letter case independent) cosmo: Cosmology Cosmology object hdpm: Object diff --git a/clmm/theory/parent_class.py b/clmm/theory/parent_class.py index 404b1577d..d27b8f7c6 100644 --- a/clmm/theory/parent_class.py +++ b/clmm/theory/parent_class.py @@ -45,11 +45,11 @@ class CLMModeling: cdelta: float Concentration of the profile massdef : str - Profile mass definition (`mean`, `critical`, `virial` - letter case independent) + Profile mass definition ("mean", "critical", "virial" - letter case independent) delta_mdef : int Mass overdensity definition. halo_profile_model : str - Profile model parameterization (`nfw`, `einasto`, `hernquist` - letter case independent) + Profile model parameterization ("nfw", "einasto", "hernquist" - letter case independent) cosmo: Cosmology Cosmology object hdpm: Object @@ -181,6 +181,10 @@ def _get_einasto_alpha(self, z_cl=None): if defined""" raise NotImplementedError + def _set_projected_quad(self, use_projected_quad): + """Implemented for the CCL backend only""" + raise NotImplementedError + def _eval_3d_density(self, r3d, z_cl): raise NotImplementedError @@ -376,17 +380,20 @@ def set_halo_density_profile(self, halo_profile_model="nfw", massdef="mean", del Parameters ---------- halo_profile_model: str - Halo mass profile, current options are 'nfw' (letter case independent) + Halo mass profile, supported options are 'nfw', 'einasto', 'hernquist' + (letter case independent) massdef: str - Mass definition, current options are 'mean' (letter case independent) + Mass definition, supported options are 'mean', 'critical', 'virial' + (letter case independent) delta_mdef: int Overdensity number """ # make case independent + validate_argument(locals(), "massdef", str) + validate_argument(locals(), "halo_profile_model", str) massdef, halo_profile_model = massdef.lower(), halo_profile_model.lower() + if self.validate_input: - validate_argument(locals(), "massdef", str) - validate_argument(locals(), "halo_profile_model", str) validate_argument(locals(), "delta_mdef", int, argmin=0) if massdef not in self.mdef_dict: raise ValueError( @@ -441,6 +448,22 @@ def get_einasto_alpha(self, z_cl=None): raise ValueError(f"Wrong profile model. Current profile = {self.halo_profile_model}") return self._get_einasto_alpha(z_cl) + def set_projected_quad(self, use_projected_quad): + r"""Control the use of quad_vec to calculate the surface density profile for + CCL Einasto profile. + + Parameters + ---------- + use_projected_quad : bool + Only available for Einasto profile with CCL as the backend. If True, CCL will use + quad_vec instead of default FFTLog to calculate the surface density profile. + """ + if self.halo_profile_model != "einasto" or self.backend != "ccl": + raise NotImplementedError("This option is only available for the CCL Einasto profile.") + if self.validate_input: + validate_argument(locals(), "use_projected_quad", bool) + self._set_projected_quad(use_projected_quad) + def eval_3d_density(self, r3d, z_cl, verbose=False): r"""Retrieve the 3d density :math:`\rho(r)`. @@ -476,8 +499,8 @@ def eval_critical_surface_density_eff(self, z_len, pzbins, pzpdf): This comes from the maximum likelihood estimator for evaluating a :math:`\Delta\Sigma` profile. - For the standard :math:`\Sigma_{\rm crit}(z)` definition, use the `eval_sigma_crit` method - of the CLMM cosmology object. + For the standard :math:`\Sigma_{\text{crit}}(z)` definition, use the `eval_sigma_crit` + method of the CLMM cosmology object. Parameters ---------- @@ -1691,13 +1714,13 @@ def convert_mass_concentration( z_cl: float Redshift of the cluster massdef : str, None - Profile mass definition to convert to (`mean`, `critical`, `virial`). + Profile mass definition to convert to ("mean", "critical", "virial"). If None, same value of current model is used. delta_mdef : int, None Mass overdensity definition to convert to. If None, same value of current model is used. halo_profile_model : str, None - Profile model parameterization to convert to (`nfw`, `einasto`, `hernquist`). + Profile model parameterization to convert to ("nfw", "einasto", "hernquist"). If None, same value of current model is used. alpha : float, None Einasto slope to convert to when `halo_profile_model='einasto'`. diff --git a/docs/conf.py b/docs/conf.py index a91ddf9e8..bfafb1750 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -20,7 +20,7 @@ # Fix for ccl sys.modules["pyccl"].Cosmology = MagicMock -sys.modules["pyccl"].__version__ = "2.6" +sys.modules["pyccl"].__version__ = "3" # Fix for numcosmo sys.modules["gi.repository"].NumCosmo.Distance = MagicMock diff --git a/examples/Paper_v1.0/gt_and_use_case.ipynb b/examples/Paper_v1.0/gt_and_use_case.ipynb index a27f93b03..31c94f3ea 100644 --- a/examples/Paper_v1.0/gt_and_use_case.ipynb +++ b/examples/Paper_v1.0/gt_and_use_case.ipynb @@ -100,6 +100,7 @@ " photoz_sigma_unscaled=0.05, # Photo-z errors to source redshifts\n", " field_size=field_size,\n", " ngal_density=20, # number of gal/arcmin2 for z in [0, infty]\n", + " pzpdf_type='individual_bins',\n", ")[\"ra\", \"dec\", \"e1\", \"e2\", \"z\", \"ztrue\", \"pzbins\", \"pzpdf\", \"id\"]\n", "print(f'Catalog table with the columns: {\", \".join(mock_galaxies.colnames)}')\n", "\n", diff --git a/examples/Paper_v1.0/mass_bias_from_models.ipynb b/examples/Paper_v1.0/mass_bias_from_models.ipynb index 4786f7ccb..00f5b00b6 100644 --- a/examples/Paper_v1.0/mass_bias_from_models.ipynb +++ b/examples/Paper_v1.0/mass_bias_from_models.ipynb @@ -150,20 +150,22 @@ "# CCL\n", "MDEF = \"matter\"\n", "mdef = ccl.halos.MassDef(Delta, MDEF)\n", - "conc = ccl.halos.ConcentrationConstant(cvir)\n", - "mdef.concentration = conc\n", + "conc = ccl.halos.ConcentrationConstant(cvir, mass_def=mdef)\n", + "\n", "ccl_nfw_num = ccl.halos.HaloProfileNFW(\n", - " conc, truncated=False, projected_analytic=False, cumul2d_analytic=False\n", + " mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_analytic=False, cumul2d_analytic=False\n", ")\n", "ccl_nfw_ana = ccl.halos.HaloProfileNFW(\n", - " conc, truncated=False, projected_analytic=True, cumul2d_analytic=True\n", + " mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_analytic=True, cumul2d_analytic=True\n", ")\n", "# ccl_nfw_num.update_precision_fftlog (n_per_decade = 1200)\n", - "ccl_ein = ccl.halos.HaloProfileEinasto(conc, truncated=False)\n", - "ccl_her = ccl.halos.HaloProfileHernquist(conc, truncated=False)\n", + "ccl_ein = ccl.halos.HaloProfileEinasto(mass_def=mdef, concentration=conc, truncated=False)\n", + "ccl_her = ccl.halos.HaloProfileHernquist(mass_def=mdef, concentration=conc, truncated=False)\n", "\n", "\n", - "alpha = ccl_ein._get_alpha(cosmo_ccl, Mvir, a, mdef)" + "alpha = ccl_ein._get_alpha(cosmo_ccl, Mvir, a)" ] }, { @@ -239,8 +241,8 @@ "\n", "\n", "# CCL\n", - "ccl_Sigma_nfw_ana = ccl_nfw_ana.projected(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", - "ccl_BarSigma_nfw_ana = ccl_nfw_ana.cumul2d(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_Sigma_nfw_ana = ccl_nfw_ana.projected(cosmo_ccl, r / a, Mvir, a) / a**2\n", + "ccl_BarSigma_nfw_ana = ccl_nfw_ana.cumul2d(cosmo_ccl, r / a, Mvir, a) / a**2\n", "ccl_DeltaSigma_nfw_ana = ccl_BarSigma_nfw_ana - ccl_Sigma_nfw_ana" ] }, @@ -262,8 +264,8 @@ "source": [ "def model_ref_nfw(r, logm, bias):\n", " m = 10.0**logm\n", - " tmp_Sigma = ccl_nfw_ana.projected(cosmo_ccl, r / a, m, a, mdef) / a**2\n", - " tmp_BarSigma = ccl_nfw_ana.cumul2d(cosmo_ccl, r / a, m, a, mdef) / a**2\n", + " tmp_Sigma = ccl_nfw_ana.projected(cosmo_ccl, r / a, m, a) / a**2\n", + " tmp_BarSigma = ccl_nfw_ana.cumul2d(cosmo_ccl, r / a, m, a) / a**2\n", " model = (tmp_BarSigma - tmp_Sigma) * (1 + bias)\n", " return model\n", "\n", @@ -346,8 +348,8 @@ "# CCL numerical\n", "def model_num_ccl(r, logm):\n", " m = 10.0**logm\n", - " tmp_Sigma = ccl_nfw_num.projected(cosmo_ccl, r / a, m, a, mdef) / a**2\n", - " tmp_BarSigma = ccl_nfw_num.cumul2d(cosmo_ccl, r / a, m, a, mdef) / a**2\n", + " tmp_Sigma = ccl_nfw_num.projected(cosmo_ccl, r / a, m, a) / a**2\n", + " tmp_BarSigma = ccl_nfw_num.cumul2d(cosmo_ccl, r / a, m, a) / a**2\n", " model = tmp_BarSigma - tmp_Sigma\n", " return model" ] @@ -543,9 +545,9 @@ ], "metadata": { "kernelspec": { - "display_name": "mydesc3", + "display_name": "Python 3 (ipykernel)", "language": "python", - "name": "mydesc3" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -557,7 +559,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.6" + "version": "3.11.5" } }, "nbformat": 4, diff --git a/examples/Paper_v1.0/validation_tests.ipynb b/examples/Paper_v1.0/validation_tests.ipynb index 74a6735cd..6d8ddb9c3 100644 --- a/examples/Paper_v1.0/validation_tests.ipynb +++ b/examples/Paper_v1.0/validation_tests.ipynb @@ -2,7 +2,9 @@ "cells": [ { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "jp-MarkdownHeadingCollapsed": true + }, "source": [ "# Validation tests for the CLMM backends\n", "\n", @@ -161,28 +163,34 @@ "\n", "# CCL\n", "MDEF = \"matter\"\n", - "conc = ccl.halos.ConcentrationConstant(cvir)\n", - "mdef = ccl.halos.MassDef(Delta, \"matter\", c_m_relation=conc)\n", + "mdef = ccl.halos.MassDef(Delta, MDEF)\n", + "conc = ccl.halos.ConcentrationConstant(cvir, mass_def=mdef)\n", "# mdef.concentration = conc\n", "\n", "ccl_nfw_num_opt = ccl.halos.HaloProfileNFW(\n", - " conc, truncated=False, projected_analytic=False, cumul2d_analytic=False, fourier_analytic=False\n", + " mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_analytic=False, cumul2d_analytic=False, fourier_analytic=False\n", ")\n", "ccl_nfw_num = ccl.halos.HaloProfileNFW(\n", - " conc, truncated=False, projected_analytic=False, cumul2d_analytic=False\n", + " mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_analytic=False, cumul2d_analytic=False\n", ")\n", "ccl_nfw_ana = ccl.halos.HaloProfileNFW(\n", - " conc, truncated=False, projected_analytic=True, cumul2d_analytic=True\n", + " mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_analytic=True, cumul2d_analytic=True\n", ")\n", "\n", "# ccl_nfw_num.update_precision_fftlog (n_per_decade = 10000)\n", "# ccl_nfw_num.update_precision_fftlog (plaw_fourier = -2)\n", "\n", - "ccl_ein = ccl.halos.HaloProfileEinasto(conc, truncated=False)\n", - "ccl_her = ccl.halos.HaloProfileHernquist(conc, truncated=False)\n", + "ccl_ein = ccl.halos.HaloProfileEinasto(mass_def=mdef, concentration=conc,\n", + " truncated=False)\n", + "ccl_ein_quad = ccl.halos.HaloProfileEinasto(mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_quad=True)\n", + "ccl_her = ccl.halos.HaloProfileHernquist(mass_def=mdef, concentration=conc, truncated=False)\n", "\n", "\n", - "alpha = ccl_ein._get_alpha(cosmo_ccl, Mvir, a, mdef)\n", + "alpha = ccl_ein._get_alpha(cosmo_ccl, Mvir, a)\n", "\n", "# Colossus\n", "col_nfw = profile_nfw.NFWProfile(M=(Mvir * cosmo_col.h), c=cvir, z=z, mdef=\"200m\")\n", @@ -277,10 +285,11 @@ "nc_Sigma_her = smd.sigma_array(nc_her, cosmo, r, 1.0, 1.0, z)\n", "\n", "# CCL\n", - "ccl_Sigma_nfw_ana = ccl_nfw_ana.projected(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", - "ccl_Sigma_nfw_num = ccl_nfw_num.projected(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", - "ccl_Sigma_ein = ccl_ein.projected(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", - "ccl_Sigma_her = ccl_her.projected(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_Sigma_nfw_ana = ccl_nfw_ana.projected(cosmo_ccl, r / a, Mvir, a) / a**2\n", + "ccl_Sigma_nfw_num = ccl_nfw_num.projected(cosmo_ccl, r / a, Mvir, a) / a**2\n", + "ccl_Sigma_ein = ccl_ein.projected(cosmo_ccl, r / a, Mvir, a) / a**2\n", + "ccl_Sigma_ein_quad = ccl_ein.projected(cosmo_ccl, r / a, Mvir, a) / a**2\n", + "ccl_Sigma_her = ccl_her.projected(cosmo_ccl, r / a, Mvir, a) / a**2\n", "\n", "\n", "# CCL numerical NFW, using optimised setup\n", @@ -288,15 +297,15 @@ "# better by first evaluating the profile on a wider range and then\n", "# interpolating to the desired radii\n", "rtmp = np.geomspace(1.0e-4, 100, 1000)\n", - "tmp = ccl_nfw_num_opt.projected(cosmo_ccl, rtmp / a, Mvir, a, mdef) / a**2\n", + "tmp = ccl_nfw_num_opt.projected(cosmo_ccl, rtmp / a, Mvir, a) / a**2\n", "ptf = interp1d(np.log(rtmp), np.log(tmp), bounds_error=False, fill_value=-100)\n", "ccl_Sigma_nfw_num_opt = np.exp(ptf(np.log(r)))\n", "\n", - "tmp = ccl_ein.projected(cosmo_ccl, rtmp / a, Mvir, a, mdef) / a**2\n", + "tmp = ccl_ein.projected(cosmo_ccl, rtmp / a, Mvir, a) / a**2\n", "ptf = interp1d(np.log(rtmp), np.log(tmp), bounds_error=False, fill_value=-100)\n", "ccl_Sigma_ein_opt = np.exp(ptf(np.log(r)))\n", "\n", - "tmp = ccl_her.projected(cosmo_ccl, rtmp / a, Mvir, a, mdef) / a**2\n", + "tmp = ccl_her.projected(cosmo_ccl, rtmp / a, Mvir, a) / a**2\n", "ptf = interp1d(np.log(rtmp), np.log(tmp), bounds_error=False, fill_value=-100)\n", "ccl_Sigma_her_opt = np.exp(ptf(np.log(r)))\n", "\n", @@ -335,15 +344,15 @@ "nc_DeltaSigma_her = np.array(smd.sigma_excess_array(nc_her, cosmo, r, 1.0, 1.0, z))\n", "\n", "# CCL\n", - "ccl_BarSigma_nfw_ana = ccl_nfw_ana.cumul2d(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_BarSigma_nfw_ana = ccl_nfw_ana.cumul2d(cosmo_ccl, r / a, Mvir, a) / a**2\n", "ccl_DeltaSigma_nfw_ana = ccl_BarSigma_nfw_ana - ccl_Sigma_nfw_ana\n", "\n", "# CCL numerical NFW, using default setup\n", - "ccl_BarSigma_nfw_num = ccl_nfw_num.cumul2d(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_BarSigma_nfw_num = ccl_nfw_num.cumul2d(cosmo_ccl, r / a, Mvir, a) / a**2\n", "ccl_DeltaSigma_nfw_num = ccl_BarSigma_nfw_num - ccl_Sigma_nfw_num\n", - "ccl_BarSigma_ein = ccl_ein.cumul2d(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_BarSigma_ein = ccl_ein.cumul2d(cosmo_ccl, r / a, Mvir, a) / a**2\n", "ccl_DeltaSigma_ein = ccl_BarSigma_ein - ccl_Sigma_ein\n", - "ccl_BarSigma_her = ccl_her.cumul2d(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_BarSigma_her = ccl_her.cumul2d(cosmo_ccl, r / a, Mvir, a) / a**2\n", "ccl_DeltaSigma_her = ccl_BarSigma_her - ccl_Sigma_her\n", "\n", "\n", @@ -353,17 +362,17 @@ "# interpolating to the desired radii\n", "\n", "rtmp = np.geomspace(1.0e-4, 100, 1000) # extended radial range\n", - "tmp = ccl_nfw_num_opt.cumul2d(cosmo_ccl, rtmp / a, Mvir, a, mdef) / a**2 # CCL estimation\n", + "tmp = ccl_nfw_num_opt.cumul2d(cosmo_ccl, rtmp / a, Mvir, a) / a**2 # CCL estimation\n", "ptf = interp1d(np.log(rtmp), np.log(tmp), bounds_error=False, fill_value=-100) # interpolation\n", "ccl_BarSigma_nfw_num_opt = np.exp(ptf(np.log(r))) # evaluation on the desired radius array\n", "ccl_DeltaSigma_nfw_num_opt = ccl_BarSigma_nfw_num_opt - ccl_Sigma_nfw_num_opt\n", "\n", - "tmp = ccl_ein.cumul2d(cosmo_ccl, rtmp / a, Mvir, a, mdef) / a**2\n", + "tmp = ccl_ein.cumul2d(cosmo_ccl, rtmp / a, Mvir, a) / a**2\n", "ptf = interp1d(np.log(rtmp), np.log(tmp), bounds_error=False, fill_value=-100)\n", "ccl_BarSigma_ein_opt = np.exp(ptf(np.log(r)))\n", "ccl_DeltaSigma_ein_opt = ccl_BarSigma_ein_opt - ccl_Sigma_ein_opt\n", "\n", - "tmp = ccl_her.cumul2d(cosmo_ccl, rtmp / a, Mvir, a, mdef) / a**2\n", + "tmp = ccl_her.cumul2d(cosmo_ccl, rtmp / a, Mvir, a) / a**2\n", "ptf = interp1d(np.log(rtmp), np.log(tmp), bounds_error=False, fill_value=-100)\n", "ccl_BarSigma_her_opt = np.exp(ptf(np.log(r)))\n", "ccl_DeltaSigma_her_opt = ccl_BarSigma_her_opt - ccl_Sigma_her_opt\n", @@ -662,6 +671,14 @@ ")\n", "axs[0].plot(\n", " r,\n", + " np.abs(ccl_Sigma_ein_quad / nc_Sigma_ein - 1.0),\n", + " label=\"CCL - EIN (quad)\",\n", + " linestyle=\":\",\n", + " color=\"darkorange\",\n", + " lw=0.5,\n", + ")\n", + "axs[0].plot(\n", + " r,\n", " np.abs(ccl_Sigma_ein_opt / nc_Sigma_ein - 1.0),\n", " label=\"CCL - EIN (opt)\",\n", " linestyle=\"--\",\n", @@ -857,6 +874,13 @@ ")\n", "axs[1].plot(\n", " r,\n", + " np.abs(ccl_Sigma_ein_quad / col_Sigma_ein - 1.0),\n", + " label=\"EIN - CCL (quad)\",\n", + " color=\"cadetblue\",\n", + " linestyle=\"--\",\n", + ")\n", + "axs[1].plot(\n", + " r,\n", " np.abs(ct_Sigma_ein / col_Sigma_ein - 1.0),\n", " label=\"EIN - CT\",\n", " color=\"cadetblue\",\n", @@ -991,7 +1015,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -1005,7 +1029,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.8" + "version": "3.11.5" } }, "nbformat": 4, diff --git a/examples/demo_boost_factors.ipynb b/examples/demo_boost_factors.ipynb index 11a763a67..fda156a82 100644 --- a/examples/demo_boost_factors.ipynb +++ b/examples/demo_boost_factors.ipynb @@ -246,10 +246,10 @@ "metadata": {}, "outputs": [], "source": [ - "nfw_boost = u.compute_nfw_boost(cl.DeltaSigma_profile[\"radius\"], rs=1000, b0=0.1)\n", + "nfw_boost = u.compute_nfw_boost(cl.DeltaSigma_profile[\"radius\"], rscale=1000, boost0=0.1)\n", "\n", "powerlaw_boost = u.compute_powerlaw_boost(\n", - " cl.DeltaSigma_profile[\"radius\"], rs=1000, b0=0.1, alpha=-1.0\n", + " cl.DeltaSigma_profile[\"radius\"], rscale=1000, boost0=0.1, alpha=-1.0\n", ")" ] }, diff --git a/examples/demo_mass_conversion.ipynb b/examples/demo_mass_conversion.ipynb index 71308a80c..3cb6e9aa8 100644 --- a/examples/demo_mass_conversion.ipynb +++ b/examples/demo_mass_conversion.ipynb @@ -21,9 +21,6 @@ "os.environ[\n", " \"CLMM_MODELING_BACKEND\"\n", "] = \"ccl\" # here you may choose ccl, nc (NumCosmo) or ct (cluster_toolkit)\n", - "import warnings\n", - "\n", - "warnings.filterwarnings(\"ignore\", message=\".*(!).*\")\n", "import clmm\n", "import numpy as np\n", "import matplotlib.pyplot as plt" diff --git a/examples/demo_mock_cluster.ipynb b/examples/demo_mock_cluster.ipynb index 098284eb0..55a4e2bf6 100644 --- a/examples/demo_mock_cluster.ipynb +++ b/examples/demo_mock_cluster.ipynb @@ -24,9 +24,6 @@ "metadata": {}, "outputs": [], "source": [ - "import warnings\n", - "\n", - "warnings.filterwarnings(\"ignore\", message=\".*(!).*\")\n", "import os\n", "\n", "## Uncomment the following line if you want to use a specific modeling backend among 'ct' (cluster-toolkit), 'ccl' (CCL) or 'nc' (Numcosmo). Default is 'ccl'\n", diff --git a/examples/demo_mock_ensemble_realistic.ipynb b/examples/demo_mock_ensemble_realistic.ipynb index ddd35401c..bb0f9147f 100644 --- a/examples/demo_mock_ensemble_realistic.ipynb +++ b/examples/demo_mock_ensemble_realistic.ipynb @@ -133,7 +133,7 @@ " n_s=0.96,\n", " Neff=3.04,\n", " m_nu=1.0e-05,\n", - " m_nu_type=\"single\",\n", + " mass_split=\"single\",\n", ")\n", "hmd_200c = ccl.halos.MassDef(200, \"critical\")\n", "\n", @@ -141,8 +141,8 @@ "# For a different multiplicty function, the user must change this function below\n", "def tinker08_ccl(logm, z):\n", " mass = 10 ** (logm)\n", - " hmf_200c = ccl.halos.MassFuncTinker08(cosmo, mass_def=hmd_200c)\n", - " nm = hmf_200c.get_mass_function(cosmo, mass, 1.0 / (1 + z))\n", + " hmf_200c = ccl.halos.MassFuncTinker08(mass_def=hmd_200c)\n", + " nm = hmf_200c(cosmo, mass, 1.0 / (1 + z))\n", " return nm # dn/dlog10M\n", "\n", "\n", @@ -633,12 +633,12 @@ "cluster_z = ran_z[indices]\n", "\n", "# Concentration CCL object to compute the theoretical concentration\n", - "conc_obj = ccl.halos.ConcentrationDuffy08(hmd_200c)\n", + "conc_obj = ccl.halos.ConcentrationDuffy08(mass_def=hmd_200c)\n", "conc_list = []\n", "for number in range(0, len(cluster_m)):\n", " a = 1.0 / (1.0 + (cluster_z[number]))\n", " # mean value of the concentration for that cluster\n", - " lnc_mean = np.log(conc_obj.get_concentration(cosmo, M=(cluster_m[number]), a=a))\n", + " lnc_mean = np.log(conc_obj(cosmo, M=(cluster_m[number]), a=a))\n", " # random draw of actual concentration from normal distribution around lnc_mean, with a 0.14 scatter\n", " lnc = np.random.normal(lnc_mean, 0.14)\n", " conc_list.append(np.exp(lnc))\n", @@ -1179,9 +1179,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3.11", "language": "python", - "name": "python3" + "name": "python3.11" }, "language_info": { "codemirror_mode": { @@ -1193,7 +1193,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.8" + "version": "3.11.4" } }, "nbformat": 4, diff --git a/examples/demo_theory_functionality.ipynb b/examples/demo_theory_functionality.ipynb index c800d5811..5bb640cce 100644 --- a/examples/demo_theory_functionality.ipynb +++ b/examples/demo_theory_functionality.ipynb @@ -47,9 +47,6 @@ "metadata": {}, "outputs": [], "source": [ - "import warnings\n", - "\n", - "warnings.filterwarnings(\"ignore\", message=\".*(!).*\")\n", "import os\n", "\n", "os.environ[\n", @@ -351,7 +348,9 @@ { "cell_type": "code", "execution_count": null, - "metadata": {}, + "metadata": { + "scrolled": true + }, "outputs": [], "source": [ "plot_profile(r3d, kappa, \"$\\\\kappa$\")" @@ -437,10 +436,10 @@ "## Side note regarding the Einasto profile (CCL and NC backends only)\n", "\n", "The Einasto profile is supported by both the CCL and NumCosmo backends. The value of the slope of the Einasto profile can be defined by the user, using the `alpha_ein` keyword. If `alpha_ein` is not provided, both backend revert to a default value for the Einasto slope:\n", - "- In CCL, the default Einasto slope depends on cosmology, redshift and halo mass. \n", + "- In CCL, the default Einasto slope depends on cosmology, redshift and halo mass.\n", "- In NumCosmo, the default value is $\\alpha_{\\rm ein}=0.25$.\n", "\n", - "**NB: for CCL, setting a user-defined value for the Einasto slope is only available for CCL version >= 2.6.** Earlier versions only allow the default option.\n", + "**NB: for CCL, setting a user-defined value for the Einasto slope is only available for versions >= 2.6.** Earlier versions only allow the default option.\n", "\n", "The verbose option allows to print the value of $\\alpha$ that is being used, as follows:" ] @@ -462,8 +461,8 @@ " verbose=True,\n", ")\n", "\n", - "# For CCL < 2.6, the above call will return an error, as alpha_ein could not be set. The call below, not specifying alpha_ein,\n", - "# will use the default value (for both backend)\n", + "# For CCL < 2.6, the above call will return an error, as alpha_ein can not be set. The call below, not specifying alpha_ein,\n", + "# will use the default value (for both CCL and NC backends)\n", "\n", "# rho = m.compute_3d_density(r3d, mdelta=cluster_mass, cdelta=cluster_concentration,\n", "# z_cl=z_cl, cosmo=cosmo, halo_profile_model='einasto',\n", @@ -472,13 +471,66 @@ "\n", "plot_profile(r3d, rho, \"$\\\\rho_{\\\\rm 3d}$\")" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Side note regarding the Einasto profile (CCL backend only)\n", + "\n", + "For CCL versions >= 2.8.1.dev73+g86125b08, the surface mass density profile can be calculated with the quad_vec numerial integration in addition to the default FFTLog. This option will increase the precision of the profile at large radii and can be enabled by passing `use_projected_quad` keyword argument to `compute_surface_density`." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# use quad_vec\n", + "Sigma_quad = m.compute_surface_density(\n", + " r3d,\n", + " mdelta=cluster_mass,\n", + " cdelta=cluster_concentration,\n", + " z_cl=z_cl,\n", + " cosmo=cosmo,\n", + " halo_profile_model=\"einasto\",\n", + " alpha_ein=0.17,\n", + " use_projected_quad=True, # use quad_vec\n", + " verbose=True,\n", + ")\n", + "\n", + "plot_profile(r3d, Sigma_quad, \"$\\\\Sigma_{\\\\rm quad}$\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# default behavior\n", + "Sigma_FFTLog = m.compute_surface_density(\n", + " r3d,\n", + " mdelta=cluster_mass,\n", + " cdelta=cluster_concentration,\n", + " z_cl=z_cl,\n", + " cosmo=cosmo,\n", + " halo_profile_model=\"einasto\",\n", + " alpha_ein=0.17,\n", + " use_projected_quad=False, # default\n", + " verbose=True,\n", + ")\n", + "\n", + "plot_profile(r3d, Sigma_FFTLog, \"$\\\\Sigma_{\\\\rm FFTLog}$\")" + ] } ], "metadata": { "kernelspec": { - "display_name": "wrk", + "display_name": "Python 3 (ipykernel)", "language": "python", - "name": "wrk" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -490,7 +542,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.11.5" } }, "nbformat": 4, diff --git a/examples/demo_theory_functionality_diff_z_types.ipynb b/examples/demo_theory_functionality_diff_z_types.ipynb index fd50854f8..61f3e275e 100644 --- a/examples/demo_theory_functionality_diff_z_types.ipynb +++ b/examples/demo_theory_functionality_diff_z_types.ipynb @@ -28,9 +28,6 @@ "metadata": {}, "outputs": [], "source": [ - "import warnings\n", - "\n", - "warnings.filterwarnings(\"ignore\", message=\".*(!).*\")\n", "import os\n", "\n", "## Uncomment the following line if you want to use a specific modeling backend among 'ct' (cluster-toolkit), 'ccl' (CCL) or 'nc' (Numcosmo). Default is 'ccl'\n", diff --git a/examples/demo_theory_functionality_oo.ipynb b/examples/demo_theory_functionality_oo.ipynb index 27ad45bd9..3e8083c3a 100644 --- a/examples/demo_theory_functionality_oo.ipynb +++ b/examples/demo_theory_functionality_oo.ipynb @@ -16,17 +16,6 @@ "This notebook goes through the steps to generate model data for galaxy cluster weak lensing observables. In particular, we define a galaxy cluster model that follows and NFW distribution and generate various profiles for the model (mass density, convergence, shear, etc.), which we plot. Note, a full pipeline to measure a galaxy cluster weak lensing mass requires fitting the observed (or mock) data to a model. In this notebook we use the OO interface to theory." ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "import warnings\n", - "\n", - "warnings.filterwarnings(\"ignore\", message=\".*(!).*\")" - ] - }, { "cell_type": "code", "execution_count": null, @@ -285,7 +274,7 @@ "## Side note regarding the Einasto profile (CCL and NC backends only)\n", "\n", "The Einasto profile is supported by both the CCL and NumCosmo backends. The value of the slope of the Einasto profile $\\alpha_{\\rm ein}$ can be defined by the user, using the `set_einasto_alpha` method. If $\\alpha_{\\rm ein}$ is not provided, both backend revert to a default value for the Einasto slope:\n", - "- In CCL, the default Einasto slope depends on cosmology, redshift and halo mass. \n", + "- In CCL, the default Einasto slope depends on cosmology, redshift and halo mass.\n", "- In NumCosmo, the default value is $\\alpha=0.25$.\n", "\n", "**NB: for CCL, setting a user-defined value for the Einasto slope is only available for CCL version >= 2.6.** Earlier versions only allow the default option.\n", @@ -313,19 +302,50 @@ "plot_profile(r3d, rho, \"$\\\\rho_{\\\\rm 3d}$\")" ] }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Side note regarding the Einasto profile (CCL backend only)\n", + "\n", + "For CCL versions >= 2.8.1.dev73+g86125b08, the surface mass density profile can be calculated with the quad_vec numerial integration in addition to the default FFTLog. This option will increase the precision of the profile at large radii and can be enabled by calling `set_projected_quad(True)`." + ] + }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], - "source": [] + "source": [ + "# use quad_vec\n", + "moo_ein.set_projected_quad(True)\n", + "\n", + "Sigma_quad = moo_ein.eval_surface_density(r3d, z_cl, verbose=True)\n", + "\n", + "plot_profile(r3d, Sigma_quad, \"$\\\\Sigma_{\\\\rm quad}$\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# revert the effect from the previous cell\n", + "moo_ein.set_projected_quad(False)\n", + "\n", + "# default behavior\n", + "Sigma_FFTLog = moo_ein.eval_surface_density(r3d, z_cl, verbose=True)\n", + "\n", + "plot_profile(r3d, Sigma_FFTLog, \"$\\\\Sigma_{\\\\rm FFTLog}$\")" + ] } ], "metadata": { "kernelspec": { - "display_name": "wrk", + "display_name": "Python 3 (ipykernel)", "language": "python", - "name": "wrk" + "name": "python3" }, "language_info": { "codemirror_mode": { @@ -337,7 +357,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.9" + "version": "3.11.5" } }, "nbformat": 4, diff --git a/examples/other_compare_NFW_critical_massdef.ipynb b/examples/other_compare_NFW_critical_massdef.ipynb index 0ce2798d5..79224581b 100644 --- a/examples/other_compare_NFW_critical_massdef.ipynb +++ b/examples/other_compare_NFW_critical_massdef.ipynb @@ -163,18 +163,22 @@ "\n", "# CCL\n", "MDEF = \"critical\"\n", - "conc = ccl.halos.ConcentrationConstant(cvir)\n", - "mdef = ccl.halos.MassDef(Delta, \"critical\", c_m_relation=conc)\n", + "mdef = ccl.halos.MassDef(Delta, MDEF)\n", + "conc = ccl.halos.ConcentrationConstant(cvir, mass_def=mdef)\n", + "\n", "# mdef.concentration = conc\n", "\n", "ccl_nfw_num_opt = ccl.halos.HaloProfileNFW(\n", - " conc, truncated=False, projected_analytic=False, cumul2d_analytic=False, fourier_analytic=False\n", + " mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_analytic=False, cumul2d_analytic=False, fourier_analytic=False\n", ")\n", "ccl_nfw_num = ccl.halos.HaloProfileNFW(\n", - " conc, truncated=False, projected_analytic=False, cumul2d_analytic=False\n", + " mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_analytic=False, cumul2d_analytic=False\n", ")\n", "ccl_nfw_ana = ccl.halos.HaloProfileNFW(\n", - " conc, truncated=False, projected_analytic=True, cumul2d_analytic=True\n", + " mass_def=mdef, concentration=conc,\n", + " truncated=False, projected_analytic=True, cumul2d_analytic=True\n", ")\n", "\n", "# Colossus\n", @@ -243,15 +247,15 @@ "nc_Sigma_nfw_num = smd.sigma_array(nc_nfw, cosmo, r, 1.0, 1.0, z)\n", "\n", "# CCL\n", - "ccl_Sigma_nfw_ana = ccl_nfw_ana.projected(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", - "ccl_Sigma_nfw_num = ccl_nfw_num.projected(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_Sigma_nfw_ana = ccl_nfw_ana.projected(cosmo_ccl, r / a, Mvir, a) / a**2\n", + "ccl_Sigma_nfw_num = ccl_nfw_num.projected(cosmo_ccl, r / a, Mvir, a) / a**2\n", "\n", "# CCL numerical NFW, using optimised setup\n", "# When using fourier_analytic=False in CCL profile definition, CCL performs\n", "# better by first evaluating the profile on a wider range and then\n", "# interpolating to the desired radii\n", "rtmp = np.geomspace(1.0e-4, 100, 1000)\n", - "tmp = ccl_nfw_num_opt.projected(cosmo_ccl, rtmp / a, Mvir, a, mdef) / a**2\n", + "tmp = ccl_nfw_num_opt.projected(cosmo_ccl, rtmp / a, Mvir, a) / a**2\n", "ptf = interp1d(np.log(rtmp), np.log(tmp), bounds_error=False, fill_value=-100)\n", "ccl_Sigma_nfw_num_opt = np.exp(ptf(np.log(r)))\n", "\n", @@ -292,11 +296,11 @@ "nc_DeltaSigma_nfw_num = np.array(smd.sigma_excess_array(nc_nfw, cosmo, r, 1.0, 1.0, z))\n", "\n", "# CCL\n", - "ccl_BarSigma_nfw_ana = ccl_nfw_ana.cumul2d(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_BarSigma_nfw_ana = ccl_nfw_ana.cumul2d(cosmo_ccl, r / a, Mvir, a) / a**2\n", "ccl_DeltaSigma_nfw_ana = ccl_BarSigma_nfw_ana - ccl_Sigma_nfw_ana\n", "\n", "# CCL numerical NFW, using default setup\n", - "ccl_BarSigma_nfw_num = ccl_nfw_num.cumul2d(cosmo_ccl, r / a, Mvir, a, mdef) / a**2\n", + "ccl_BarSigma_nfw_num = ccl_nfw_num.cumul2d(cosmo_ccl, r / a, Mvir, a) / a**2\n", "ccl_DeltaSigma_nfw_num = ccl_BarSigma_nfw_num - ccl_Sigma_nfw_num\n", "\n", "# CCL numerical NFW, using optimised setup\n", @@ -304,7 +308,7 @@ "# better by first evaluating the profile on a wider range and then\n", "# interpolating to the desired radii\n", "rtmp = np.geomspace(1.0e-4, 100, 1000) # extended radial range\n", - "tmp = ccl_nfw_num_opt.cumul2d(cosmo_ccl, rtmp / a, Mvir, a, mdef) / a**2 # CCL estimation\n", + "tmp = ccl_nfw_num_opt.cumul2d(cosmo_ccl, rtmp / a, Mvir, a) / a**2 # CCL estimation\n", "ptf = interp1d(np.log(rtmp), np.log(tmp), bounds_error=False, fill_value=-100) # interpolation\n", "ccl_BarSigma_nfw_num_opt = np.exp(ptf(np.log(r))) # evaluation on the desired radius array\n", "ccl_DeltaSigma_nfw_num_opt = ccl_BarSigma_nfw_num_opt - ccl_Sigma_nfw_num_opt\n", @@ -716,7 +720,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.9.12" + "version": "3.11.5" } }, "nbformat": 4, diff --git a/setup.py b/setup.py index 37a2745a0..6d1a6c9a3 100644 --- a/setup.py +++ b/setup.py @@ -41,5 +41,5 @@ def get_version(rel_path): "Programming Language :: Python", ], install_requires=["astropy>=4.0", "numpy", "scipy", "healpy"], - python_requires=">" + str(required_py_version), + python_requires=">=" + str(required_py_version), ) diff --git a/tests/data/numcosmo/generate_einasto_hernquist_benchmarks_fromNC.ipynb b/tests/data/numcosmo/generate_einasto_hernquist_benchmarks_fromNC.ipynb index d7c41f1ea..aeaf5e279 100644 --- a/tests/data/numcosmo/generate_einasto_hernquist_benchmarks_fromNC.ipynb +++ b/tests/data/numcosmo/generate_einasto_hernquist_benchmarks_fromNC.ipynb @@ -116,16 +116,16 @@ "metadata": {}, "outputs": [], "source": [ + "mdef = ccl.halos.MassDef(mass_Delta, 'matter')\n", + "conc = ccl.halos.ConcentrationConstant(c=cluster_concentration, mass_def=mdef)\n", "ccl_ein = ccl.halos.HaloProfileEinasto(\n", - " ccl.halos.ConcentrationConstant(cluster_concentration), truncated=False\n", + " mass_def=mdef,\n", + " concentration=conc\n", ")\n", "alpha_einasto = ccl_ein._get_alpha(\n", " cosmo_ccl.be_cosmo,\n", " cluster_mass,\n", - " 1 / (1 + z_cluster),\n", - " ccl.halos.massdef.MassDef(\n", - " mass_Delta, \"matter\", ccl.halos.ConcentrationConstant(cluster_concentration)\n", - " ),\n", + " 1 / (1 + z_cluster)\n", ")\n", "print(alpha_einasto)" ] @@ -667,9 +667,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3 (ipykernel)", + "display_name": "Python 3.11", "language": "python", - "name": "python3" + "name": "python3.11" }, "language_info": { "codemirror_mode": { @@ -681,7 +681,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.8.10" + "version": "3.11.4" } }, "nbformat": 4, diff --git a/tests/data/numcosmo/radial_profiles_einasto.txt b/tests/data/numcosmo/radial_profiles_einasto.txt index fc4278950..6a51529a6 100644 --- a/tests/data/numcosmo/radial_profiles_einasto.txt +++ b/tests/data/numcosmo/radial_profiles_einasto.txt @@ -1,101 +1,101 @@ # r3d rho Sigma DeltaSigma gammat kappa gt mu -1.000000000000000021e-02 2.623669635761697600e+16 3.189196070450592500e+15 1.276027514275365000e+14 4.687611461572240013e-02 1.171582264943169527e+00 -2.731990665308467459e-01 3.670653746217076474e+01 -1.072267222010323158e-02 2.529093035647578800e+16 3.163569518777162000e+15 1.349153969309525000e+14 4.956248622548301702e-02 1.162168101376863882e+00 -3.056241381916684485e-01 4.194269668572388809e+01 -1.149756995397735633e-02 2.435596729001030400e+16 3.136611589052279000e+15 1.425186873425165000e+14 5.235562907547475914e-02 1.152264843105008874e+00 -3.438458150143563485e-01 4.891537361813954021e+01 -1.232846739442065853e-02 2.343257807453348000e+16 3.108282567296658000e+15 1.504117209231940000e+14 5.525521190307310093e-02 1.141857900810179904e+00 -3.895109936598458167e-01 5.858050446802359090e+01 -1.321941148466028795e-02 2.252152478078229600e+16 3.078544381651209000e+15 1.585924159268260000e+14 5.826046995853354643e-02 1.130933288423813465e+00 -4.449630087190075689e-01 7.273127343561974101e+01 -1.417474162926805545e-02 2.162355818454726400e+16 3.047360932014807000e+15 1.670568495043020000e+14 6.136996214499520347e-02 1.119477744221855531e+00 -5.136518315163234316e-01 9.515961926913431057e+01 -1.519911082952933937e-02 2.073941526177878000e+16 3.014698448768282500e+15 1.757996073026140000e+14 6.458169944710116794e-02 1.107478862605516090e+00 -6.008781436787062891e-01 1.354846488476142667e+02 -1.629750834620644420e-02 1.986981663917872800e+16 2.980525862127245000e+15 1.848134481612495000e+14 6.789302175394992811e-02 1.094925229786629428e+00 -7.152263092389454791e-01 2.272036962235203532e+02 -1.747528400007683849e-02 1.901546401236826400e+16 2.944815185225114000e+15 1.940890326809820000e+14 7.130049814619464355e-02 1.081806564516939240e+00 -8.715742870663030217e-01 6.216767638485522411e+02 -1.873817422860384052e-02 1.817703754478220800e+16 2.907541904333967500e+15 2.036152523729590000e+14 7.480004781216917364e-02 1.068113861439532464e+00 -1.098161904659774590e+00 -1.046518771919829305e+03 -2.009233002565046985e-02 1.735519326146843600e+16 2.868685386511499000e+15 2.133785650990380000e+14 7.838669591541733150e-02 1.053839540841921663e+00 -1.455931731393632633e+00 -3.080925494466385430e+02 -2.154434690031884619e-02 1.655056045294933200e+16 2.828229300832023500e+15 2.233633106312910000e+14 8.205468951855299231e-02 1.038977603399361627e+00 -2.105175340767534209e+00 -1.918016860705505735e+02 -2.310129700083160542e-02 1.576373910521795400e+16 2.786162038713962000e+15 2.335514940323845000e+14 8.579741800593103374e-02 1.023523784586248375e+00 -3.647262526629580837e+00 -1.468897168460559328e+02 -2.477076355991711387e-02 1.499529737277655800e+16 2.742477134074154000e+15 2.439224672885610000e+14 8.960729612841962510e-02 1.007475709023901045e+00 -1.198646119611277783e+01 -1.254141599770154301e+02 -2.656087782946686682e-02 1.424576911236377400e+16 2.697173674733401000e+15 2.544533472946065000e+14 9.347591755425260773e-02 9.908330416143988906e-01 1.019704831442042980e+01 -1.155573197559476739e+02 -2.848035868435801893e-02 1.351565149563965400e+16 2.650256718901206500e+15 2.651184282870765000e+14 9.739383902064741028e-02 9.735976405403109490e-01 3.688830885336158438e+00 -1.137853798902582696e+02 -3.053855508833415444e-02 1.280540271958951800e+16 2.601737698511904000e+15 2.758894914310720000e+14 1.013506940635251069e-01 9.557737054341537419e-01 2.291638832926190084e+00 -1.202501483586175794e+02 -3.274549162877728181e-02 1.211543983374818200e+16 2.551634801771808000e+15 2.867357647997460000e+14 1.053351783155919569e-01 9.373679179108166393e-01 1.681808664217849358e+00 -1.394170843782524116e+02 -3.511191734215130672e-02 1.144613670351966200e+16 2.499973330206412500e+15 2.976236299489570000e+14 1.093349417136780938e-01 9.183895727323304614e-01 1.339717795559099311e+00 -1.888978092893256360e+02 -3.764935806792467365e-02 1.079782212885638800e+16 2.446786024608291500e+15 3.085171449074060000e+14 1.133367806242624731e-01 8.988506975480062833e-01 1.120489987343740612e+00 -3.825489646135808925e+02 -4.037017258596553582e-02 1.017077813735063200e+16 2.392113369191024000e+15 3.193776360065815000e+14 1.173264878982242937e-01 8.787661646283448924e-01 9.677701570567965872e-01 1.072802437031067029e+03 -4.328761281083057244e-02 9.565238470364550000e+15 2.336003849332720500e+15 3.301640524447680000e+14 1.212889831233878168e-01 8.581537855496332856e-01 8.550738106996020882e-01 1.848657396931597248e+02 -4.641588833612779463e-02 8.981387280171946000e+15 2.278514160340049500e+15 3.408331345659110000e+14 1.252083744434038803e-01 8.370343878854452635e-01 7.683116261079082632e-01 9.190624271938843037e+01 -4.977023564332111460e-02 8.419358055193029000e+15 2.219709357814459250e+15 3.513391824352247500e+14 1.290678735417433998e-01 8.154318704451384292e-01 6.992966437544075875e-01 5.744855413954382328e+01 -5.336699231206309957e-02 7.879232789266045000e+15 2.159662951456050000e+15 3.616348841453910000e+14 1.328500999280538553e-01 7.933732377336214503e-01 6.429472081490914537e-01 3.992738034607557296e+01 -5.722367659350217212e-02 7.361041409511860000e+15 2.098456940744797500e+15 3.716709423943595000e+14 1.365369437578742018e-01 7.708886130591987573e-01 5.959413260989665506e-01 2.954236750249809162e+01 -6.135907273413172824e-02 6.864761475707217000e+15 2.036181772232043000e+15 3.813966780864880000e+14 1.401097875713976093e-01 7.480112228441838651e-01 5.560159827465706028e-01 2.279587211770191146e+01 -6.579332246575682330e-02 6.390318162193128000e+15 1.972936218671335500e+15 3.907602305142245000e+14 1.435495798321637095e-01 7.247773522224352227e-01 5.215761892828700841e-01 1.813531791444600572e+01 -7.054802310718645553e-02 5.937584531213114000e+15 1.908827169789055500e+15 3.997089205847575000e+14 1.468369683619094590e-01 7.012262681769058092e-01 4.914654560356487845e-01 1.477003479361916760e+01 -7.564633275546291113e-02 5.506382104212469000e+15 1.843969345744390000e+15 4.081896246625880000e+14 1.499524376752821020e-01 6.774001142763715899e-01 4.648248319707924403e-01 1.225716221993067023e+01 -8.111308307896872294e-02 5.096481735052291000e+15 1.778484921963848750e+15 4.161491862276242500e+14 1.528764602064531797e-01 6.533437728547338841e-01 4.410030694252910499e-01 1.033065025776648049e+01 -8.697490026177834288e-02 4.707604786319980000e+15 1.712503057395270750e+15 4.235348609795870000e+14 1.555896598225606775e-01 6.291046917105300729e-01 4.194975141101778271e-01 8.821828293365328477e+00 -9.326033468832199691e-02 4.339424606979386500e+15 1.646159327667765000e+15 4.302947920805705000e+14 1.580729864086965475e-01 6.047326758727120666e-01 3.999141258582569192e-01 7.619094727368562303e+00 -1.000000000000000056e-01 3.991568306529020500e+15 1.579595061233158750e+15 4.363785131377497500e+14 1.603079006435073062e-01 5.802796437257364826e-01 3.819397802539639120e-01 6.645995208528413301e+00 -1.072267222010323123e-01 3.663618817662859000e+15 1.512956594439413500e+15 4.417374660658702500e+14 1.622765642410277098e-01 5.557993533535218189e-01 3.653226654804435647e-01 5.848619097758430030e+00 -1.149756995397735598e-01 3.355117236196166500e+15 1.446394434162134500e+15 4.463255355077505000e+14 1.639620362752620686e-01 5.313470949239713637e-01 3.498581455473172563e-01 5.188013718407724184e+00 -1.232846739442065853e-01 3.065565423773752500e+15 1.380062333993083000e+15 4.500995931789487500e+14 1.653484731505037719e-01 5.069793513178171285e-01 3.353783935672294270e-01 4.635440187086221187e+00 -1.321941148466029281e-01 2.794428855669627500e+15 1.314116289538742500e+15 4.530200462113840000e+14 1.664213300407097196e-01 4.827534290417549445e-01 3.217446753342405596e-01 4.169307991455362128e+00 -1.417474162926805614e-01 2.541139692867054000e+15 1.248713464170242000e+15 4.550513802342692500e+14 1.671675603955752043e-01 4.587270635922062745e-01 3.088415273540143224e-01 3.773137846648428440e+00 -1.519911082952933867e-01 2.305100054631145500e+15 1.184011062259152500e+15 4.561626803414510000e+14 1.675758073229645373e-01 4.349580055275049650e-01 2.965723060626808683e-01 3.434174380416248340e+00 -1.629750834620644351e-01 2.085685465007930000e+15 1.120165148362134875e+15 4.563281437245378750e+14 1.676365919096879098e-01 4.115035866838663847e-01 2.848557580241964371e-01 3.142420780087923138e+00 -1.747528400007683780e-01 1.882248444160040500e+15 1.057329429231785750e+15 4.555275190457765000e+14 1.673424746294103760e-01 3.884202727351990236e-01 2.736233187091154373e-01 2.889954083050963796e+00 -1.873817422860384052e-01 1.694122213234424750e+15 9.956540105025533750e+14 4.537465954312163750e+14 1.666882349790579088e-01 3.657632064495556223e-01 2.628170372234962526e-01 2.670431315312202791e+00 -2.009233002565046777e-01 1.520624479603877250e+15 9.352841518516792500e+14 4.509775415571950000e+14 1.656709960455428343e-01 3.435857503853704253e-01 2.523878726624316227e-01 2.478727632786016155e+00 -2.154434690031884481e-01 1.361061267880110500e+15 8.763590355677532500e+14 4.472192179598447500e+14 1.642903392357058512e-01 3.219390345131137310e-01 2.422943475558073101e-01 2.310667608528735428e+00 -2.310129700083160265e-01 1.214730761104602750e+15 8.190105594100537500e+14 4.424774599325580000e+14 1.625484082014574116e-01 3.008715127604031370e-01 2.325014802976419215e-01 2.162823136526633494e+00 -2.477076355991711387e-01 1.080927116020872625e+15 7.633621749181153750e+14 4.367652324964996250e+14 1.604499657697061876e-01 2.804285362536993453e-01 2.229798899116379463e-01 2.032359636926105662e+00 -2.656087782946686682e-01 9.589442163468533750e+14 7.095277875484503750e+14 4.301027347900838750e+14 1.580024322908509804e-01 2.606519492728089360e-01 2.137050772439945123e-01 1.916917823700251100e+00 -2.848035868435802032e-01 8.480793285175710000e+14 6.576107458676077500e+14 4.225173994519532500e+14 1.552158854121120646e-01 2.415797179211013057e-01 2.046568229776915548e-01 1.814521916969636273e+00 -3.053855508833415722e-01 7.476366254655651250e+14 6.077029296875623750e+14 4.140437994436648750e+14 1.521030258479365849e-01 2.232455951431550623e-01 1.958186846406994308e-01 1.723507736396344248e+00 -3.274549162877728459e-01 6.569305456469673750e+14 5.598839529435315000e+14 4.047234600020205000e+14 1.486791082988540569e-01 2.056788278941533432e-01 1.871775718941078304e-01 1.642465897408021069e+00 -3.511191734215131088e-01 5.752889566908533750e+14 5.142204973761986250e+14 3.946045741823401250e+14 1.449618369535248530e-01 1.889039123615536275e-01 1.787233832869169481e-01 1.570196590404960180e+00 -3.764935806792467643e-01 5.020560957220625625e+14 4.707657909025689375e+14 3.837416215685269375e+14 1.409712254181658964e-01 1.729404023395364753e-01 1.704486905380663275e-01 1.505673320564595796e+00 -4.037017258596555802e-01 4.365952615446967500e+14 4.295592474851565000e+14 3.721948825783897500e+14 1.367294182918761813e-01 1.578027769314410134e-01 1.623484553816270659e-01 1.448013641470657697e+00 -4.328761281083059465e-01 3.782912374245944375e+14 3.906262693189145000e+14 3.600298641901335000e+14 1.322604802016649761e-01 1.435003678812052930e-01 1.544197746757709211e-01 1.396455378325573093e+00 -4.641588833612779741e-01 3.265524271127570000e+14 3.539782190434258125e+14 3.473166429427329375e+14 1.275901544472347049e-01 1.300373493652437207e-01 1.466616461685342210e-01 1.350337200692012019e+00 -4.977023564332111460e-01 2.808126909365107188e+14 3.196125639448540000e+14 3.341291354954236250e+14 1.227455950338993407e-01 1.174127909664394870e-01 1.390747495290654279e-01 1.309082663480098274e+00 -5.336699231206309957e-01 2.405328731709928438e+14 2.875131950400774375e+14 3.205443001196825625e+14 1.177550733328795313e-01 1.056207748928115336e-01 1.316612349965609330e-01 1.272187035714403391e+00 -5.722367659350217073e-01 2.052020164035863750e+14 2.576509133117131562e+14 3.066412820470658750e+14 1.126476641164995823e-01 9.465057460069059569e-02 1.244245160555723789e-01 1.239206379468057007e+00 -6.135907273413172547e-01 1.743382631267819375e+14 2.299840836866273438e+14 2.925005157622573750e+14 1.074529157767879911e-01 8.448689504009991580e-02 1.173690635280359995e-01 1.209748468305232860e+00 -6.579332246575682053e-01 1.474894492469614062e+14 2.044594244530950000e+14 2.782028187961469375e+14 1.022005174215309953e-01 7.511016265484417309e-02 1.105002058568314433e-01 1.183465194080822513e+00 -7.054802310718645275e-01 1.242333984845648125e+14 1.810129455604338750e+14 2.638284684825885000e+14 9.691995971186782854e-02 6.649687007602664290e-02 1.038239258177540980e-01 1.160046223914949381e+00 -7.564633275546290836e-01 1.041779306747426094e+14 1.595710004885613125e+14 2.494562880655539375e+14 9.164019913484498792e-02 5.861996253658451062e-02 9.734665649143468824e-02 1.139213678635155214e+00 -8.111308307896872849e-01 8.696060067245946875e+13 1.400514376619359531e+14 2.351627579897086250e+14 8.638933152734597221e-02 5.144926085442447228e-02 9.107507691698470131e-02 1.120717668697500002e+00 -8.697490026177834288e-01 7.224818784589743750e+13 1.223648297621861250e+14 2.210211727835942500e+14 8.119428234890976870e-02 4.495191303240016201e-02 8.501591014826499759e-02 1.104332549896486437e+00 -9.326033468832198858e-01 5.973595894146687500e+13 1.064157576949703438e+14 2.071008581556610938e+14 7.608051907432651639e-02 3.909286593605450916e-02 7.917572508027981293e-02 1.089853785592691970e+00 -1.000000000000000000e+00 4.914672937013000781e+13 9.210412454805496875e+13 1.934664647651047812e+14 7.107179175347000388e-02 3.383534798892814943e-02 7.356074516443347755e-02 1.077095321617599355e+00 -1.072267222010323096e+00 4.022974965998771094e+13 7.932647376552967188e+13 1.801773438260535625e+14 6.618990363340919447e-02 2.914135341670708035e-02 6.817666389061775856e-02 1.065887394059237936e+00 -1.149756995397735571e+00 3.275944492184633203e+13 6.797729374732314062e+13 1.672870188273947500e+14 6.145451708953687114e-02 2.497212150457207500e-02 6.302847174418002574e-02 1.056074709134620981e+00 -1.232846739442065909e+00 2.653403567693038281e+13 5.795027529188967188e+13 1.548427716161748750e+14 5.688300156927166007e-02 2.128859853102722799e-02 5.812030133080552108e-02 1.047514929974726394e+00 -1.321941148466028615e+00 2.137406830977950391e+13 4.913950910324830469e+13 1.428853403679043750e+14 5.249032263850536562e-02 1.805187768378414478e-02 5.345529101343090422e-02 1.040077427328846671e+00 -1.417474162926804837e+00 1.712088276152780273e+13 4.144059959958542188e+13 1.314487347444124219e+14 4.828897407803903197e-02 1.522360822820957582e-02 4.903547087594014448e-02 1.033642246966846479e+00 -1.519911082952933201e+00 1.363504391108575195e+13 3.475168030362002344e+13 1.205601627909436562e+14 4.428895102851883314e-02 1.276636852087417902e-02 4.486167166141086932e-02 1.028099256367812409e+00 -1.629750834620645072e+00 1.079476145950517773e+13 2.897431547579106641e+13 1.102400764325394531e+14 4.049776670397524370e-02 1.064399723329306595e-02 4.093346236412814809e-02 1.023347435236769520e+00 -1.747528400007684724e+00 8.494321102523551758e+12 2.401427813035747656e+13 1.005023270758046250e+14 3.692050955364883230e-02 8.821879163724280146e-03 3.724911676066690325e-02 1.019294279310170026e+00 -1.873817422860384996e+00 6.642547423180946289e+12 1.978219746430519531e+13 9.135442429483400000e+13 3.355993829278707680e-02 7.267183076488980056e-03 3.380560984856897933e-02 1.015855290235420094e+00 -2.009233002565047776e+00 5.161316341575615234e+12 1.619407283317151758e+13 8.279788309381920312e+13 3.041660947294813622e-02 5.949050516000773357e-03 3.059864234196151694e-02 1.012953528124527658e+00 -2.154434690031884259e+00 3.984132206205844238e+12 1.317165417434258594e+13 7.482864960806734375e+13 2.748903386741975707e-02 4.838735558972434569e-03 2.762269277317589908e-02 1.010519206573620377e+00 -2.310129700083160209e+00 3.054781784682008789e+12 1.064269209948910742e+13 6.743759468851720312e+13 2.477385779430285248e-02 3.909696688310086710e-03 2.487109623689487750e-02 1.008489313459995929e+00 -2.477076355991711498e+00 2.326074591466259766e+12 8.541064423491459961e+12 6.061105861298566406e+13 2.226606322149770473e-02 3.137643274747247378e-03 2.233614608002949461e-02 1.006807244589160488e+00 -2.656087782946686904e+00 1.758676251437396484e+12 6.806788274633195312e+12 5.433143189908921875e+13 1.995918113399251098e-02 2.500540025642463294e-03 2.000921497692399742e-02 1.005422440548503937e+00 -2.848035868435801810e+00 1.320039006982927979e+12 5.385929360666869141e+12 4.857775461719150781e+13 1.784551169731677170e-02 1.978573652984112925e-03 1.788089035586679088e-02 1.004290020498433744e+00 -3.053855508833415389e+00 9.834310893597186279e+11 4.230421110872598145e+12 4.332632227008807031e+13 1.591634683334965800e-02 1.554086433462605532e-03 1.594112071278359216e-02 1.003370409279422004e+00 -3.274549162877728570e+00 7.270645370993237305e+11 3.297807853941642090e+12 3.855128397856275781e+13 1.416218996961528948e-02 1.211481862362396916e-03 1.417936801678739735e-02 1.002628956953652395e+00 -3.511191734215131088e+00 5.333191878052713013e+11 2.550926777997327637e+12 3.422521969637703906e+13 1.257296808483578110e-02 9.371078184754055721e-04 1.258476136310279422e-02 1.002035552047367606e+00 -3.764935806792467421e+00 3.880590147995317993e+11 1.957543427049501465e+12 3.031968519982909375e+13 1.113823191615837503e-02 7.191226601703537037e-04 1.114624743526494710e-02 1.001564231391590232e+00 -4.037017258596553582e+00 2.800357345210944824e+11 1.489955077460279541e+12 2.680571572883429297e+13 9.847340976615867603e-03 5.473495218711523381e-04 9.852733865786431067e-03 1.001192790631022067e+00 -4.328761281083057355e+00 2.003736708074031067e+11 1.124575317746316162e+12 2.365428177031789844e+13 8.689630991598921300e-03 4.131237053977252524e-04 8.693222367835366782e-03 1.000902400017976923e+00 -4.641588833612781961e+00 1.421292145788439636e+11 8.415121051816102295e+11 2.083669141603131641e+13 7.654561708922078857e-03 3.091376749459215454e-04 7.656928754074339774e-03 1.000677230429404485e+00 -4.977023564332113459e+00 9.991783993620965576e+10 6.241500467017153320e+11 1.832493607251046484e+13 6.731843898746959175e-03 2.292876039057282968e-04 6.733387781097457947e-03 1.000504094340355810e+00 -5.336699231206313065e+00 6.960150162074356079e+10 4.587460095964287720e+11 1.609197861108992188e+13 5.911545208298864956e-03 1.685248185072199024e-04 5.912541618302007140e-03 1.000372106014532081e+00 -5.722367659350219959e+00 4.802931090207953644e+10 3.340453831172721558e+11 1.411198490065055078e+13 5.184175217678613917e-03 1.227148277813625032e-04 5.184811470925347436e-03 1.000272364431505689e+00 -6.135907273413176100e+00 3.282463131656645966e+10 2.409245697842807617e+11 1.236050052646198242e+13 4.540750359251991518e-03 8.850598925654834894e-05 4.541152278426760502e-03 1.000197661621423650e+00 -6.579332246575682497e+00 2.221211554049404144e+10 1.720635883401535034e+11 1.081457629039860938e+13 3.972840021377477965e-03 6.320923646231778206e-05 3.973091157435935591e-03 1.000142218158481144e+00 -7.054802310718645053e+00 1.487868417444875717e+10 1.216511235381154327e+11 9.452846918003083984e+12 3.472595462213267422e-03 4.468972609373927062e-05 3.472750658488987872e-03 1.000101446664641847e+00 -7.564633275546290392e+00 9.862992725533103943e+09 8.512294593103854370e+10 8.255568625909895508e+12 3.032763610476524752e-03 3.127074397104431320e-05 3.032858450216622051e-03 1.000071743311933048e+00 -8.111308307896871739e+00 6.468514352125196457e+09 5.893342500269370270e+10 7.204620928717798828e+12 2.646687729215589386e-03 2.164976816108991152e-05 2.646745030631884443e-03 1.000050306554167712e+00 -8.697490026177835176e+00 4.195956857482413292e+09 4.035890115512548828e+10 6.283478365301539062e+12 2.308297029194971914e-03 1.482623576017978247e-05 2.308331253058342782e-03 1.000034981710555382e+00 -9.326033468832198636e+00 2.691311430106618881e+09 2.733094044697739792e+10 5.477158018204686523e+12 2.012087389632728502e-03 1.004028739674590807e-05 2.012107591771223562e-03 1.000024129551870811e+00 -1.000000000000000000e+01 1.706380886010607719e+09 1.829696972141786957e+10 4.772148324015714844e+12 1.753095205998152868e-03 6.721570187055526932e-06 1.753106989629829625e-03 1.000016516710793280e+00 +1.000000000000000021e-02 2.623669635761697600e+16 3.189196070449786000e+15 1.276027519456265000e+14 4.687611480604780834e-02 1.171582264942873097e+00 -2.731990676405569030e-01 3.670653748634952507e+01 +1.072267222010323158e-02 2.529093035647578800e+16 3.163569518776327000e+15 1.349153973752620000e+14 4.956248638870444645e-02 1.162168101376557017e+00 -3.056241391987419842e-01 4.194269671436146751e+01 +1.149756995397735633e-02 2.435596729001030400e+16 3.136611589051413000e+15 1.425186876894140000e+14 5.235562920291093880e-02 1.152264843104690684e+00 -3.438458158520137364e-01 4.891537365029977025e+01 +1.232846739442065853e-02 2.343257807453348000e+16 3.108282567295773500e+15 1.504117213282735000e+14 5.525521205188300283e-02 1.141857900809854831e+00 -3.895109947097419867e-01 5.858050452477413472e+01 +1.321941148466028795e-02 2.252152478078229600e+16 3.078544381650331500e+15 1.585924163410500000e+14 5.826047011070276810e-02 1.130933288423491057e+00 -4.449630098822922042e-01 7.273127352985996197e+01 +1.417474162926805545e-02 2.162355818454726400e+16 3.047360932013831500e+15 1.670568499448330000e+14 6.136996230682856268e-02 1.119477744221497151e+00 -5.136518328723679305e-01 9.515961944978003828e+01 +1.519911082952933937e-02 2.073941526177878000e+16 3.014698448767717000e+15 1.757996075290930000e+14 6.458169953030043486e-02 1.107478862605308478e+00 -6.008781444539676997e-01 1.354846490456935157e+02 +1.629750834620644420e-02 1.986981663917872800e+16 2.980525862123967500e+15 1.848134473910700000e+14 6.789302147101698715e-02 1.094925229785425280e+00 -7.152263062674328875e-01 2.272036942521080789e+02 +1.747528400007683849e-02 1.901546401236826400e+16 2.944815185224397500e+15 1.940890313922970000e+14 7.130049767278365258e-02 1.081806564516676117e+00 -8.715742812821479779e-01 6.216767377742245344e+02 +1.873817422860384052e-02 1.817703754478220800e+16 2.907541904332989000e+15 2.036152522110910000e+14 7.480004775270537865e-02 1.068113861439172974e+00 -1.098161903792567395e+00 -1.046518781608876452e+03 +2.009233002565046985e-02 1.735519326146843600e+16 2.868685386510629000e+15 2.133785658009000000e+14 7.838669617325318140e-02 1.053839540841602140e+00 -1.455931736191250714e+00 -3.080925456064942409e+02 +2.154434690031884619e-02 1.655056045294933200e+16 2.828229300831121500e+15 2.233633111834975000e+14 8.205468972141143069e-02 1.038977603399030336e+00 -2.105175345989904745e+00 -1.918016848448959877e+02 +2.310129700083160542e-02 1.576373910521795400e+16 2.786162038713121500e+15 2.335514944841785000e+14 8.579741817190196518e-02 1.023523784585939733e+00 -3.647262533732920975e+00 -1.468897162312466662e+02 +2.477076355991711387e-02 1.499529737277655800e+16 2.742477134073272500e+15 2.439224678149670000e+14 8.960729632179999238e-02 1.007475709023577082e+00 -1.198646122249969181e+01 -1.254141594318358415e+02 +2.656087782946686682e-02 1.424576911236377400e+16 2.697173674732507500e+15 2.544533478360235000e+14 9.347591775314742502e-02 9.908330416140705976e-01 1.019704833575204894e+01 -1.155573192594950171e+02 +2.848035868435801893e-02 1.351565149563965400e+16 2.650256718900311000e+15 2.651184288019625000e+14 9.739383920979580167e-02 9.735976405399819900e-01 3.688830892454275645e+00 -1.137853794134626355e+02 +3.053855508833415444e-02 1.280540271958951800e+16 2.601737698511011000e+15 2.758894915975570000e+14 1.013506941246849896e-01 9.557737054338257821e-01 2.291638834292075710e+00 -1.202501481797724097e+02 +3.274549162877728181e-02 1.211543983374818200e+16 2.551634801770914000e+15 2.867357639430720000e+14 1.053351780008844191e-01 9.373679179104882353e-01 1.681808659184329091e+00 -1.394170856677245354e+02 +3.511191734215130672e-02 1.144613670351966200e+16 2.499973330205520000e+15 2.976236286600430000e+14 1.093349412401829757e-01 9.183895727320025015e-01 1.339717789751822652e+00 -1.888978129857583212e+02 +3.764935806792467365e-02 1.079782212885638800e+16 2.446786024607400500e+15 3.085171445179060000e+14 1.133367804811758472e-01 8.988506975476789895e-01 1.120489985925507304e+00 -3.825489693697762732e+02 +4.037017258596553582e-02 1.017077813735063200e+16 2.392113369190124000e+15 3.193776361822970000e+14 1.173264879627750890e-01 8.787661646280142680e-01 9.677701575866055617e-01 1.072802454371603972e+03 +4.328761281083057244e-02 9.565238470364550000e+15 2.336003849331842000e+15 3.301640524644425000e+14 1.212889831306154381e-01 8.581537855493105438e-01 8.550738107486117734e-01 1.848657397499489718e+02 +4.641588833612779463e-02 8.981387280171946000e+15 2.278514160339202500e+15 3.408331345289345000e+14 1.252083744298202184e-01 8.370343878851340680e-01 7.683116260230885564e-01 9.190624268979938449e+01 +4.977023564332111460e-02 8.419358055193029000e+15 2.219709357812838500e+15 3.513391824389640000e+14 1.290678735431170510e-01 8.154318704445431276e-01 6.992966437595953266e-01 5.744855413998884330e+01 +5.336699231206309957e-02 7.879232789266045000e+15 2.159662951459143750e+15 3.616348841395462500e+14 1.328500999259067117e-01 7.933732377347579856e-01 6.429472081422364926e-01 3.992738034591483398e+01 +5.722367659350217212e-02 7.361041409511860000e+15 2.098456940717942000e+15 3.716709424211035000e+14 1.365369437676988706e-01 7.708886130493332045e-01 5.959413261161857767e-01 2.954236750089418351e+01 +6.135907273413172824e-02 6.864761475707217000e+15 2.036181772229288000e+15 3.813966780869615000e+14 1.401097875715715535e-01 7.480112228431717858e-01 5.560159827450278369e-01 2.279587211746218856e+01 +6.579332246575682330e-02 6.390318162193128000e+15 1.972936218669771750e+15 3.907602305465762500e+14 1.435495798440484527e-01 7.247773522218607933e-01 5.215761893249629688e-01 1.813531791546422056e+01 +7.054802310718645553e-02 5.937584531213114000e+15 1.908827169788433250e+15 3.997089206001302500e+14 1.468369683675568027e-01 7.012262681766772143e-01 4.914654560541749651e-01 1.477003479395117047e+01 +7.564633275546291113e-02 5.506382104212469000e+15 1.843969345743449750e+15 4.081896246708172500e+14 1.499524376783051838e-01 6.774001142760261995e-01 4.648248319796656203e-01 1.225716222003340228e+01 +8.111308307896872294e-02 5.096481735052291000e+15 1.778484921962930250e+15 4.161491862301420000e+14 1.528764602073780787e-01 6.533437728543964873e-01 4.410030694275302032e-01 1.033065025777169588e+01 +8.697490026177834288e-02 4.707604786319980000e+15 1.712503057394387000e+15 4.235348609793115000e+14 1.555896598224594529e-01 6.291046917102053326e-01 4.194975141095378390e-01 8.821828293344129435e+00 +9.326033468832199691e-02 4.339424606979386500e+15 1.646159327665952250e+15 4.302947920801250000e+14 1.580729864085329006e-01 6.047326758720461548e-01 3.999141258571691782e-01 7.619094727335000705e+00 +1.000000000000000056e-01 3.991568306529020500e+15 1.579595061232396750e+15 4.363785131360595000e+14 1.603079006428863584e-01 5.802796437254564843e-01 3.819397802522291330e-01 6.645995208509238417e+00 +1.072267222010323123e-01 3.663618817662859000e+15 1.512956594438495000e+15 4.417374660645157500e+14 1.622765642405301356e-01 5.557993533531844221e-01 3.653226654790456829e-01 5.848619097742652428e+00 +1.149756995397735598e-01 3.355117236196166500e+15 1.446394434161245500e+15 4.463255355066025000e+14 1.639620362748403504e-01 5.313470949236448471e-01 3.498581455461736711e-01 5.188013718395764862e+00 +1.232846739442065853e-01 3.065565423773752500e+15 1.380062333992191750e+15 4.500995931779765000e+14 1.653484731501466132e-01 5.069793513174897237e-01 3.353783935662818516e-01 4.635440187076746987e+00 +1.321941148466029281e-01 2.794428855669627500e+15 1.314116289537873500e+15 4.530200462104492500e+14 1.664213300403663276e-01 4.827534290414356999e-01 3.217446753333784160e-01 4.169307991447633199e+00 +1.417474162926805614e-01 2.541139692867054000e+15 1.248713464169336750e+15 4.550513802332182500e+14 1.671675603951891242e-01 4.587270635918737627e-01 3.088415273531114336e-01 3.773137846641466009e+00 +1.519911082952933867e-01 2.305100054631145500e+15 1.184011062258251750e+15 4.561626803406732500e+14 1.675758073226788214e-01 4.349580055271740631e-01 2.965723060620016893e-01 3.434174380410707883e+00 +1.629750834620644351e-01 2.085685465007930000e+15 1.120165148361241500e+15 4.563281437204610000e+14 1.676365919081902189e-01 4.115035866835382028e-01 2.848557580214927665e-01 3.142420780079149711e+00 +1.747528400007683780e-01 1.882248444160040500e+15 1.057329429230896000e+15 4.555275190454782500e+14 1.673424746293008247e-01 3.884202727348721740e-01 2.736233187087900309e-01 2.889954083047318267e+00 +1.873817422860384052e-01 1.694122213234424750e+15 9.956540105016617500e+14 4.537465954415742500e+14 1.666882349828629761e-01 3.657632064492281065e-01 2.628170372293601176e-01 2.670431315318285925e+00 +2.009233002565046777e-01 1.520624479603877250e+15 9.352841518507868750e+14 4.509775415381218750e+14 1.656709960385361335e-01 3.435857503850426320e-01 2.523878726516314286e-01 2.478727632769107014e+00 +2.154434690031884481e-01 1.361061267880110500e+15 8.763590355668608750e+14 4.472192180713363750e+14 1.642903392766633663e-01 3.219390345127858821e-01 2.422943476160940024e-01 2.310667608598216738e+00 +2.310129700083160265e-01 1.214730761104602750e+15 8.190105594091615000e+14 4.424774600698740000e+14 1.625484082519017826e-01 3.008715127600753436e-01 2.325014803696862364e-01 2.162823136601202290e+00 +2.477076355991711387e-01 1.080927116020872625e+15 7.633621749172230000e+14 4.367652326269220000e+14 1.604499658176181121e-01 2.804285362533715520e-01 2.229798899781203492e-01 2.032359636987663531e+00 +2.656087782946686682e-01 9.589442163468533750e+14 7.095277875475581250e+14 4.301027349125041250e+14 1.580024323358232563e-01 2.606519492724811426e-01 2.137050773047265151e-01 1.916917823750690308e+00 +2.848035868435802032e-01 8.480793285175710000e+14 6.576107458667155000e+14 4.225173995689320000e+14 1.552158854550853562e-01 2.415797179207735401e-01 2.046568230342647454e-01 1.814521917011921781e+00 +3.053855508833415722e-01 7.476366254655651250e+14 6.077029296866702500e+14 4.140437995502017500e+14 1.521030258870739449e-01 2.232455951428273244e-01 1.958186846910025536e-01 1.723507736430197612e+00 +3.274549162877728459e-01 6.569305456469673750e+14 5.598839529426392500e+14 4.047234601027251250e+14 1.486791083358488808e-01 2.056788278938255499e-01 1.871775719406047478e-01 1.642465897436292677e+00 +3.511191734215131088e-01 5.752889566908533750e+14 5.142204973753063125e+14 3.946045741682043125e+14 1.449618369483319236e-01 1.889039123612258064e-01 1.787233832804424327e-01 1.570196590399937087e+00 +3.764935806792467643e-01 5.020560957220625625e+14 4.707657909016767500e+14 3.837416215659887500e+14 1.409712254172334756e-01 1.729404023392087375e-01 1.704486905368713667e-01 1.505673320562770812e+00 +4.037017258596555802e-01 4.365952615446967500e+14 4.295592474842642500e+14 3.721948825721952500e+14 1.367294182896005572e-01 1.578027769311132478e-01 1.623484553788619167e-01 1.448013641468195445e+00 +4.328761281083059465e-01 3.782912374245944375e+14 3.906262693180221875e+14 3.600298641838914375e+14 1.322604801993718937e-01 1.435003678808774996e-01 1.544197746730345266e-01 1.396455378323295582e+00 +4.641588833612779741e-01 3.265524271127570000e+14 3.539782190425332500e+14 3.473166429358512500e+14 1.275901544447066438e-01 1.300373493649158441e-01 1.466616461655729509e-01 1.350337200689795569e+00 +4.977023564332111460e-01 2.808126909365107188e+14 3.196125639439655000e+14 3.341291354878803750e+14 1.227455950311282656e-01 1.174127909661130814e-01 1.390747495258742861e-01 1.309082663477945108e+00 +5.336699231206309957e-01 2.405328731709928438e+14 2.875131950391641250e+14 3.205443001114738750e+14 1.177550733298639851e-01 1.056207748924760242e-01 1.316612349931398640e-01 1.272187035712282643e+00 +5.722367659350217073e-01 2.052020164035863750e+14 2.576509133107320625e+14 3.066412820381643125e+14 1.126476641132295037e-01 9.465057460033017567e-02 1.244245160519109189e-01 1.239206379465923380e+00 +6.135907273413172547e-01 1.743382631267819375e+14 2.299840836866617188e+14 2.925005157515585000e+14 1.074529157728576489e-01 8.448689504011254459e-02 1.173690635237445851e-01 1.209748468304030711e+00 +6.579332246575682053e-01 1.474894492469614062e+14 2.044594244531041875e+14 2.782028187847165625e+14 1.022005174173319375e-01 7.511016265484754539e-02 1.105002058522917552e-01 1.183465194079629246e+00 +7.054802310718645275e-01 1.242333984845648125e+14 1.810129455604445000e+14 2.638284684691093125e+14 9.691995970691612283e-02 6.649687007603054256e-02 1.038239258124501047e-01 1.160046223913667740e+00 +7.564633275546290836e-01 1.041779306747426094e+14 1.595710004885718750e+14 2.494562880592496875e+14 9.164019913252904881e-02 5.861996253658838946e-02 9.734665648897494750e-02 1.139213678634613869e+00 +8.111308307896872849e-01 8.696060067245946875e+13 1.400514376619465938e+14 2.351627579885260312e+14 8.638933152691152806e-02 5.144926085442838581e-02 9.107507691652709514e-02 1.120717668697414959e+00 +8.697490026177834288e-01 7.224818784589743750e+13 1.223648297621967969e+14 2.210211727817767500e+14 8.119428234824209445e-02 4.495191303240408248e-02 8.501591014756625098e-02 1.104332549896363203e+00 +9.326033468832198858e-01 5.973595894146687500e+13 1.064157576949809688e+14 2.071008581536815312e+14 7.608051907359930643e-02 3.909286593605841575e-02 7.917572507952334859e-02 1.089853785592569402e+00 +1.000000000000000000e+00 4.914672937013000781e+13 9.210412454806562500e+13 1.934664647629811875e+14 7.107179175268987792e-02 3.383534798893206297e-02 7.356074516362634541e-02 1.077095321617479451e+00 +1.072267222010323096e+00 4.022974965998771094e+13 7.932647376554029688e+13 1.801773438237495000e+14 6.618990363256277432e-02 2.914135341671098348e-02 6.817666388974620573e-02 1.065887394059119364e+00 +1.149756995397735571e+00 3.275944492184633203e+13 6.797729374733382812e+13 1.672870188249035625e+14 6.145451708862170737e-02 2.497212150457599894e-02 6.302847174324166524e-02 1.056074709134503742e+00 +1.232846739442065909e+00 2.653403567693038281e+13 5.795027529190035938e+13 1.548427716134821250e+14 5.688300156828245135e-02 2.128859853103115540e-02 5.812030132979503771e-02 1.047514929974611153e+00 +1.321941148466028615e+00 2.137406830977950391e+13 4.913950910325897656e+13 1.428853403649940000e+14 5.249032263743620697e-02 1.805187768378806526e-02 5.345529101234232361e-02 1.040077427328733650e+00 +1.417474162926804837e+00 1.712088276152780273e+13 4.144059959959610938e+13 1.314487347412828594e+14 4.828897407688935439e-02 1.522360822821350324e-02 4.903547087477286986e-02 1.033642246966736344e+00 +1.519911082952933201e+00 1.363504391108575195e+13 3.475168030363070312e+13 1.205601627875218281e+14 4.428895102726179006e-02 1.276636852087810296e-02 4.486167166013776270e-02 1.028099256367702719e+00 +1.629750834620645072e+00 1.079476145950517773e+13 2.897431547580177344e+13 1.102400764289521875e+14 4.049776670265742284e-02 1.064399723329699857e-02 4.093346236279631761e-02 1.023347435236665826e+00 +1.747528400007684724e+00 8.494321102523551758e+12 2.401427813036819141e+13 1.005023270721968281e+14 3.692050955232346887e-02 8.821879163728216233e-03 3.724911675932988941e-02 1.019294279310076545e+00 +1.873817422860384996e+00 6.642547423180946289e+12 1.978219746431594141e+13 9.135442429466371875e+13 3.355993829272452267e-02 7.267183076492928287e-03 3.380560984850610601e-02 1.015855290235423647e+00 +2.009233002565047776e+00 5.161316341575615234e+12 1.619407283318226953e+13 8.279788309320454688e+13 3.041660947272233420e-02 5.949050516004723323e-03 3.059864234173447980e-02 1.012953528124521441e+00 +2.154434690031884259e+00 3.984132206205844238e+12 1.317165417435336133e+13 7.482864960748995312e+13 2.748903386720764896e-02 4.838735558976393208e-03 2.762269277296286810e-02 1.010519206573616602e+00 +2.310129700083160209e+00 3.054781784682008789e+12 1.064269209949990430e+13 6.743759468788264062e+13 2.477385779406974034e-02 3.909696688314053155e-03 2.487109623666095004e-02 1.008489313459992376e+00 +2.477076355991711498e+00 2.326074591466259766e+12 8.541064423502292969e+12 6.061105861230048438e+13 2.226606322124599635e-02 3.137643274751226834e-03 2.233614607977707847e-02 1.006807244589157158e+00 +2.656087782946686904e+00 1.758676251437396484e+12 6.806788274644006836e+12 5.433143189835042969e+13 1.995918113372110655e-02 2.500540025646434943e-03 2.000921497665199625e-02 1.005422440548501051e+00 +2.848035868435801810e+00 1.320039006982927979e+12 5.385929360677923828e+12 4.857775461639333594e+13 1.784551169702355486e-02 1.978573652988173913e-03 1.788089035557306403e-02 1.004290020498431302e+00 +3.053855508833415389e+00 9.834310893597186279e+11 4.230421110883147461e+12 4.332632226923183594e+13 1.591634683303511447e-02 1.554086433466480904e-03 1.594112071246861495e-02 1.003370409279419784e+00 +3.274549162877728570e+00 7.270645370993237305e+11 3.297807853952441406e+12 3.855128397763931250e+13 1.416218996927605216e-02 1.211481862366364229e-03 1.417936801644780614e-02 1.002628956953650619e+00 +3.511191734215131088e+00 5.333191878052713013e+11 2.550926777996636719e+12 3.422521969533789453e+13 1.257296808445404132e-02 9.371078184751517604e-04 1.258476136272069536e-02 1.002035552047357392e+00 +3.764935806792467421e+00 3.880590147995317993e+11 1.957543427048936523e+12 3.031968519920422266e+13 1.113823191592882254e-02 7.191226601701461874e-04 1.114624743503522288e-02 1.001564231391584681e+00 +4.037017258596553582e+00 2.800357345210944824e+11 1.489955077462706299e+12 2.680571572875643750e+13 9.847340976587265482e-03 5.473495218720438775e-04 9.852733865757820272e-03 1.001192790631023399e+00 +4.328761281083057355e+00 2.003736708074031067e+11 1.124575317742092041e+12 2.365428177017248047e+13 8.689630991545500491e-03 4.131237053961734338e-04 8.693222367781913013e-03 1.000902400017972926e+00 +4.641588833612781961e+00 1.421292145788439636e+11 8.415121051711517334e+11 2.083669141588459375e+13 7.654561708868179264e-03 3.091376749420795124e-04 7.656928754020393343e-03 1.000677230429396047e+00 +4.977023564332113459e+00 9.991783993620965576e+10 6.241500468201835938e+11 1.832493607222290234e+13 6.731843898641319719e-03 2.292876039492487683e-04 6.733387780992088241e-03 1.000504094340441519e+00 +5.336699231206313065e+00 6.960150162074356079e+10 4.587460089386787720e+11 1.609197861156461719e+13 5.911545208473248901e-03 1.685248182655890226e-04 5.912541618474992031e-03 1.000372106014050466e+00 +5.722367659350219959e+00 4.802931090207953644e+10 3.340453828720429688e+11 1.411198490069830664e+13 5.184175217696157176e-03 1.227148276912751689e-04 5.184811470942427523e-03 1.000272364431325833e+00 +6.135907273413176100e+00 3.282463131656645966e+10 2.409245697938116150e+11 1.236050052623933789e+13 4.540750359170201041e-03 8.850598926004959012e-05 4.541152278344977831e-03 1.000197661621429646e+00 +6.579332246575682497e+00 2.221211554049404144e+10 1.720635883427042542e+11 1.081457629016583594e+13 3.972840021291966506e-03 6.320923646325481734e-05 3.973091157350422398e-03 1.000142218158482477e+00 +7.054802310718645053e+00 1.487868417444875717e+10 1.216511235373576965e+11 9.452846917720173828e+12 3.472595462109337536e-03 4.468972609346090848e-05 3.472750658385051915e-03 1.000101446664640736e+00 +7.564633275546290392e+00 9.862992725533103943e+09 8.512294593115248108e+10 8.255568625788320312e+12 3.032763610431862995e-03 3.127074397108617018e-05 3.032858450171958993e-03 1.000071743311933048e+00 +8.111308307896871739e+00 6.468514352125196457e+09 5.893342500267601013e+10 7.204620928692994141e+12 2.646687729206477317e-03 2.164976816108341308e-05 2.646745030622772808e-03 1.000050306554167712e+00 +8.697490026177835176e+00 4.195956857482413292e+09 4.035890115511917877e+10 6.283478365265076172e+12 2.308297029181576813e-03 1.482623576017746499e-05 2.308331253044947247e-03 1.000034981710555382e+00 +9.326033468832198636e+00 2.691311430106618881e+09 2.733094044697205734e+10 5.477158018165085938e+12 2.012087389618180677e-03 1.004028739674394634e-05 2.012107591756675303e-03 1.000024129551870811e+00 +1.000000000000000000e+01 1.706380886010607719e+09 1.829696972141913605e+10 4.772148323973216797e+12 1.753095205982540790e-03 6.721570187055991953e-06 1.753106989614217548e-03 1.000016516710793280e+00 diff --git a/tests/test_theory.py b/tests/test_theory.py index 526e865b8..9c482317c 100644 --- a/tests/test_theory.py +++ b/tests/test_theory.py @@ -373,6 +373,29 @@ def test_profiles(modeling_data, profile_init): reltol, ) + # Test use_projected_quad + if mod.backend == "ccl" and profile_init == "einasto": + if hasattr(mod.hdpm, 'projected_quad'): + mod.set_projected_quad(True) + assert_allclose( + mod.eval_surface_density( + cfg["SIGMA_PARAMS"]["r_proj"], cfg["SIGMA_PARAMS"]["z_cl"], verbose=True + ), + cfg["numcosmo_profiles"]["Sigma"], + reltol*1e-1, + ) + assert_allclose( + theo.compute_surface_density( + cosmo=cosmo, **cfg["SIGMA_PARAMS"], alpha_ein=alpha_ein, verbose=True, + use_projected_quad=True, + ), + cfg["numcosmo_profiles"]["Sigma"], + reltol*1e-1, + ) + + delattr(mod.hdpm, "projected_quad") + assert_raises(NotImplementedError, mod.set_projected_quad, True) + def test_2halo_term(modeling_data): cfg = load_validation_config() diff --git a/tests/test_theory_parent.py b/tests/test_theory_parent.py index c57d3c0f3..c8a27cec1 100644 --- a/tests/test_theory_parent.py +++ b/tests/test_theory_parent.py @@ -21,6 +21,7 @@ def test_unimplemented(modeling_data): assert_raises(NotImplementedError, mod._update_halo_density_profile) assert_raises(NotImplementedError, mod._set_einasto_alpha, 0.5) assert_raises(NotImplementedError, mod._get_einasto_alpha) + assert_raises(NotImplementedError, mod._set_projected_quad, True) assert_raises(NotImplementedError, mod.eval_3d_density, [0.3], 0.3) assert_raises(NotImplementedError, mod.eval_surface_density, [0.3], 0.3) assert_raises(NotImplementedError, mod.eval_mean_surface_density, [0.3], 0.3) @@ -91,6 +92,16 @@ def test_instantiate(modeling_data): assert_raises(ValueError, mod.set_halo_density_profile, halo_profile_model="bla") assert_raises(ValueError, mod.set_halo_density_profile, massdef="blu") + if theo.be_nick in ["nc", "ccl"]: + mod.set_halo_density_profile(massdef="virial") + assert_equal(mod.massdef, "virial") + + # reset + mod.massdef = "mean" + + mod.massdef = "virial" + assert_equal(mod.massdef, "virial") + if theo.be_nick == "nc": import gi @@ -150,3 +161,18 @@ def test_einasto(modeling_data): mod.eval_reduced_tangential_shear(0.1, 0.1, 0.5, verbose=True) mod.eval_magnification(0.1, 0.1, 0.5, verbose=True) mod.eval_magnification_bias(0.1, 2, 0.1, 0.5, verbose=True) + + +def test_set_projected_quad(modeling_data): + """Test set_projected_quad method""" + mod = theo.Modeling() + assert_raises(NotImplementedError, mod.set_projected_quad, True) + + if theo.be_nick == "ccl": + assert_raises(NotImplementedError, mod.set_projected_quad, True) + mod.set_halo_density_profile("hernquist") + assert_raises(NotImplementedError, mod.set_projected_quad, True) + mod.set_halo_density_profile("einasto") + mod.set_projected_quad(True) + else: + assert_raises(NotImplementedError, mod.set_projected_quad, True)