autolens.FitFluxes#

class autolens.FitFluxes(name: str, fluxes: ValuesIrregular, noise_map: ValuesIrregular, positions: Grid2DIrregular, tracer: Tracer, point_profile: Optional[Point] = None)[source]#
__init__(name: str, fluxes: ValuesIrregular, noise_map: ValuesIrregular, positions: Grid2DIrregular, tracer: Tracer, point_profile: Optional[Point] = None)[source]#

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

__init__(name, fluxes, noise_map, positions, ...)

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

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

deflections_func

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

figure_of_merit

fluxes

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

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:

potential_chi_squared_map

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

reduced_chi_squared

residual_map

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

signal_to_noise_map

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