# autogalaxy.profiles.mass.MultipolePowerLawM4#

class MultipolePowerLawM4[source]#

Bases: MassProfile

A multipole extension with multipole order M=4 to the power-law total mass distribution.

Quantities computed from this profile (e.g. deflections, convergence) are of only the multipole, and not the power-law mass distribution itself.

The typical use case is therefore for the multipoles to be combined with a PowerLaw mass profile with the same parameters (see example below).

When combined with a power-law, the functional form of the convergence is:

$\kappa(r, \phi) = \frac{1}{2} \left(\frac{\theta_{\rm E}^{\rm mass}}{r}\right)^{\gamma^{\rm mass} - 1} k^{\rm mass}_m \, \cos(m(\phi - \phi^{\rm mass}_m)) \, ,$

Where \xi are elliptical coordinates calculated according to :class: SphProfile.

The parameters :math: k^{rm mass}_m and :math: phi^{rm mass}_are parameterized as elliptical components :math: (epsilon_{rm 1}^{rm mp},epsilon_{rm 2}^{rm mp}), which are given by:

$\phi^{\rm mass}_m = \arctan{\frac{\epsilon_{\rm 2}^{\rm mp}}{\epsilon_{\rm 2}^{\rm mp}}}, \, \, k^{\rm mass}_m = \sqrt{{\epsilon_{\rm 1}^{\rm mp}}^2 + {\epsilon_{\rm 2}^{\rm mp}}^2} \, .$

This mass profile is described fully in the following paper: https://arxiv.org/abs/1302.5482

Parameters

Examples

mass = al.mp.PowerLaw(

centre=(0.0, 0.0), ell_comps=(-0.1, 0.2), einstein_radius=1.0, slope=2.2

)

multipole = al.mp.MultipolePowerLawM4(

centre=(0.0, 0.0), einstein_radius=1.0, slope=2.2, ell_comps_multipole=(0.3, 0.2)

)

galaxy = al.Galaxy(

redshift=0.5, mass=mass, multipole=multipole

)

grid=al.Grid2D.uniform(shape_native=(10, 10), pixel_scales=0.1)

deflections = galaxy.deflections_yx_2d_from(

grid=grid

)

Methods

 angle_to_profile_grid_from The angle between each angle theta on the grid and the profile, in radians. area_within_tangential_critical_curve_list_from Returns the surface area within each tangential critical curve as a list, the calculation of which is described in the function tangential_critical_curve_list_from(). convergence_1d_from rtype convergence_2d_from Calculate the projected convergence on a grid of (y,x) arc-second coordinates. convergence_2d_via_hessian_from Returns the convergence of the lensing object, which is computed from the 2D deflection angle map via the Hessian using the expression (see equation 56 https://www.tau.ac.il/~lab3/MICROLENSING/JeruLect.pdf): convergence_2d_via_jacobian_from Returns the convergence of the lensing object, which is computed from the 2D deflection angle map via the Jacobian using the expression (see equation 58 https://www.tau.ac.il/~lab3/MICROLENSING/JeruLect.pdf): convergence_func rtype float deflections_2d_via_potential_2d_from deflections_yx_2d_from Calculate the deflection angles on a grid of (y,x) arc-second coordinates. density_between_circular_annuli Calculate the mass between two circular annuli and compute the density by dividing by the annuli surface area. dict A dictionary representation of the instance comprising a type field which contains the entire class path by which the type can be imported and constructor arguments. eccentric_radii_grid_from Convert a grid of (y,x) coordinates to an eccentric radius: :math: axis_ratio^0.5 (x^2 + (y^2/q))^0.5 einstein_mass_angular_from Returns the Einstein radius corresponding to the area within the tangential critical curve. einstein_mass_angular_list_from Returns a list of the angular Einstein massses corresponding to the area within each tangential critical curve. einstein_radius_from Returns the Einstein radius corresponding to the area within the tangential critical curve. einstein_radius_list_from Returns a list of the Einstein radii corresponding to the area within each tangential critical curve. einstein_radius_via_normalization_from elliptical_radii_grid_from Convert a grid of (y,x) coordinates to their elliptical radii values: :math: (x^2 + (y^2/q))^0.5 extract_attribute Returns an attribute of a class and its children profiles in the the galaxy as a ValueIrregular or Grid2DIrregular object. from_dict Instantiate an instance of a class from its dictionary representation. from_json Load the dictable object to a .json file, whereby all attributes are converted from the .json file's dictionary representation to create the instance of the object has Does this instance have an attribute which is of type cls? hessian_from Returns the Hessian of the lensing object, where the Hessian is the second partial derivatives of the the potential (see equation 55 https://www.tau.ac.il/~lab3/MICROLENSING/JeruLect.pdf): jacobian The Jacobian transformation from polar to cartesian coordinates. jacobian_from Returns the Jacobian of the lensing object, which is computed by taking the gradient of the 2D deflection angle map in four direction (positive y, negative y, positive x, negative x). magnification_2d_from Returns the 2D magnification map of lensing object, which is computed as the inverse of the determinant of the jacobian. magnification_2d_via_hessian_from Returns the 2D magnification map of lensing object, which is computed from the 2D deflection angle map via the Hessian using the expressions (see equation 60 https://www.tau.ac.il/~lab3/MICROLENSING/JeruLect.pdf): mass_angular_via_normalization_from mass_angular_within_circle_from Integrate the mass profiles's convergence profile to compute the total mass within a circle of specified radius. mass_integral normalization_via_einstein_radius_from normalization_via_mass_angular_from output_to_json Output the dictable object to a .json file, whereby all attributes are converted to a dictionary representation first. potential_1d_from rtype potential_2d_from Calculate the potential on a grid of (y,x) arc-second coordinates. potential_func radial_caustic_list_from Returns all radial caustics of the lensing system, which are computed as follows: radial_critical_curve_list_from Returns all radial critical curves of the lensing system, which are computed as follows: radial_eigen_value_from Returns the radial eigen values of lensing jacobian, which are given by the expression: radial_grid_from Convert a grid of (y, x) coordinates, to their radial distances from the profile centre (e.g. rotated_grid_from_reference_frame_from Rotate a grid of (y,x) coordinates which have been transformed to the elliptical reference frame of a profile back to the original unrotated coordinate grid reference frame. shear_yx_2d_via_hessian_from Returns the 2D (y,x) shear vectors of the lensing object, which are computed from the 2D deflection angle map via the Hessian using the expressions (see equation 57 https://www.tau.ac.il/~lab3/MICROLENSING/JeruLect.pdf): shear_yx_2d_via_jacobian_from Returns the 2D (y,x) shear vectors of the lensing object, which are computed from the 2D deflection angle map via the Jacobian using the expression (see equation 58 https://www.tau.ac.il/~lab3/MICROLENSING/JeruLect.pdf): tangential_caustic_list_from Returns all tangential caustics of the lensing system, which are computed as follows: tangential_critical_curve_list_from Returns all tangential critical curves of the lensing system, which are computed as follows: tangential_eigen_value_from Returns the tangential eigen values of lensing jacobian, which are given by the expression: transformed_from_reference_frame_grid_from Transform a grid of (y,x) coordinates from the reference frame of the profile to the original observer reference frame. transformed_to_reference_frame_grid_from Transform a grid of (y,x) coordinates to the reference frame of the profile. with_new_normalization

Attributes

 angle The position angle in degrees of the major-axis of the ellipse defined by profile, defined counter clockwise from the positive x-axis (0.0 > angle > 180.0). angle_radians The position angle in radians of the major-axis of the ellipse defined by profile, defined counter clockwise from the positive x-axis (0.0 > angle > 2pi). average_convergence_of_1_radius The radius a critical curve forms for this mass profile, e.g. axis_ratio The ratio of the minor-axis to major-axis (b/a) of the ellipse defined by profile (0.0 > q > 1.0). ellipticity_rescale
jacobian(a_r, a_angle, polar_angle_grid)[source]#

The Jacobian transformation from polar to cartesian coordinates.

Parameters
• a_r (ndarray) – Ask Aris

• a_angle (ndarray) – Ask Aris

• polar_angle_grid (ndarray) – The polar angle coordinates of the input (y,x) Cartesian grid of coordinates.

Return type

Tuple[ndarray, Tuple]

deflections_yx_2d_from(grid)[source]#

Calculate the deflection angles on a grid of (y,x) arc-second coordinates.

For coordinates (0.0, 0.0) the analytic calculation of the deflection angle gives a NaN. Therefore, coordinates at (0.0, 0.0) are shifted slightly to (1.0e-8, 1.0e-8).

Parameters

grid (Union[ndarray, Grid1D, Grid2D, Grid2DIterate, Grid2DIrregular]) – The grid of (y,x) arc-second coordinates the deflection angles are computed on.

Return type

ndarray

convergence_2d_from(grid)[source]#

Calculate the projected convergence on a grid of (y,x) arc-second coordinates.

Parameters

grid (Union[ndarray, Grid1D, Grid2D, Grid2DIterate, Grid2DIrregular]) – The grid of (y,x) arc-second coordinates the convergence is computed on.

Return type

ndarray

potential_2d_from(grid)[source]#

Calculate the potential on a grid of (y,x) arc-second coordinates.

Parameters

grid (Union[ndarray, Grid2D, Grid2DIterate, Grid2DIrregular]) – The grid of (y,x) arc-second coordinates the deflection angles are computed on.

Return type

ndarray