autolens.MassField#
- class MassField[source]#
Bases:
ModelObject,MassProfileAggregateClass representing the external mass field at a given redshift.
- Parameters:
redshift (
float) – The redshift of the external field.kwargs – The named mass components of the field (e.g. shear, mass_sheet, potential), each of which must be a MassProfile.
Methods
cls_list_fromReturns a list of objects in the galaxy which are an instance of the input cls.
convergence_2d_fromReturns the summed 2D convergence of the galaxy's mass profiles from a 2D grid of Cartesian (y,x) coordinates.
deflections_yx_2d_fromReturns the summed 2D deflection angles of the galaxy's mass profiles from a 2D grid of Cartesian (y,x) coordinates.
A dictionary representation of this object
extract_attributeReturns an attribute of a class and its children profiles in the galaxy as a ValueIrregular or Grid2DIrregular object.
from_dictRecursively parse a dictionary returning the model, collection or instance that is represents.
hasDoes this instance have an attribute which is of type cls?
Returns a 2D image of zeros, because a MassField has no light.
Returns an empty list, because a MassField holds no light profiles.
Returns an empty list: a MassField holds no light profiles to evaluate before binning.
Returns zeros on the over-sampled grid, mirroring the light-less path of Galaxy.
next_idpotential_2d_fromReturns the summed 2D potential of the galaxy's mass profiles from a 2D grid of Cartesian (y,x) coordinates.
replacing_for_pathCreate a new model replacing the value for a given path with a new value
Attributes
component_numberidentifierlabel- image_2d_list_from(grid, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautolens/envs/latest/lib/python3.12/site-packages/numpy/__init__.py'>, operated_only=None)[source]#
Returns an empty list, because a MassField holds no light profiles.
The Galaxies class builds its list of images by calling this on each member, so the field simply contributes nothing to it.
- image_2d_list_unbinned_from(grid, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautolens/envs/latest/lib/python3.12/site-packages/numpy/__init__.py'>, operated_only=None)[source]#
Returns an empty list: a MassField holds no light profiles to evaluate before binning.
- image_2d_from(grid, xp=<module 'numpy' from '/home/docs/checkouts/readthedocs.org/user_builds/pyautolens/envs/latest/lib/python3.12/site-packages/numpy/__init__.py'>, operated_only=None)[source]#
Returns a 2D image of zeros, because a MassField has no light.
This mirrors the zeros returned by Galaxy.image_2d_from for a galaxy with no light profiles, so the sum performed by Galaxies.image_2d_from is unaffected by the presence of a field.