autolens.FitTimeDelays#

class FitTimeDelays[source]#

Bases: AbstractFitPoint

Fits the time delays of a point source dataset using a Tracer object, where every model time delay of the point-source is compared with its observed time delay.

The fit performs the following steps:

  1. Compute the model time delays at the input image-plane positions using the tracer.

  2. Compute the relative time delays of the dataset time delays and the time delays of the point source at these positions, which are the time delays relative to the shortest time delay

  1. Subtract the observed relative time delays from the model relative time delays to compute the residuals.

  2. Compute the chi-squared of each time delay residual.

  3. Sum the chi-squared values to compute the overall log likelihood of the fit.

Time delay fitting uses name pairing similar to flux fitting to ensure the correct point source profile is used.

Parameters:
  • name (str) – The name of the point source dataset which is paired to a Point profile.

  • data (ArrayIrregular) – The observed time delays in days of the point source.

  • noise_map (ArrayIrregular) – The noise-map of the time delays in days used to compute the log likelihood.

  • tracer (Tracer) – The tracer of galaxies whose point source profile is used to fit the time delays.

  • positions (Grid2DIrregular) – The image-plane positions of the point source where the time delays are calculated.

  • profile (Optional[Point]) – Manually input the profile of the point source, used instead of one extracted from the tracer.

Methods

Attributes

chi_squared

Returns the chi-squared of the fit of the point source time delays, which is the residual values divided by the RMS noise-map squared.

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.

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

The model time delays of the tracer at each of the input image-plane positions.

model_time_delays

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.

residual_map

Returns the difference between the observed and model time delays of the point source, which is the residual time delay of the fit.

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 model_data: ArrayIrregular#

The model time delays of the tracer at each of the input image-plane positions.

These values are not subtracted by the shorter time delay of the point source, which would make the shorter delay have a value of zero. However, this subtraction is performed in the residual_map property, in order to ensure the residuals are computed relative to the shorter time delay.

property model_time_delays: ArrayIrregular#
property residual_map: ArrayIrregular#

Returns the difference between the observed and model time delays of the point source, which is the residual time delay of the fit.

The residuals are computed relative to the shortest time delay of the point source, which is subtracted from the dataset time delays and model time delays before the subtraction.

property chi_squared: float#

Returns the chi-squared of the fit of the point source time delays, which is the residual values divided by the RMS noise-map squared.