autolens.FitFluxes#

class FitFluxes[source]#

Bases: FitDataset

Class to fit a masked dataset where the dataset’s data structures are any dimension.

Parameters:
  • dataset (MaskedDataset) – The masked dataset (data, mask, noise-map, etc.) that is fitted.

  • model_data – The model data the masked dataset is fitted with.

  • inversion (Inversion) – If the fit uses an Inversion this is the instance of the object used to perform the fit. This determines if the log_likelihood or log_evidence is used as the figure_of_merit.

  • use_mask_in_fit – If True, masked data points are omitted from the fit. If False they are not (in most use cases the dataset will have been processed to remove masked points, for example the slim representation).

residual_map#

The residual-map of the fit (data - model_data).

chi_squared_map#

The chi-squared-map of the fit ((data - model_data) / noise_maps ) **2.0

chi_squared#

The overall chi-squared of the model’s fit to the dataset, summed over every data point.

reduced_chi_squared#

The reduced chi-squared of the model’s fit to simulate (chi_squared / number of data points), summed over every data point.

noise_normalization#

The overall normalization term of the noise_map, summed over every data point.

log_likelihood#

The overall log likelihood of the model’s fit to the dataset, summed over evey data point.

Methods

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

rtype:

Union[Array1D, Array2D, ArrayIrregular, Visibilities]

deflections_func

Returns the defleciton function, which given the image-plane positions computes their deflection angles.

figure_of_merit

rtype:

float

fluxes

rtype:

ArrayIrregular

inversion

Overwrite this method so it returns the inversion used to fit the dataset.

log_evidence

Returns the log evidence of the inversion's fit to a dataset, where the log evidence includes a number of terms which quantify the complexity of an inversion's reconstruction (see the Inversion module):

log_likelihood

Returns the log likelihood of each model data point's fit to the dataset, where:

log_likelihood_with_regularization

Returns the log likelihood of an inversion's fit to the dataset, including a regularization term which comes from an inversion:

magnifications

The magnification of every position in the image-plane, which is computed from the tracer's deflection angle map via the Hessian.

mask

Overwrite this method so it returns the mask of the dataset which is fitted to the input data.

model_data

The model-fluxes of the tracer at each of the image-plane positions.

model_fluxes

rtype:

ArrayIrregular

noise_map

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:

reduced_chi_squared

rtype:

float

residual_flux_fraction_map

Returns the residual flux fraction map, which shows the fraction of signal in each pixel that is not fitted by the model, therefore where:

residual_map

Returns the residual map, over riding the parent method so that the result is converted to a ArrayIrregular object.

signal_to_noise_map

The signal-to-noise_map of the dataset and noise-map which are fitted.

property mask#

Overwrite this method so it returns the mask of the dataset which is fitted to the input data.

property deflections_func#

Returns the defleciton function, which given the image-plane positions computes their deflection angles.

For multi-plane ray-tracing with more than 2 planes, the deflection function determines the index of the plane with the last mass profile such that the deflection function does not perform unnecessary computations beyond this plane.

property magnifications#

The magnification of every position in the image-plane, which is computed from the tracer’s deflection angle map via the Hessian.

property model_data#

The model-fluxes of the tracer at each of the image-plane positions.

Only point sources which are a PointFlux type, and therefore which include a model parameter for its flux, are used.

property residual_map: ArrayIrregular#

Returns the residual map, over riding the parent method so that the result is converted to a ArrayIrregular object.

Return type:

ArrayIrregular

property chi_squared: float#

Returns the chi-squared terms of the model data’s fit to an dataset, by summing the chi-squared-map.

Return type:

float