autocti.AnalysisDataset1D#

class autocti.AnalysisDataset1D(dataset: ~autocti.dataset_1d.dataset_1d.dataset_1d.Dataset1D, clocker: ~autocti.clocker.one_d.Clocker1D, settings_cti: ~autocti.model.settings.SettingsCTI1D = <autocti.model.settings.SettingsCTI1D object>, dataset_full: ~typing.Optional[~autocti.dataset_1d.dataset_1d.dataset_1d.Dataset1D] = None)[source]#

Bases: AnalysisCTI

Fits a CTI model to a 1D CTI dataset via a non-linear search.

The Analysis class defines the log_likelihood_function which fits the model to the dataset and returns the log likelihood value defining how well the model fitted the data.

It handles many other tasks, such as visualization, outputting results to hard-disk and storing results in a format that can be loaded after the model-fit is complete.

This class is used for model-fits which fit a CTI model via a CTI1D object to a charge injection imaging dataset.

Parameters:
  • dataset – The 1D CTI dataset that the model is fitted to.

  • clocker – The CTI arctic clocker used by the non-linear search and model-fit.

  • settings_cti – The settings controlling aspects of the CTI model in this model-fit.

  • dataset_full – The full dataset, which is visualized separate from the dataset that is fitted, which for example may not have the FPR masked and thus enable visualization of the FPR.

Methods

fit_via_instance_and_dataset_from

fit_via_instance_from

in_ascending_fpr_order_from

log_likelihood_function

Determine the fitness of a particular model

make_result

modify_after_fit

Overwrite this method to modify the attributes of the Analysis class before the non-linear search begins.

modify_before_fit

This function is called immediately before the non-linear search begins and performs final tasks and checks before it begins.

modify_model

profile_log_likelihood_function

Overwrite this function for profiling of the log likelihood function to be performed every update of a non-linear search.

region_list_from

save_attributes

Before the model-fit via the non-linear search begins, this routine saves attributes of the Analysis object to the pickles folder such that they can be loaded after the analysis using PyAutoFit's database and aggregator tools.

save_results

At the end of a model-fit, this routine saves attributes of the Analysis object to the files folder such that they can be loaded after the analysis using PyAutoFit's database and aggregator tools.

should_visualize

Whether a visualize method should be called perform visualization, which depends on the following:

visualize

visualize_before_fit

visualize_before_fit_combined

visualize_combined

with_model

Associate an explicit model with this analysis.

modify_before_fit(paths: DirectoryPaths, model: Collection)[source]#

This function is called immediately before the non-linear search begins and performs final tasks and checks before it begins.

This function:

  1. Visualizes the 1D dataset, which does not change during the analysis and thus can be done once.

Parameters:
  • paths – The PyAutoFit paths object which manages all paths, e.g. where the non-linear search outputs are stored, visualization and the pickled objects used by the aggregator output by this function.

  • model – The PyAutoFit model object, which includes model components representing the galaxies that are fitted to the imaging data.

log_likelihood_function(instance: ModelInstance) float[source]#

Determine the fitness of a particular model

Parameters:

instance

Returns:

fit – How fit the model is and the model

Return type:

Fit

save_attributes(paths: DirectoryPaths)[source]#

Before the model-fit via the non-linear search begins, this routine saves attributes of the Analysis object to the pickles folder such that they can be loaded after the analysis using PyAutoFit’s database and aggregator tools.

For this analysis the following are output:

  • The 1D dataset (data / noise-map / pre cti data / layout / settings etc.).

  • The mask applied to the dataset.

  • The clocker used for modeling / clocking CTI.

  • The settings used for modeling / clocking CTI.

  • The full 1D dataset (e.g. unmasked, used for visualizariton).

It is common for these attributes to be loaded by many of the template aggregator functions given in the aggregator modules. For example, when using the database tools to reperform a fit, this will by default load the dataset, settings and other attributes necessary to perform a fit using the attributes output by this function.

Parameters:

paths – The PyAutoFit paths object which manages all paths, e.g. where the non-linear search outputs are stored, visualization,and the pickled objects used by the aggregator output by this function.