Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
75 changes: 75 additions & 0 deletions autogalaxy/config/priors/mass/dark/cnfw.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,78 @@
cNFW:
centre_0:
type: Gaussian
mean: 0.0
sigma: 0.1
width_modifier:
type: Absolute
value: 0.05
limits:
lower: -inf
upper: inf
centre_1:
type: Gaussian
mean: 0.0
sigma: 0.1
width_modifier:
type: Absolute
value: 0.05
limits:
lower: -inf
upper: inf
ell_comps_0:
type: TruncatedGaussian
mean: 0.0
sigma: 0.3
lower_limit: -1.0
upper_limit: 1.0
width_modifier:
type: Absolute
value: 0.2
limits:
lower: -1.0
upper: 1.0
ell_comps_1:
type: TruncatedGaussian
mean: 0.0
sigma: 0.3
lower_limit: -1.0
upper_limit: 1.0
width_modifier:
type: Absolute
value: 0.2
limits:
lower: -1.0
upper: 1.0
kappa_s:
type: Uniform
lower_limit: 0.0
upper_limit: 1.0
width_modifier:
type: Relative
value: 0.2
limits:
lower: 0.0
upper: inf
scale_radius:
type: Uniform
lower_limit: 0.0
upper_limit: 30.0
width_modifier:
type: Relative
value: 0.2
limits:
lower: 0.0
upper: inf
core_radius:
type: Uniform
lower_limit: 0.0
upper_limit: 15.0
width_modifier:
type: Relative
value: 0.2
limits:
lower: 0.0
upper: inf
cNFWSph:
centre_0:
type: Gaussian
Expand Down
85 changes: 85 additions & 0 deletions autogalaxy/config/priors/mass/dark/cnfw_mcr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,88 @@
cNFWMCRLudlow:
centre_0:
type: Gaussian
mean: 0.0
sigma: 0.1
width_modifier:
type: Absolute
value: 0.05
limits:
lower: -inf
upper: inf
centre_1:
type: Gaussian
mean: 0.0
sigma: 0.1
width_modifier:
type: Absolute
value: 0.05
limits:
lower: -inf
upper: inf
ell_comps_0:
type: TruncatedGaussian
mean: 0.0
sigma: 0.3
lower_limit: -1.0
upper_limit: 1.0
width_modifier:
type: Absolute
value: 0.2
limits:
lower: -1.0
upper: 1.0
ell_comps_1:
type: TruncatedGaussian
mean: 0.0
sigma: 0.3
lower_limit: -1.0
upper_limit: 1.0
width_modifier:
type: Absolute
value: 0.2
limits:
lower: -1.0
upper: 1.0
mass_at_200:
type: LogUniform
lower_limit: 100000000.0
upper_limit: 1000000000000000.0
width_modifier:
type: Relative
value: 0.5
limits:
lower: 0.0
upper: inf
f_c:
type: Uniform
lower_limit: 0.0001
upper_limit: 0.5
width_modifier:
type: Relative
value: 0.2
limits:
lower: 0.0001
upper: inf
redshift_object:
type: Uniform
lower_limit: 0.0
upper_limit: 1.0
width_modifier:
type: Relative
value: 0.5
limits:
lower: 0.0
upper: inf
redshift_source:
type: Uniform
lower_limit: 0.0
upper_limit: 1.0
width_modifier:
type: Relative
value: 0.5
limits:
lower: 0.0
upper: inf
cNFWMCRLudlowSph:
centre_0:
type: Gaussian
Expand Down
95 changes: 95 additions & 0 deletions autogalaxy/config/priors/mass/dark/cnfw_mcr_scatter.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,98 @@
cNFWMCRScatterLudlow:
centre_0:
type: Gaussian
mean: 0.0
sigma: 0.1
width_modifier:
type: Absolute
value: 0.05
limits:
lower: -inf
upper: inf
centre_1:
type: Gaussian
mean: 0.0
sigma: 0.1
width_modifier:
type: Absolute
value: 0.05
limits:
lower: -inf
upper: inf
ell_comps_0:
type: TruncatedGaussian
mean: 0.0
sigma: 0.3
lower_limit: -1.0
upper_limit: 1.0
width_modifier:
type: Absolute
value: 0.2
limits:
lower: -1.0
upper: 1.0
ell_comps_1:
type: TruncatedGaussian
mean: 0.0
sigma: 0.3
lower_limit: -1.0
upper_limit: 1.0
width_modifier:
type: Absolute
value: 0.2
limits:
lower: -1.0
upper: 1.0
mass_at_200:
type: LogUniform
lower_limit: 100000000.0
upper_limit: 1000000000000000.0
width_modifier:
type: Relative
value: 0.5
limits:
lower: 0.0
upper: inf
f_c:
type: Uniform
lower_limit: 0.0001
upper_limit: 0.5
width_modifier:
type: Relative
value: 0.2
limits:
lower: 0.0001
upper: inf
redshift_object:
type: Uniform
lower_limit: 0.0
upper_limit: 1.0
width_modifier:
type: Relative
value: 0.5
limits:
lower: 0.0
upper: inf
redshift_source:
type: Uniform
lower_limit: 0.0
upper_limit: 1.0
width_modifier:
type: Relative
value: 0.5
limits:
lower: 0.0
upper: inf
scatter_sigma:
type: Gaussian
mean: 0.0
sigma: 3.0
width_modifier:
type: Absolute
value: 1.0
limits:
lower: -inf
upper: inf
cNFWMCRScatterLudlowSph:
centre_0:
type: Gaussian
Expand Down
3 changes: 3 additions & 0 deletions autogalaxy/profiles/mass/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@
NFWMCRLudlow,
gNFWMCRLudlow,
NFWVirialMassConcSph,
cNFW,
cNFWSph,
cNFWMCRLudlow,
cNFWMCRLudlowSph,
cNFWMCRScatterLudlow,
cNFWMCRScatterLudlowSph,
)
from .stellar import (
Expand Down
6 changes: 3 additions & 3 deletions autogalaxy/profiles/mass/dark/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
from .nfw_truncated_mcr import NFWTruncatedMCRLudlowSph, NFWTruncatedMCRDuffySph
from .nfw_truncated_mcr_scatter import NFWTruncatedMCRScatterLudlowSph
from .nfw_virial_mass_conc import NFWVirialMassConcSph
from .cnfw import cNFWSph
from .cnfw_mcr import cNFWMCRLudlowSph
from .cnfw_mcr_scatter import cNFWMCRScatterLudlowSph
from .cnfw import cNFW, cNFWSph
from .cnfw_mcr import cNFWMCRLudlow, cNFWMCRLudlowSph
from .cnfw_mcr_scatter import cNFWMCRScatterLudlow, cNFWMCRScatterLudlowSph
86 changes: 71 additions & 15 deletions autogalaxy/profiles/mass/dark/cnfw.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,80 @@
from typing import Tuple

from autogalaxy.profiles.mass.dark.abstract import AbstractgNFW
from autogalaxy.profiles.mass.abstract.mge import MGEDecomposer

import autoarray as aa


class cNFWSph(AbstractgNFW):
class cNFW(AbstractgNFW):
def __init__(
self,
centre: Tuple[float, float] = (0.0, 0.0),
ell_comps: Tuple[float, float] = (0.0, 0.0),
kappa_s: float = 0.05,
scale_radius: float = 1.0,
core_radius: float = 0.01,
):
"""
Represents a cored NFW density distribution

Parameters
----------
centre
The (y,x) arc-second coordinates of the profile centre.
ell_comps
The first and second ellipticity components of the elliptical coordinate system.
kappa_s
The overall normalization of the dark matter halo
(kappa_s = (rho_0 * D_d * scale_radius)/lensing_critical_density)
scale_radius
The cored NFW scale radius `theta_s`, as an angle on the sky in arcseconds.
core_radius
The cored NFW core radius `theta_c`, as an angle on the sky in arcseconds.
"""

super().__init__(centre=centre, ell_comps=ell_comps)

self.kappa_s = kappa_s
self.scale_radius = scale_radius
self.core_radius = core_radius


def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs):
return self.deflections_2d_via_mge_from(grid=grid, xp=xp, **kwargs)

def deflections_2d_via_mge_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs):
radii_min = self.scale_radius / 1000.0
radii_max = self.scale_radius * 200.0
log_sigmas = xp.linspace(xp.log(radii_min), xp.log(radii_max), 20)
sigmas = xp.exp(log_sigmas)

mge_decomp = MGEDecomposer(mass_profile=self)

deflections_via_mge = mge_decomp.deflections_2d_via_mge_from(
grid=grid,
xp=xp,
sigma_log_list=sigmas,
ellipticity_convention='major',
three_D=True
)
return deflections_via_mge

def density_3d_func(self, r, xp=np):

rho_at_scale_radius = (
self.kappa_s / self.scale_radius
) # density parameter of 3D gNFW

return (
rho_at_scale_radius
* self.scale_radius**3.0
* (r.array + self.core_radius) ** (-1.0)
* (r.array + self.scale_radius) ** (-2.0)
)


class cNFWSph(cNFW):
def __init__(
self,
centre: Tuple[float, float] = (0.0, 0.0),
Expand All @@ -23,7 +92,7 @@ def __init__(
centre
The (y,x) arc-second coordinates of the profile centre.
kappa_s
The overall normalization of the dark matter halo \|
The overall normalization of the dark matter halo
(kappa_s = (rho_0 * D_d * scale_radius)/lensing_critical_density)
scale_radius
The cored NFW scale radius `theta_s`, as an angle on the sky in arcseconds.
Expand Down Expand Up @@ -165,16 +234,3 @@ def potential_2d_from(self, grid: aa.type.Grid2DLike, xp=np, **kwargs):
This is not yet implemented for `cNFWSph`.
"""
return xp.zeros(shape=grid.shape[0])

def density_3d_func(self, theta, xp=np):

rho_at_scale_radius = (
self.kappa_s / self.scale_radius
) # density parameter of 3D gNFW

return (
rho_at_scale_radius
* self.scale_radius**3.0
* (theta.array + self.core_radius) ** (-1.0)
* (theta.array + self.scale_radius) ** (-2.0)
)
Loading
Loading