autolens.FitPositionsImagePair#
- class FitPositionsImagePair[source]#
Bases:
AbstractFitPositionsImagePair
Abstract class to fit the positions of a point source dataset using a Tracer object with an image-plane chi-squared, where the specific implementation of the image-plane chi-squared is defined in the sub-class.
The fit performs the following steps:
Determine the source-plane centre of the point source, which could be a free model parameter or computed as the barycenter of ray-traced positions in the source-plane, using name pairing (see below).
Determine the image-plane model positions using the PointSolver and the source-plane centre of the point source (e.g. ray tracing triangles to and from the image and source planes), including accounting for multi-plane ray-tracing.
Using the sub-class specific chi-squared, compute the residuals of each image-plane position, chi-squared and overall log likelihood of the fit.
Point source fitting uses name pairing, whereby the name of the Point object is paired to the name of the point source dataset to ensure that point source datasets are fitted to the correct point source.
This fit object is used in the FitPointDataset to perform position based fitting of a PointDataset, which may also fit other components of the point dataset like fluxes or time delays.
When performing a model-fit`via an `AnalysisPoint object the figure_of_merit of this object is called and returned in the log_likelihood_function.
- Parameters:
name (
str
) – The name of the point source dataset which is paired to a Point profile.data (
Grid2DIrregular
) – The positions of the point source in the image-plane which are fitted.noise_map (
ArrayIrregular
) – The noise-map of the positions which are used to compute the log likelihood of the positions.tracer (
Tracer
) – The tracer of galaxies whose point source profile are used to fit the positions.solver (
PointSolver
) – Solves the lens equation in order to determine the image-plane positions of a point source by ray-tracing triangles to and from the source-plane.profile (
Optional
[Point
]) – Manually input the profile of the point source, which is used instead of the one extracted from the tracer via name pairing if that profile is not found.
Methods
square_distance
Calculate the square distance between two points.
Attributes
chi_squared
Returns the chi-squared terms of the model data's fit to an dataset, by summing the chi-squared-map.
chi_squared_map
Returns the chi-squared-map between the residual-map and noise-map, where:
data
Overwrite this method to returns the data of the dataset.
deflections_func
Returns the deflection angle function, which for example given input image-plane positions computes their deflection angles.
log_likelihood
Returns the log likelihood of each model data point's fit to the dataset, where:
magnifications_at_positions
The magnification of every observed position in the image-plane, which is computed from the tracer's deflection angle map via the Hessian.
model_data
Returns the model positions, which are computed via the point solver.
noise_map
Overwrite this method to returns the noise-map of the dataset.
noise_normalization
Returns the noise-map normalization term of the noise-map, summing the noise_map value in every pixel as:
normalized_residual_map
Returns the normalized residual-map between the masked dataset and model data, where:
plane_index
Returns the integer plane index containing the point source galaxy, which is used when computing the deflection angles of image-plane positions from the tracer.
plane_redshift
Returns the redshift of the plane containing the point source galaxy, which is used when computing the deflection angles of image-plane positions from the tracer.
positions
Returns the residual-map between the masked dataset and model data, where:
signal_to_noise_map
The signal-to-noise_map of the dataset and noise-map which are fitted.
source_plane_coordinate
Returns the centre of the point-source in the source-plane, which is used when computing the model image-plane positions from the tracer.
- property residual_map: ArrayIrregular#
Returns the residual-map between the masked dataset and model data, where:
Residuals = (Data - Model_Data).