Sersic Lens

The Sersic profile (Sérsic, 1963) is widely used to describe the light (and stellar mass) distribution of galaxies. The corresponding convergence profile can be written as

\[\begin{equation*} κ(θ) = κ_s \exp\left[ -\left( \frac{|\pmb{θ} - \pmb{θ}_c|}{θ_s} \right)^{1/n} \right], \end{equation*}\]

where $κ_s$ is the central convergence, $n$ is the Sersic index ($n = 4$ corresponds to the de Vaucouleurs profile and $n = 1$ to an exponential profile), and $\pmb{θ}_c$ represents the lens center. The scale radius $θ_s$ is related to the half-mass radius $θ_e$ as

\[\begin{equation*} θ_s = \frac{θ_e}{b_n^n}, \end{equation*}\]

where $b_n$ satisfies $Γ(2n) = 2γ(2n, b_n)$, with $γ(a, x)$ being the lower incomplete gamma function. For a total mass $M$, the central convergence is $κ_s \propto M / \left[ π θ_s^2 Γ(2n+1) \right]$, and the mass enclosed within $θ$ is analytic,

\[\begin{equation*} M(θ) = M \, P\left( 2n, \left( \frac{θ}{θ_s} \right)^{1/n} \right), \end{equation*}\]

where $P(a, x) = γ(a, x)/Γ(a)$ is the regularized lower incomplete gamma function, leading to the deflection angle

\[\begin{equation*} \pmb{α}(\pmb{θ}) = \frac{4{\rm G} M}{{\rm c}^2} \frac{1}{D_d} P\left( 2n, \left( \frac{|\pmb{θ} - \pmb{θ}_c|}{θ_s} \right)^{1/n} \right) \frac{\pmb{θ} - \pmb{θ}_c}{|\pmb{θ} - \pmb{θ}_c|^2}. \end{equation*}\]

The lens potential does not have an elementary closed form and is expressed in terms of the generalized hypergeometric function ${}_2F_2$,

\[\begin{equation*} ψ(\pmb{θ}) = \frac{2{\rm G} M}{{\rm c}^2} \frac{1}{D_d} \frac{1}{Γ(2n+1)} \left( \frac{|\pmb{θ} - \pmb{θ}_c|}{θ_s} \right)^2 {}_2F_2\left( 2n, 2n; \, 2n+1, 2n+1; \, -\left( \frac{|\pmb{θ} - \pmb{θ}_c|}{θ_s} \right)^{1/n} \right). \end{equation*}\]

In LensFactory, to define a Sersic lens, the user needs to specify six parameters: its position in the image plane ($x_c,~y_c$), its mass ($M$), the half-mass radius ($x_e \equiv θ_e$), the Sersic index ($n$, with a default value of 4), and the angular diameter distance to the lens ($D_d$). By default, the lens is placed at the origin, i.e., ($x_c,~y_c$) = (0, 0). The helper function scale_to_halflight converts between the half-light radius and the scale radius.

LensFactory.Lenses.init_SersicLens — Type
init_SersicLens(D_d::Real  = NaN, 
                x_c::Real  = 0.0, 
                y_c::Real  = 0.0, 
                mass::Real = NaN, 
                x_e::Real  = NaN, 
                n::Real    = 4.0)

Initialize a Sersic lens with the given parameters.

Keyword Arguments

  • D_d::Real = NaN: ADD from observer to lens (in $\rm \mathbf{meters}$).
  • x_c::Real = 0.0: x-coordinate of the lens (in $\rm \mathbf{arcseconds}$).
  • y_c::Real = 0.0: y-coordinate of the lens (in $\rm \mathbf{arcseconds}$).
  • mass::Real= NaN: Mass of the lens (in $\rm \mathbf{M_\odot}$).
  • x_e::Real = NaN: Half-mass radius (in $\rm \mathbf{arcseconds}$).
  • n::Real = 4.0: Sersic index.
source
LensFactory.Lenses.SersicLens.potential! — Function
potential!(ψ::U, θx::S, θy::S, D_d::T, θxc::T, θyc::T, mass::T, θe::T, n::T) where {U<:Real, S<:Real, T<:Real}
source
potential!(ψ::U, θx::S, θy::S, D_d::T, θxc::T, θyc::T, mass::T, θe::T, n::T) where {U<:ROA, S<:ROA, T<:Real}

Calculate potential at given coordinates for a Sersic lens and update the potential in place.

Arguments

  • ψ : Potential at given coordinates
  • θx : x-coordinate(s) (in $\rm \mathbf{arcseconds}$).
  • θy : y-coordinate(s) (in $\rm \mathbf{arcseconds}$).
  • D_d : ADD from the observer to the lens (in $\rm \mathbf{meters}$).
  • θxc : x-coordinate of the lens (in $\rm \mathbf{arcseconds}$).
  • θyc : y-coordinate of the lens (in $\rm \mathbf{arcseconds}$).
  • mass: Mass of the lens (in $\rm \mathbf{M_\odot}$).
  • θe : Half-light radius of the lens (in $\rm \mathbf{arcseconds}$).
  • n : Sersic index of the lens.
source
LensFactory.Lenses.SersicLens.deflection! — Function
deflection!(ψx::U, ψy::U, θx::S, θy::S, D_d::T, θxc::T, θyc::T, mass::T, θe::T, n::T) where {U<:Real, S<:Real, T<:Real}
source
deflection!(ψx::U, ψy::U, θx::S, θy::S, D_d::T, θxc::T, θyc::T, mass::T, θe::T, n::T) where {U<:ROA, S<:ROA, T<:Real}

Calculate deflection at given coordinates for a Sersic lens and update the deflection in place.

Arguments

  • ψx : x-component of deflection at given coordinates
  • ψy : y-component of deflection at given coordinates
  • θx : x-coordinate(s) (in $\rm \mathbf{arcseconds}$).
  • θy : y-coordinate(s) (in $\rm \mathbf{arcseconds}$).
  • D_d : ADD from the observer to the lens (in $\rm \mathbf{meters}$).
  • θxc : x-coordinate of the lens (in $\rm \mathbf{arcseconds}$).
  • θyc : y-coordinate of the lens (in $\rm \mathbf{arcseconds}$).
  • mass: Mass of the lens (in $\rm \mathbf{M_\odot}$).
  • θe : Half-light radius of the lens (in $\rm \mathbf{arcseconds}$).
  • n : Sersic index of the lens.
source
LensFactory.Lenses.SersicLens.jacobian! — Function
jacobian!(ψxx::U, ψyy::U, ψxy::U, θx::S, θy::S, D_d::T, θxc::T, θyc::T, mass::T, θe::T, n::T) where {U<:Real, S<:Real, T<:Real}
source
jacobian!(ψxx::U, ψyy::U, ψxy::U, θx::S, θy::S, D_d::T, θxc::T, θyc::T, mass::T, θe::T, n::T) where {U<:ROA, S<:ROA, T<:Real}

Calculate Jacobian of the deflection at given coordinates for a Sersic lens and update the Jacobian in place.

Arguments

  • ψxx : x-component of Jacobian at given coordinates
  • ψyy : y-component of Jacobian at given coordinates
  • ψxy : xy-component of Jacobian at given coordinates
  • θx : x-coordinate(s) (in $\rm \mathbf{arcseconds}$).
  • θy : y-coordinate(s) (in $\rm \mathbf{arcseconds}$).
  • D_d : ADD from the observer to the lens (in $\rm \mathbf{meters}$).
  • θxc : x-coordinate of the lens (in $\rm \mathbf{arcseconds}$).
  • θyc : y-coordinate of the lens (in $\rm \mathbf{arcseconds}$).
  • mass: Mass of the lens (in $\rm \mathbf{M_\odot}$).
  • θe : Half-light radius of the lens (in $\rm \mathbf{arcseconds}$).
  • n : Sersic index of the lens.
source
LensFactory.Lenses.SersicLens.scale_to_halflight — Function
scale_to_halflight(; n::Real   = NaN, 
                     x_s::Real = NaN)

Calculate the scale radius of a Sersic lens given the half-light radius and the Sersic index.

Keyword Arguments

  • n = NaN: Sersic index of the lens.
  • x_s = NaN: Half-light radius of the lens (in $\rm \mathbf{arcseconds}$).

Returns

  • ::Real: Scale radius of the lens (in $\rm \mathbf{arcseconds}$).
source