Lens Modeling#

Analysis#

The Analysis objects define the log_likelihood_function of how a lens model is fitted to a dataset.

It acts as an interface between the data, model and the non-linear search.

AnalysisImaging

Fits a lens model to an imaging dataset via a non-linear search (see AnalysisDataset for the full docstring of the shared parameters).

AnalysisInterferometer

Analysis classes are used by PyAutoFit to fit a model to a dataset via a non-linear search.

Non-linear Searches#

A non-linear search is an algorithm which fits a model to data. The searches are provided by PyAutoFit, and every one can be used with PyAutoLens: see PyAutoFit’s capability matrix, which lists every search, what it supports (JAX, gradients, evidence, posterior kind, install) and links to its API reference.

Priors#

The priors of parameters of every component of a model, which is fitted to data, are customized using Prior objects.

UniformPrior

A prior with a uniform distribution, defined between a lower limit and upper limit.

GaussianPrior

A Gaussian prior defined by a normal distribution.

LogUniformPrior

A prior with a log base 10 uniform distribution, defined between a lower limit and upper limit.

LogGaussianPrior

A prior for a variable whose logarithm is gaussian distributed.

Adapt#

AdaptImages

Contains the adapt-images which are used to make a pixelization's mesh and regularization adapt to the reconstructed galaxy's morphology.

Model Utilities#

Convenience functions which compose commonly used af.Model objects.

mass_field_from builds the af.Model(al.MassField, ...) external-field model that goes in a model’s fields collection, sharing the centre of its MassSheet / ExternalPotential components with the lens galaxy model’s mass centre. The primary form is fields=af.Collection(field=field). For a single field, fields=field is also supported. It shortens prior paths from fields.field.shear.gamma_1 to fields.shear.gamma_1 and therefore gives a different result identifier by design. Existing collection-form identifiers are unchanged.

mass_field_from(lens[, shear, mass_sheet, ...])

Build the af.Model(al.MassField, ...) describing the tidal field of everything outside the modelled system, with its geometry tied to a lens galaxy model.

mge_model_from(mask_radius[, ...])

Construct a Multi-Gaussian Expansion (MGE) for the lens or source galaxy light.

mge_point_model_from(pixel_scales[, ...])

Construct a Multi-Gaussian Expansion (MGE) model for a compact or unresolved point-like component (e.g. a nuclear starburst, AGN, or unresolved bulge).

hilbert_pixels_from_pixel_scale(pixel_scale)

Return the number of Hilbert-curve pixels appropriate for a given image pixel scale.