Available Mass and Light Profiles#

All parameterizable profiles implement Parameterized.

class gigalens.profile.Parameterized(*args, **kwargs)[source]#

Interface for a parameterized profile of any kind.

name#

Name of the profile

Type

str

params#

List of parameter names

Type

list of str

Mass Profiles#

All mass profiles must implement MassProfile, which essentially requires the definition of the deflection angle.

class gigalens.profile.MassProfile(*args, **kwargs)[source]#

Interface for a mass profile.

abstract deriv(x, y, **kwargs)[source]#

Calculates deflection angle.

Parameters
  • x\(x\) coordinate at which to evaluate the deflection

  • y\(y\) coordinate at which to evaluate the deflection

  • **kwargs – Mass profile parameters. Each parameter must be shaped in a way that is broadcastable with x and y

Returns

A tuple \((\alpha_x, \alpha_y)\) containing the deflection angle in the \(x\) and \(y\) directions

Tensorflow Implementations
class gigalens.tf.profiles.mass.epl.EPL(niter=50)[source]#

The elliptical power law mass profile, calculated iteratively as in [TM15].

niter#

Maximum number of iterations for calculating the deflection.

Type

int

class gigalens.tf.profiles.mass.shear.Shear(*args, **kwargs)[source]#

External shear model, parameterized by shear components gamma1 and gamma2.

class gigalens.tf.profiles.mass.sis.SIS(*args, **kwargs)[source]#
class gigalens.tf.profiles.mass.sie.SIE(*args, **kwargs)[source]#
JAX Implementations
class gigalens.jax.profiles.mass.epl.EPL(niter=18)[source]#
class gigalens.jax.profiles.mass.shear.Shear(*args, **kwargs)[source]#
class gigalens.jax.profiles.mass.sis.SIS(*args, **kwargs)[source]#
class gigalens.jax.profiles.mass.sie.SIE(*args, **kwargs)[source]#

Experimental#

The below are experimental implementations that have not undergone extensive tests.

class gigalens.tf.profiles.mass.tnfw.TNFW(*args, **kwargs)[source]#

Light Profiles#

Any light profile must implement LightProfile, which requires the light amplitude to be defined.

class gigalens.profile.LightProfile(use_lstsq=False, *args, **kwargs)[source]#

Interface for a light profile.

Keyword Arguments

use_lstsq (bool) – Whether to use least squares to solve for linear parameters

_use_lstsq#

Whether to use least squares to solve for linear parameters

Type

bool

Tensorflow Implementations
class gigalens.tf.profiles.light.sersic.Sersic(use_lstsq=False, *args, **kwargs)[source]#

A spherically symmetric Sersic light profile.

\[I(x,y) = I_e \exp\left(-b_n \left(\left(\frac{D(x,y)}{R_s}\right)^{1/n} - 1\right)\right)\]

where \(D(x,y)\) is the distance function (as defined in distance()). In the simplest case, it is just Euclidean distance from the center, and when ellipticity is non-zero, the coordinate axes are translated, rotated and scaled to match the ellipse defined by the complex ellipticities (e1,e2) with center (center_x, center_y) then the Euclidean distance from the center is calculated. If least squares is not being used, the amplitude \(I_e\) is set to be 1.

distance(x, y, cx, cy, e1=None, e2=None)[source]#
Parameters
  • x – The \(x\) coordinates to evaluate the distance function at

  • y – The \(y\) coordinates to evaluate the distance function at

  • cx – The \(x\) coordinate of the center of the Sersic light component

  • cy – The \(y\) coordinate of the center of the Sersic light component

  • e1 – Complex ellipticity component. If unspecified, it is assumed to be zero.

  • e2 – Complex ellipticity component. If unspecified, it is assumed to be zero.

Returns

The distance function evaluated at (x,y)

class gigalens.tf.profiles.light.sersic.SersicEllipse(use_lstsq=False, *args, **kwargs)[source]#
class gigalens.tf.profiles.light.sersic.CoreSersic(use_lstsq=False, *args, **kwargs)[source]#
class gigalens.tf.profiles.light.shapelets.Shapelets(n_max, use_lstsq=False, interpolate=True)[source]#

A flexible light profile using a Hermite polynomial basis. If interpolate is set to True, will precalculate the Hermite polynomial and interpolate between precalculated values. Otherwise, the Hermite polynomials will be evaluated at every call of Shapelets.function()

JAX Implementations
class gigalens.jax.profiles.light.sersic.Sersic(use_lstsq=False, *args, **kwargs)[source]#
class gigalens.jax.profiles.light.sersic.SersicEllipse(use_lstsq=False, *args, **kwargs)[source]#
class gigalens.jax.profiles.light.sersic.CoreSersic(use_lstsq=False, *args, **kwargs)[source]#
class gigalens.jax.profiles.light.shapelets.Shapelets(n_max, use_lstsq=False, interpolate=True)[source]#