autolens.Galaxy#

class autolens.Galaxy(redshift: float, hyper_galaxy: Optional[HyperGalaxy] = None, **kwargs)[source]#

@DynamicAttrs

__init__(redshift: float, hyper_galaxy: Optional[HyperGalaxy] = None, **kwargs)[source]#

Class representing a galaxy, which is composed of attributes used for fitting hyper_galaxies (e.g. light profiles, mass profiles, pixelizations, etc.).

All has_ methods retun True if galaxy has that attribute, False if not.

Parameters
  • redshift – The redshift of the galaxy.

  • pixelization – The pixelization of the galaxy used to reconstruct an observed image using an inversion.

hyper_model_image#

The best-fit model image to the observed image from a previous analysis search. This provides the total light attributed to each image pixel by the model.

hyper_galaxy_image#

A model image of the galaxy (from light profiles or an inversion) from a previous analysis search.

Methods

__init__(redshift[, hyper_galaxy])

Class representing a galaxy, which is composed of attributes used for fitting hyper_galaxies (e.g.

area_within_tangential_critical_curve_from(grid)

Returns the surface area within the tangential critical curve, the calculation of whihc is described in the function tangential_critical_curve_from()

blurred_image_2d_from(grid, blurring_grid[, ...])

Evaluate the light object's 2D image from a input 2D grid of coordinates and convolve it with a PSF.

blurred_image_2d_list_from(grid, blurring_grid)

Evaluate the light object's list of 2D images from a input 2D grid of coordinates and convolve each image with a PSF.

caustics_from(grid[, pixel_scale])

Returns the both the tangential and radial caustics of lensing object as a two entry list of irregular 2D grids.

cls_list_from(cls[, cls_filtered])

Returns a list of objects in the galaxy which are an instance of the input cls.

convergence_1d_from(grid)

Returns the summed 1D convergence of the galaxy's mass profiles using a grid of Cartesian (y,x) coordinates.

convergence_2d_from(grid)

Returns the summed 2D convergence of the galaxy's mass profiles from a 2D grid of Cartesian (y,x) coordinates.

convergence_2d_via_hessian_from(grid[, buffer])

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(grid[, ...])

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):

critical_curves_from(grid[, pixel_scale])

Returns the both the tangential and radial critical curves of lensing object as a two entry list of irregular 2D grids.

deflections_yx_2d_from(grid)

Returns the summed 2D deflection angles of the galaxy's mass profiles from a 2D grid of Cartesian (y,x) coordinates.

dict()

A dictionary representation of this object

einstein_mass_angular_from(grid[, pixel_scale])

Returns the angular Einstein Mass, which is defined as:

einstein_radius_from(grid[, pixel_scale])

Returns the Einstein radius, which is defined as the radius of the circle which contains the same area as the area within the tangential critical curve.

extract_attribute(cls, attr_name)

Returns an attribute of a class and its children profiles in the the galaxy as a ValueIrregular or Grid2DIrregular object.

from_dict(d)

Recursively parse a dictionary returning the model, collection or instance that is represents.

from_json(file_path)

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

grid_radial_from(grid, centre, angle)

has(cls)

Does this instance have an attribute which is of type cls?

hessian_from(grid[, buffer, deflections_func])

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):

image_1d_from(grid)

Returns the summed 1D image of the galaxy's light profiles using a grid of Cartesian (y,x) coordinates.

image_2d_from(grid[, operated_only])

Returns the summed 2D image of the galaxy's light profiles from a 2D grid of Cartesian (y,x) coordinates.

image_2d_list_from(grid[, operated_only])

Returns a list of the 2D images of the galaxy's light profiles from a 2D grid of Cartesian (y,x) coordinates.

jacobian_from(grid)

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).

luminosity_within_circle_from(radius)

Returns the total luminosity of the galaxy's light profiles within a circle of specified radius.

magnification_2d_from(grid)

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(grid[, ...])

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_within_circle_from(radius)

Integrate the mass profiles's convergence profile to compute the total mass within a circle of specified radius.

next_id()

output_to_json(file_path)

Output the dictable object to a .json file, whereby all attributes are converted to a dictionary representation first.

padded_image_2d_from(grid, psf_shape_2d)

Evaluate the light object's 2D image from a input 2D grid of padded coordinates, where this padding is sufficient to encapsulate all surrounding pixels that will blur light into the original image given the 2D shape of the PSF's kernel.

potential_1d_from(grid)

Returns the summed 1D potential of the galaxy's mass profiles using a grid of Cartesian (y,x) coordinates.

potential_2d_from(grid)

Returns the summed 2D potential of the galaxy's mass profiles from a 2D grid of Cartesian (y,x) coordinates.

radial_caustic_from(grid[, pixel_scale])

Returns the radial caustic of lensing object, which is computed as follows:

radial_critical_curve_from(grid[, pixel_scale])

Returns the radial critical curve of lensing object, which is computed as follows:

radial_eigen_value_from(grid[, jacobian])

Returns the radial eigen values of lensing jacobian, which are given by the expression:

radial_projected_shape_slim_from(grid)

To make 1D plots (e.g.

shear_yx_2d_via_hessian_from(grid[, buffer])

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(grid[, jacobian])

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_from(grid[, pixel_scale])

Returns the tangential caustic of lensing object, which is computed as follows:

tangential_critical_curve_from(grid[, ...])

Returns the tangential critical curve of lensing object, which is computed as follows:

tangential_eigen_value_from(grid[, jacobian])

Returns the tangential eigen values of lensing jacobian, which are given by the expression:

unmasked_blurred_image_2d_from(grid, psf)

Evaluate the light object's 2D image from a input 2D grid of coordinates and convolve it with a PSF, using a grid which is not masked.

unmasked_blurred_image_2d_list_from(grid, psf)

Evaluate the light object's list of 2D images from a input 2D grid of coordinates and convolve it with a PSF, using a grid which is not masked.

visibilities_from(grid, transformer)

Evaluate the light object's 2D image from a input 2D grid of coordinates and transform this to an array of visibilities using a autoarray.operators.transformer.Transformer object and therefore a Fourier Transform.

visibilities_list_from(grid, transformer)

Evaluate the light object's list of 2D image from a input 2D grid of coordinates and transform each image to arrays of visibilities using a autoarray.operators.transformer.Transformer object and therefore a Fourier Transform.

Attributes

component_number

contribution_map

Returns the contribution map of a galaxy, which represents the fraction of flux in each pixel that the galaxy is attributed to contain, hyper to the contribution_factor hyper_galaxies-parameter.

half_light_radius

identifier

label

profile_dict