autolens.FitTimeDelays#
- class FitTimeDelays[source]#
Bases:
AbstractFitPointFits 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:
Compute the model time delays at the input image-plane positions using the tracer.
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
Subtract the observed relative time delays from the model relative time delays to compute the residuals.
Compute the chi-squared of each time delay residual.
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
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_mapReturns the chi-squared-map between the residual-map and noise-map, where:
dataOverwrite this method to returns the data of the dataset.
log_likelihoodReturns the log likelihood of each model data point's fit to the dataset, where:
magnifications_at_positionsThe magnification of every observed position in the image-plane, which is computed from the tracer's deflection angle map via the Hessian.
The model time delays of the tracer at each of the input image-plane positions.
noise_mapOverwrite this method to returns the noise-map of the dataset.
noise_normalizationReturns the noise-map normalization term of the noise-map, summing the noise_map value in every pixel as:
normalized_residual_mapReturns the normalized residual-map between the masked dataset and model data, where:
plane_indexReturns 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_redshiftReturns 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.
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_mapThe signal-to-noise_map of the dataset and noise-map which are fitted.
source_plane_coordinateReturns 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.