diff --git a/autogalaxy/__init__.py b/autogalaxy/__init__.py index 6266a883b..947855403 100644 --- a/autogalaxy/__init__.py +++ b/autogalaxy/__init__.py @@ -22,8 +22,6 @@ from autoarray.inversion.pixelization.border_relocator import BorderRelocator from autoarray.mask.mask_1d import Mask1D # noqa from autoarray.mask.mask_2d import Mask2D # noqa -from autoarray.operators.convolver import Convolver # noqa -from autoarray.operators.convolver import Convolver # noqa from autoarray.operators.transformer import TransformerDFT # noqa from autoarray.operators.transformer import TransformerNUFFT # noqa from autoarray.layout.layout import Layout2D # noqa @@ -48,8 +46,6 @@ from .analysis.adapt_images.adapt_images import AdaptImages from .analysis.adapt_images.adapt_image_maker import AdaptImageMaker -from .analysis.maker import FitMaker -from .analysis.preloads import Preloads from . import aggregator as agg from . import exc from . import plot diff --git a/autogalaxy/aggregator/imaging/fit_imaging.py b/autogalaxy/aggregator/imaging/fit_imaging.py index d10494fc1..ef22525a3 100644 --- a/autogalaxy/aggregator/imaging/fit_imaging.py +++ b/autogalaxy/aggregator/imaging/fit_imaging.py @@ -7,8 +7,6 @@ import autofit as af import autoarray as aa -from autogalaxy.analysis.preloads import Preloads - from autogalaxy.aggregator.imaging.imaging import _imaging_from from autogalaxy.aggregator.galaxies import _galaxies_from from autogalaxy.aggregator.dataset_model import _dataset_model_from @@ -19,7 +17,6 @@ def _fit_imaging_from( fit: af.Fit, instance: Optional[af.ModelInstance] = None, settings_inversion: aa.SettingsInversion = None, - use_preloaded_grid: bool = True, ) -> List[FitImaging]: """ Returns a list of `FitImaging` objects from a `PyAutoFit` loaded directory `Fit` or sqlite database `Fit` object. @@ -53,10 +50,6 @@ def _fit_imaging_from( randomly from the PDF). settings_inversion Optionally overwrite the `SettingsInversion` of the `Inversion` object that is created from the fit. - use_preloaded_grid - Certain pixelization's construct their mesh in the source-plane from a stochastic KMeans algorithm. This grid - may be output to hard-disk after the model-fit and loaded via the database to ensure the same grid is used - as the fit. """ from autogalaxy.imaging.fit_imaging import FitImaging @@ -71,25 +64,14 @@ def _fit_imaging_from( settings_inversion = settings_inversion or fit.value(name="settings_inversion") - mesh_grids_of_planes_list = agg_util.mesh_grids_of_planes_list_from( - fit=fit, total_fits=len(dataset_list), use_preloaded_grid=use_preloaded_grid - ) - fit_dataset_list = [] - for dataset, galaxies, dataset_model, adapt_images, mesh_grids_of_planes in zip( + for dataset, galaxies, dataset_model, adapt_images in zip( dataset_list, galaxies_list, dataset_model_list, adapt_images_list, - mesh_grids_of_planes_list, ): - preloads = agg_util.preloads_from( - preloads_cls=Preloads, - use_preloaded_grid=use_preloaded_grid, - mesh_grids_of_planes=mesh_grids_of_planes, - use_w_tilde=False, - ) fit_dataset_list.append( FitImaging( @@ -98,7 +80,6 @@ def _fit_imaging_from( dataset_model=dataset_model, adapt_images=adapt_images, settings_inversion=settings_inversion, - preloads=preloads, ) ) @@ -110,7 +91,6 @@ def __init__( self, aggregator: af.Aggregator, settings_inversion: Optional[aa.SettingsInversion] = None, - use_preloaded_grid: bool = True, ): """ Interfaces with an `PyAutoFit` aggregator object to create instances of `FitImaging` objects from the results @@ -145,15 +125,17 @@ def __init__( A `PyAutoFit` aggregator object which can load the results of model-fits. settings_inversion Optionally overwrite the `SettingsInversion` of the `Inversion` object that is created from the fit. - use_preloaded_grid - Certain pixelization's construct their mesh in the source-plane from a stochastic KMeans algorithm. This - grid may be output to hard-disk after the model-fit and loaded via the database to ensure the same grid is - used as the fit. + + Parameters + ---------- + aggregator + A `PyAutoFit` aggregator object which can load the results of model-fits. + settings_inversion + Optionally overwrite the `SettingsInversion` of the `Inversion` object that is created from the fit. """ super().__init__(aggregator=aggregator) self.settings_inversion = settings_inversion - self.use_preloaded_grid = use_preloaded_grid def object_via_gen_from( self, fit, instance: Optional[af.ModelInstance] = None @@ -167,7 +149,7 @@ def object_via_gen_from( ---------- fit A `PyAutoFit` `Fit` object which contains the results of a model-fit as an entry which has been loaded from - an output directory or from an sqlite database.. + an output directory or from an sqlite database.. instance A manual instance that overwrites the max log likelihood instance in fit (e.g. for drawing the instance randomly from the PDF). @@ -176,5 +158,4 @@ def object_via_gen_from( fit=fit, instance=instance, settings_inversion=self.settings_inversion, - use_preloaded_grid=self.use_preloaded_grid, ) diff --git a/autogalaxy/aggregator/interferometer/fit_interferometer.py b/autogalaxy/aggregator/interferometer/fit_interferometer.py index f2f802396..4f4034c4b 100644 --- a/autogalaxy/aggregator/interferometer/fit_interferometer.py +++ b/autogalaxy/aggregator/interferometer/fit_interferometer.py @@ -7,8 +7,6 @@ import autofit as af import autoarray as aa -from autogalaxy.analysis.preloads import Preloads - from autogalaxy.aggregator import agg_util from autogalaxy.aggregator.interferometer.interferometer import _interferometer_from from autogalaxy.aggregator.dataset_model import _dataset_model_from @@ -19,7 +17,6 @@ def _fit_interferometer_from( fit: af.Fit, instance: Optional[af.ModelInstance] = None, settings_inversion: aa.SettingsInversion = None, - use_preloaded_grid: bool = True, ) -> List[FitInterferometer]: """ Returns a list of `FitInterferometer` objects from a `PyAutoFit` loaded directory `Fit` or sqlite database `Fit` object. @@ -54,10 +51,6 @@ def _fit_interferometer_from( randomly from the PDF). settings_inversion Optionally overwrite the `SettingsInversion` of the `Inversion` object that is created from the fit. - use_preloaded_grid - Certain pixelization's construct their mesh in the source-plane from a stochastic KMeans algorithm. This grid - may be output to hard-disk after the model-fit and loaded via the database to ensure the same grid is used - as the fit. """ from autogalaxy.interferometer.fit_interferometer import FitInterferometer @@ -73,25 +66,14 @@ def _fit_interferometer_from( settings_inversion = settings_inversion or fit.value(name="settings_inversion") - mesh_grids_of_planes_list = agg_util.mesh_grids_of_planes_list_from( - fit=fit, total_fits=len(dataset_list), use_preloaded_grid=use_preloaded_grid - ) - fit_dataset_list = [] - for dataset, galaxies, dataset_model, adapt_images, mesh_grids_of_planes in zip( + for dataset, galaxies, dataset_model, adapt_images in zip( dataset_list, galaxies_list, dataset_model_list, adapt_images_list, - mesh_grids_of_planes_list, ): - preloads = agg_util.preloads_from( - preloads_cls=Preloads, - use_preloaded_grid=use_preloaded_grid, - mesh_grids_of_planes=mesh_grids_of_planes, - use_w_tilde=False, - ) fit_dataset_list.append( FitInterferometer( @@ -100,7 +82,6 @@ def _fit_interferometer_from( dataset_model=dataset_model, adapt_images=adapt_images, settings_inversion=settings_inversion, - preloads=preloads, ) ) @@ -112,50 +93,51 @@ def __init__( self, aggregator: af.Aggregator, settings_inversion: Optional[aa.SettingsInversion] = None, - use_preloaded_grid: bool = True, ): """ - Interfaces with an `PyAutoFit` aggregator object to create instances of `FitInterferometer` objects from the - results of a model-fit. + Interfaces with an `PyAutoFit` aggregator object to create instances of `FitInterferometer` objects from the + results of a model-fit. - The results of a model-fit can be loaded from hard-disk or stored in a sqlite database, including the following + The results of a model-fit can be loaded from hard-disk or stored in a sqlite database, including the following attributes of the fit: - - The interferometer data, noise-map, uv-wavelengths and settings as .fits files (e.g. `dataset/data.fits`). - - The real space mask defining the grid of the interferometer for the FFT (`dataset/real_space_mask.fits`). - - The settings of inversions used by the fit (`dataset/settings_inversion.json`). + - The interferometer data, noise-map, uv-wavelengths and settings as .fits files (e.g. `dataset/data.fits`). + - The real space mask defining the grid of the interferometer for the FFT (`dataset/real_space_mask.fits`). + - The settings of inversions used by the fit (`dataset/settings_inversion.json`). + + The `aggregator` contains the path to each of these files, and they can be loaded individually. This class + can load them all at once and create an `FitInterferometer` object via the `_fit_interferometer_from` method. - The `aggregator` contains the path to each of these files, and they can be loaded individually. This class - can load them all at once and create an `FitInterferometer` object via the `_fit_interferometer_from` method. + This class's methods returns generators which create the instances of the `FitInterferometer` objects. This ensures + that large sets of results can be efficiently loaded from the hard-disk and do not require storing all + `FitInterferometer` instances in the memory at once. - This class's methods returns generators which create the instances of the `FitInterferometer` objects. This ensures - that large sets of results can be efficiently loaded from the hard-disk and do not require storing all - `FitInterferometer` instances in the memory at once. + For example, if the `aggregator` contains 3 model-fits, this class can be used to create a generator which + creates instances of the corresponding 3 `FitInterferometer` objects. - For example, if the `aggregator` contains 3 model-fits, this class can be used to create a generator which - creates instances of the corresponding 3 `FitInterferometer` objects. + If multiple `Imaging` objects were fitted simultaneously via analysis summing, the `fit.child_values()` method + is instead used to load lists of the data, noise-map, PSF and mask and combine them into a list of + `FitImaging` objects. - If multiple `Imaging` objects were fitted simultaneously via analysis summing, the `fit.child_values()` method - is instead used to load lists of the data, noise-map, PSF and mask and combine them into a list of - `FitImaging` objects. + This can be done manually, but this object provides a more concise API. - This can be done manually, but this object provides a more concise API. + Parameters + ---------- + aggregator + A `PyAutoFit` aggregator object which can load the results of model-fits. + settings_inversion + Optionally overwrite the `SettingsInversion` of the `Inversion` object that is created from the fit. - Parameters - ---------- - aggregator - A `PyAutoFit` aggregator object which can load the results of model-fits. - settings_inversion - Optionally overwrite the `SettingsInversion` of the `Inversion` object that is created from the fit. - use_preloaded_grid - Certain pixelization's construct their mesh in the source-plane from a stochastic KMeans algorithm. This - grid may be output to hard-disk after the model-fit and loaded via the database to ensure the same grid is - used as the fit. + Parameters + ---------- + aggregator + A `PyAutoFit` aggregator object which can load the results of model-fits. + settings_inversion + Optionally overwrite the `SettingsInversion` of the `Inversion` object that is created from the fit. """ super().__init__(aggregator=aggregator) self.settings_inversion = settings_inversion - self.use_preloaded_grid = use_preloaded_grid def object_via_gen_from( self, fit, instance: Optional[af.ModelInstance] = None @@ -169,7 +151,7 @@ def object_via_gen_from( ---------- fit A `PyAutoFit` `Fit` object which contains the results of a model-fit as an entry which has been loaded from - an output directory or from an sqlite database.. + an output directory or from an sqlite database.. instance A manual instance that overwrites the max log likelihood instance in fit (e.g. for drawing the instance randomly from the PDF). @@ -178,5 +160,4 @@ def object_via_gen_from( fit=fit, instance=instance, settings_inversion=self.settings_inversion, - use_preloaded_grid=self.use_preloaded_grid, ) diff --git a/autogalaxy/analysis/analysis/analysis.py b/autogalaxy/analysis/analysis/analysis.py index ceeecbbb6..084af3104 100644 --- a/autogalaxy/analysis/analysis/analysis.py +++ b/autogalaxy/analysis/analysis/analysis.py @@ -139,7 +139,7 @@ def profile_log_likelihood_function( An `info_dict` is also created which stores information on aspects of the model and dataset that dictate run times, so the profiled times can be interpreted with this context. - The results of this profiling are then output to hard-disk in the `preloads` folder of the model-fit results, + The results of this profiling are then output to hard-disk in the `profiling` folder of the model-fit results, which they can be inspected to ensure run-times are as expected. Parameters @@ -192,33 +192,33 @@ def profile_log_likelihood_function( try: info_dict["image_pixels"] = self.dataset.grids.lp.shape_slim - info_dict[ - "sub_total_light_profiles" - ] = self.dataset.grids.lp.over_sampler.sub_total + info_dict["sub_total_light_profiles"] = ( + self.dataset.grids.lp.over_sampler.sub_total + ) except AttributeError: pass if fit.model_obj.has(cls=aa.Pixelization): info_dict["use_w_tilde"] = fit.inversion.settings.use_w_tilde try: - info_dict[ - "sub_total_pixelization" - ] = self.dataset.grids.pixelization.over_sampler.sub_total + info_dict["sub_total_pixelization"] = ( + self.dataset.grids.pixelization.over_sampler.sub_total + ) except AttributeError: pass - info_dict[ - "use_positive_only_solver" - ] = fit.inversion.settings.use_positive_only_solver - info_dict[ - "force_edge_pixels_to_zeros" - ] = fit.inversion.settings.force_edge_pixels_to_zeros + info_dict["use_positive_only_solver"] = ( + fit.inversion.settings.use_positive_only_solver + ) + info_dict["force_edge_pixels_to_zeros"] = ( + fit.inversion.settings.force_edge_pixels_to_zeros + ) info_dict["use_w_tilde_numpy"] = fit.inversion.settings.use_w_tilde_numpy info_dict["source_pixels"] = len(fit.inversion.reconstruction) if hasattr(fit.inversion, "w_tilde"): - info_dict[ - "w_tilde_curvature_preload_size" - ] = fit.inversion.w_tilde.curvature_preload.shape[0] + info_dict["w_tilde_curvature_preload_size"] = ( + fit.inversion.w_tilde.curvature_preload.shape[0] + ) self.output_profiling_info( paths=paths, run_time_dict=run_time_dict, info_dict=info_dict diff --git a/autogalaxy/analysis/analysis/dataset.py b/autogalaxy/analysis/analysis/dataset.py index 3da87d19c..6a6c899b5 100644 --- a/autogalaxy/analysis/analysis/dataset.py +++ b/autogalaxy/analysis/analysis/dataset.py @@ -1,9 +1,7 @@ import copy import logging from typing import Optional, Union -import os -from autoconf import conf from autoconf.dictable import to_dict, output_to_json from autoconf.fitsable import hdu_list_for_output_from @@ -12,8 +10,6 @@ from autogalaxy.analysis.adapt_images.adapt_image_maker import AdaptImageMaker from autogalaxy.analysis.adapt_images.adapt_images import AdaptImages -from autogalaxy.analysis.maker import FitMaker -from autogalaxy.analysis.preloads import Preloads from autogalaxy.cosmology.lensing import LensingCosmology from autogalaxy.cosmology.wrap import Planck15 from autogalaxy.analysis.analysis.analysis import Analysis @@ -64,18 +60,8 @@ def __init__( self.settings_inversion = settings_inversion or aa.SettingsInversion() - self.preloads = self.preloads_cls() - self.title_prefix = title_prefix - @property - def preloads_cls(self): - return Preloads - - @property - def fit_maker_cls(self): - return FitMaker - @property def adapt_images(self): if self._adapt_images is not None: @@ -84,67 +70,6 @@ def adapt_images(self): if self.adapt_image_maker is not None: return self.adapt_image_maker.adapt_images - def set_preloads(self, paths: af.DirectoryPaths, model: af.Collection): - """ - It is common for the model to have components whose parameters are all fixed, and thus the way that component - fits the data does not change. For example, if all parameter associated with the light profiles of galaxies - in the model are fixed, the image generated from these galaxies will not change irrespective of the model - parameters chosen by the non-linear search. - - Preloading exploits this to speed up the log likelihood function, by inspecting the model and storing in memory - quantities that do not change. For the example above, the image of all galaxies would be stored in memory and - to perform every fit in the `log_likelihood_funtion`. - - This function sets up all preload quantities, which are described fully in the `preloads` modules. This - occurs directly before the non-linear search begins, to ensure the model parameterization is fixed. - - Parameters - ---------- - paths - The 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 model object, which includes model components representing the galaxies that are fitted to - the imaging data. - """ - - logger.info( - "PRELOADS - Setting up preloads, may take a few minutes for fits using an inversion." - ) - - self.preloads = self.preloads_cls() - - settings_inversion_original = copy.copy(self.settings_inversion) - - self.settings_inversion.image_mesh_min_mesh_pixels_per_pixel = None - self.settings_inversion.image_mesh_adapt_background_percent_threshold = None - - fit_maker = self.fit_maker_cls(model=model, fit_from=self.fit_from) - - fit_0 = fit_maker.fit_via_model_from(unit_value=0.45) - fit_1 = fit_maker.fit_via_model_from(unit_value=0.55) - - if fit_0 is None or fit_1 is None: - self.preloads = self.preloads_cls(failed=True) - - self.settings_inversion = settings_inversion_original - - else: - self.preloads = self.preloads_cls.setup_all_via_fits( - fit_0=fit_0, fit_1=fit_1 - ) - - if conf.instance["general"]["test"]["check_preloads"]: - self.preloads.check_via_fit(fit=fit_0) - - self.settings_inversion = settings_inversion_original - - if isinstance(paths, af.DatabasePaths): - return - - os.makedirs(paths.profile_path, exist_ok=True) - self.preloads.output_info_to_summary(file_path=paths.profile_path) - def save_attributes(self, paths: af.DirectoryPaths): """ Before the model-fit via the non-linear search begins, this routine saves attributes of the `Analysis` object diff --git a/autogalaxy/analysis/chaining_util.py b/autogalaxy/analysis/chaining_util.py index 930b6a5f6..95306e45f 100644 --- a/autogalaxy/analysis/chaining_util.py +++ b/autogalaxy/analysis/chaining_util.py @@ -215,39 +215,29 @@ def extra_galaxies_from( for extra_galaxy_index in range(len(result.instance.extra_galaxies)): if hasattr(result.instance.extra_galaxies[extra_galaxy_index], "mass"): - extra_galaxies[ - extra_galaxy_index - ].mass.centre = result.instance.extra_galaxies[ - extra_galaxy_index - ].mass.centre - extra_galaxies[ - extra_galaxy_index - ].mass.einstein_radius = result.model.extra_galaxies[ - extra_galaxy_index - ].mass.einstein_radius + extra_galaxies[extra_galaxy_index].mass.centre = ( + result.instance.extra_galaxies[extra_galaxy_index].mass.centre + ) + extra_galaxies[extra_galaxy_index].mass.einstein_radius = ( + result.model.extra_galaxies[extra_galaxy_index].mass.einstein_radius + ) if free_centre: - extra_galaxies[ - extra_galaxy_index - ].mass.centre = result.model.extra_galaxies[ - extra_galaxy_index - ].mass.centre + extra_galaxies[extra_galaxy_index].mass.centre = ( + result.model.extra_galaxies[extra_galaxy_index].mass.centre + ) elif light_as_model: extra_galaxies = result.instance.extra_galaxies.as_model((LightProfile,)) for extra_galaxy_index in range(len(result.instance.extra_galaxies)): if extra_galaxies[extra_galaxy_index].bulge is not None: - extra_galaxies[ - extra_galaxy_index - ].bulge.centre = result.instance.extra_galaxies[ - extra_galaxy_index - ].bulge.centre + extra_galaxies[extra_galaxy_index].bulge.centre = ( + result.instance.extra_galaxies[extra_galaxy_index].bulge.centre + ) if free_centre: - extra_galaxies[ - extra_galaxy_index - ].bulge.centre = result.model.extra_galaxies[ - extra_galaxy_index - ].bulge.centre + extra_galaxies[extra_galaxy_index].bulge.centre = ( + result.model.extra_galaxies[extra_galaxy_index].bulge.centre + ) else: extra_galaxies = result.instance.extra_galaxies.as_model(()) diff --git a/autogalaxy/analysis/maker.py b/autogalaxy/analysis/maker.py deleted file mode 100644 index 154042ee9..000000000 --- a/autogalaxy/analysis/maker.py +++ /dev/null @@ -1,128 +0,0 @@ -import logging -from typing import Callable, Union - -import autoarray as aa -import autofit as af -from autoconf import conf -from autofit.exc import PriorLimitException -from autogalaxy.analysis.preloads import Preloads - -logger = logging.getLogger(__name__) - -logger.setLevel(level="INFO") - - -class FitMaker: - def __init__(self, model: af.Collection, fit_from: Callable): - """ - Makes fits using an input PyAutoFit `model`, where the parameters of the model are drawn from its prior. This - uses an input `fit_from`, which given an `instance` of the model creates the fit object. - - This is used for implicit preloading in the `Analysis` classes, whereby the created fits are compared against - one another to determine whether certain components of the analysis can be preloaded. - - This includes functionality for creating the fit via the model in different ways, so that if certain - models are ill-defined another is used instead. - - Parameters - ---------- - model - A **PyAutoFit** model object which via its parameters and their priors can created instances of the model. - fit_from - A function which given the instance of the model creates a `Fit` object. - """ - - self.model = model - self.fit_from = fit_from - - @property - def preloads_cls(self): - return Preloads - - def fit_via_model_from( - self, unit_value: float - ) -> Union[aa.FitImaging, aa.FitInterferometer]: - """ - Create a fit via the model. - - This first tries to compute the fit from the input `unit_value`, where the `unit_value` defines unit hyper - cube values of each parameter's prior in the model, used to map each value to physical values for the fit. - - If this model fit produces an `Exception` because the parameter combination does not fit the data accurately, - a sequence of random fits are instead used into an exception is not returned. However, if the number - of `preload_attempts` defined in the configuration files is exceeded a None is returned. - - Parameters - ---------- - unit_value - The unit hyper cube values of each parameter's prior in the model, used to map each value to physical - values for the fit. - - Returns - ------- - fit - A fit object where an instance of the model has been fitted to the data. - """ - try: - try: - return self.fit_unit_instance_from(unit_value=unit_value) - except IndexError as e: - raise Exception from e - except (Exception, PriorLimitException): - return self.fit_random_instance_from() - - def fit_unit_instance_from( - self, unit_value: float - ) -> Union[aa.FitImaging, aa.FitInterferometer]: - """ - Create a fit via the model using an input `unit_value`, where the `unit_value` defines unit hyper - cube values of each parameter's prior in the model, used to map each value to physical values for the fit. - - Parameters - ---------- - unit_value - The unit hyper cube values of each parameter's prior in the model, used to map each value to physical - values for the fit. - - Returns - ------- - fit - A fit object where an instance of the model has been fitted to the data. - """ - instance = self.model.instance_from_unit_vector( - unit_vector=[unit_value] * self.model.prior_count, ignore_prior_limits=True - ) - - fit = self.fit_from( - instance=instance, - ) - fit.figure_of_merit - return fit - - def fit_random_instance_from(self) -> Union[aa.FitImaging, aa.FitInterferometer]: - """ - Create a fit via the model by guessing a sequence of random fits until an exception is not returned. If - the number of `preload_attempts` defined in the configuration files is exceeded a None is returned. - - Returns - ------- - fit - A fit object where an instance of the model has been fitted to the data. - """ - - preload_attempts = conf.instance["general"]["analysis"]["preload_attempts"] - - for i in range(preload_attempts): - try: - instance = self.model.random_instance(ignore_prior_limits=True) - - fit = self.fit_from( - instance=instance, - ) - - fit.figure_of_merit - - return fit - - except Exception as e: - continue diff --git a/autogalaxy/analysis/preloads.py b/autogalaxy/analysis/preloads.py deleted file mode 100644 index b1d513e86..000000000 --- a/autogalaxy/analysis/preloads.py +++ /dev/null @@ -1,213 +0,0 @@ -import logging -import numpy as np -from os import path -from typing import Dict, Optional, List - -import autofit as af -import autoarray as aa - -logger = logging.getLogger(__name__) - -logger.setLevel(level="INFO") - - -class Preloads(aa.Preloads): - def __init__( - self, - w_tilde: Optional[aa.WTildeImaging] = None, - use_w_tilde: Optional[bool] = None, - blurred_image: Optional[aa.Array2D] = None, - image_plane_mesh_grid_pg_list: Optional[List[List[aa.Grid2D]]] = None, - relocated_grid: Optional[aa.Grid2D] = None, - mapper_list: Optional[aa.AbstractMapper] = None, - mapper_galaxy_dict: Optional[Dict[aa.AbstractMapper, "Galaxy"]] = None, - linear_func_operated_mapping_matrix_dict=None, - data_linear_func_matrix_dict=None, - mapper_operated_mapping_matrix_dict=None, - operated_mapping_matrix: Optional[np.ndarray] = None, - curvature_matrix: Optional[np.ndarray] = None, - regularization_matrix: Optional[np.ndarray] = None, - log_det_regularization_matrix_term: Optional[float] = None, - traced_mesh_grids_list_of_planes=None, - image_plane_mesh_grid_list=None, - failed=False, - ): - """ - Class which offers a concise API for settings up the preloads, which before a model-fit are set up via - a comparison of two fits using two different models. If a quantity in these two fits is identical, it does - not change thoughout the model-fit and can therefore be preloaded to avoid computation, speeding up - the analysis. - - For example, the image-plane source-plane pixelization grid (which may be computationally expensive to compute - via a KMeans algorithm) does not change for the majority of model-fits, because the associated model parameters - are fixed. Preloading avoids rerruning the KMeans algorithm for every model fitted, by preloading it in memory - and using this preload in every fit. - - Parameters - ---------- - blurred_image - The preloaded array of values containing the blurred image of a model fit (e.g. that light profile of - every galaxy in the model). This can be preloaded when no light profiles in the model vary. - w_tilde - A class containing values that enable an inversion's linear algebra to use the w-tilde formalism. This can - be preloaded when no component of the model changes the noise map (e.g. galaxies are fixed). - use_w_tilde - Whether to use the w tilde formalism, which superseeds the value in `SettingsInversions` such that w tilde - will be disabled for model-fits it is not applicable (e.g. because the noise-map changes). - traced_grids_of_planes_for_inversion - The two dimensional grids corresponding to the traced grids in a lens fit. This can be preloaded when no - mass profiles in the model vary. - image_plane_mesh_grid_pg_list - The two dimensional grids corresponding to the sparse image plane grids in a lens fit, that is ray-traced to - the source plane to form the source pixelization. This can be preloaded when no pixelizations in the model - vary. - relocated_grid - The two dimensional grids corresponding to the grid that has had its border pixels relocated for a - pixelization in a lens fit. This can be preloaded when no mass profiles in the model vary. - mapper_list - The mapper of a fit, which preloading avoids recalculation of the mapping matrix and image to source - pixel mappings. This can be preloaded when no pixelizations in the model vary. - operated_mapping_matrix - A matrix containing the mappings between PSF blurred image pixels and source pixels used in the linear - algebra of an inversion. This can be preloaded when no mass profiles and pixelizations in the model vary. - - Returns - ------- - The preloads object used to skip certain calculations in the log likelihood function. - """ - super().__init__( - w_tilde=w_tilde, - use_w_tilde=use_w_tilde, - relocated_grid=relocated_grid, - image_plane_mesh_grid_pg_list=image_plane_mesh_grid_pg_list, - mapper_list=mapper_list, - linear_func_operated_mapping_matrix_dict=linear_func_operated_mapping_matrix_dict, - data_linear_func_matrix_dict=data_linear_func_matrix_dict, - mapper_operated_mapping_matrix_dict=mapper_operated_mapping_matrix_dict, - operated_mapping_matrix=operated_mapping_matrix, - curvature_matrix=curvature_matrix, - regularization_matrix=regularization_matrix, - log_det_regularization_matrix_term=log_det_regularization_matrix_term, - traced_mesh_grids_list_of_planes=traced_mesh_grids_list_of_planes, - image_plane_mesh_grid_list=image_plane_mesh_grid_list, - ) - - self.mapper_galaxy_dict = mapper_galaxy_dict - self.blurred_image = blurred_image - self.failed = failed - - @classmethod - def setup_all_via_fits(cls, fit_0, fit_1) -> "Preloads": - """ - Setup the Preloads from two fits which use two different lens model of a model-fit. - - Parameters - ---------- - fit_0 - The first fit corresponding to a model with a specific set of unit-values. - fit_1 - The second fit corresponding to a model with a different set of unit-values. - - Returns - ------- - Preloads - Preloads which are set up based on the fit's passed in specific to a lens model. - - """ - - preloads = cls() - - if isinstance(fit_0, aa.FitImaging): - preloads.set_w_tilde_imaging(fit_0=fit_0, fit_1=fit_1) - preloads.set_blurred_image(fit_0=fit_0, fit_1=fit_1) - - preloads.set_mapper_list(fit_0=fit_0, fit_1=fit_1) - - if preloads.mapper_list is not None: - preloads.mapper_galaxy_dict = fit_0.galaxies_to_inversion.mapper_galaxy_dict - - preloads.set_operated_mapping_matrix_with_preloads(fit_0=fit_0, fit_1=fit_1) - preloads.set_linear_func_inversion_dicts(fit_0=fit_0, fit_1=fit_1) - preloads.set_curvature_matrix(fit_0=fit_0, fit_1=fit_1) - preloads.set_regularization_matrix_and_term(fit_0=fit_0, fit_1=fit_1) - - return preloads - - def set_blurred_image(self, fit_0, fit_1): - """ - If the `LightProfile`'s in a model are all fixed parameters their corresponding image and therefore PSF blurred - image do not change during the model fit and can therefore be preloaded. - - This function compares the blurred image of two fit's corresponding to two model instances, and preloads - the blurred image if the blurred image of both fits are the same. - - The preload is typically used though out search chaining pipelines, as it is common to fix the lens light for - the majority of model-fits. - - Parameters - ---------- - fit_0 - The first fit corresponding to a model with a specific set of unit-values. - fit_1 - The second fit corresponding to a model with a different set of unit-values. - """ - self.blurred_image = None - - precision = 1e-8 - - if (np.max(abs(fit_0.blurred_image - fit_1.blurred_image)) < precision) and ( - np.sum(fit_0.blurred_image) > precision - ): - self.blurred_image = fit_0.blurred_image - - logger.info( - "PRELOADS - Blurred image (e.g. the image of all light profiles) is preloaded for this model-fit." - ) - - def output_info_to_summary(self, file_path): - file_preloads = path.join(file_path, "preloads.summary") - - if self.failed: - logger.info( - "PRELOADS - Preloading failed as models gave too many exceptions, preloading therefore " - "not used." - ) - - af.formatter.output_list_of_strings_to_file( - file=file_preloads, list_of_strings=["FAILED"] - ) - - else: - af.formatter.output_list_of_strings_to_file( - file=file_preloads, list_of_strings=self.info - ) - - @property - def info(self) -> List[str]: - """ - The information on what has or has not been preloaded, which is written to the file `preloads.summary`. - - Returns - ------- - A list of strings containing True and False values as to whether a quantity has been preloaded. - """ - line = [f"W Tilde = {self.w_tilde is not None}\n"] - line += [f"Use W Tilde = {self.use_w_tilde}\n\n"] - line += [f"Blurred Image = {np.count_nonzero(self.blurred_image) != 0}\n"] - line += [f"Mapper = {self.mapper_list is not None}\n"] - line += [ - f"Blurred Mapping Matrix = {self.operated_mapping_matrix is not None}\n" - ] - line += [ - f"Inversion Linear Func (Linear Light Profile) Dicts = {self.linear_func_operated_mapping_matrix_dict is not None}\n" - ] - line += [f"Curvature Matrix = {self.curvature_matrix is not None}\n"] - line += [ - f"Curvature Matrix Mapper Diag = {self.curvature_matrix_mapper_diag is not None}\n" - ] - line += [f"Regularization Matrix = {self.regularization_matrix is not None}\n"] - line += [ - f"Log Det Regularization Matrix Term = {self.log_det_regularization_matrix_term is not None}\n" - ] - - return line diff --git a/autogalaxy/config/general.yaml b/autogalaxy/config/general.yaml index 2701b2df7..361abe732 100644 --- a/autogalaxy/config/general.yaml +++ b/autogalaxy/config/general.yaml @@ -1,9 +1,6 @@ -analysis: - preload_attempts: 250 fits: flip_for_ds9: true grid: - remove_projected_centre: false # Whether 1D plots of a light profile should remove the central point to avoid the large numerical central value skewing the y axis. max_evaluation_grid_size: 1000 # An evaluation grid whose shape is adaptive chosen is used to compute quantities like critical curves, this integer is the max size of the grid ensuring faster run times. adapt: adapt_minimum_percent: 0.01 @@ -12,6 +9,4 @@ inversion: use_border_relocator: true # If True, by default a pixelization's border is used to relocate all pixels outside its border to the border. test: check_likelihood_function: true # if True, when a search is resumed the likelihood of a previous sample is recalculated to ensure it is consistent with the previous run. - check_preloads: false - exception_override: false - preloads_check_threshold: 1.0 # If the figure of merit of a fit with and without preloads is greater than this threshold, the check preload test fails and an exception raised for a model-fit. + exception_override: false \ No newline at end of file diff --git a/autogalaxy/config/grids.yaml b/autogalaxy/config/grids.yaml deleted file mode 100644 index e77427ee3..000000000 --- a/autogalaxy/config/grids.yaml +++ /dev/null @@ -1,76 +0,0 @@ -# Certain light and mass profile calculations become ill defined at (0.0, 0.0) or close to this value. This can lead -# to numerical issues in the calculation of the profile, for example a np.nan may arise, crashing the code. - -# To avoid this, we set a minimum value for the radial coordinate of the profile. If the radial coordinate is below -# this value, it is rounded up to this value. This ensures that the profile cannot receive a radial coordinate of 0.0. - -# For example, if an input grid coordinate has a radial coordinate of 1e-12, for most profiles this will be rounded up -# to radial_minimum=1e-08. This is a small enough value that it should not impact the results of the profile calculation. - -radial_minimum: - radial_minimum: - Chameleon: 1.0e-08 - ChameleonSph: 1.0e-08 - DevVaucouleurs: 1.0e-06 - DevVaucouleursSph: 1.0e-06 - dPIE: 1.0e-08 - dPIESph: 1.0e-08 - ExponentialGradient: 1.0e-06 - ExponentialGradientSph: 1.0e-06 - ElsonFreeFall: 1.0e-08 - ElsonFreeFallSph: 1.0e-08 - Exponential: 1.0e-06 - ExponentialCore: 1.0e-06 - ExponentialCoreSph: 1.0e-06 - ExponentialSph: 1.0e-06 - ExternalShear: 1.0e-08 - Gaussian: 1.0e-08 - GaussianGradient: 1.0e-08 - GaussianSph: 1.0e-08 - gNFW: 1.0e-06 - gNFWMCRLudlow: 1.0e-06 - gNFWVirialMassConcSph: 1.0e-06 - gNFWVirialMassgNFWConcSph: 1.0e-06 - gNFWSph: 1.0e-06 - Isothermal: 1.0e-08 - IsothermalCore: 1.0e-08 - IsothermalCoreSph: 1.0e-08 - IsothermalSph: 1.0e-08 - MassSheet: 1.0e-08 - Moffat: 1.0e-08 - MoffatSph: 1.0e-08 - PowerLawMultipole: 1.0e-08 - NFW: 1.0e-06 - NFWMCRDuffySph: 1.0e-06 - NFWMCRLudlow: 1.0e-06 - NFWMCRLudlowSph: 1.0e-06 - NFWMCRScatterLudlow: 1.0e-06 - NFWMCRScatterLudlowSph: 1.0e-06 - NFWVirialMassConcSph : 1.0e-06 - NFWSph: 1.0e-06 - NFWTruncatedMCRDuffySph: 1.0e-06 - NFWTruncatedMCRLudlowSph: 1.0e-06 - NFWTruncatedMCRScatterLudlowSph: 1.0e-06 - NFWTruncatedSph: 1.0e-06 - PointMass: 1.0e-08 - PowerLaw: 1.0e-08 - PowerLawBroken: 1.0e-08 - PowerLawBrokenSph: 1.0e-08 - PowerLawCore: 1.0e-08 - PowerLawCoreSph: 1.0e-08 - PowerLawSph: 1.0e-08 - Sersic: 1.0e-06 - SersicCore: 1.0e-06 - SersicCoreSph: 1.0e-06 - SersicGradient: 1.0e-06 - SersicSph: 1.0e-06 - SersicGradientSph: 1.0e-06 - ShapeletCartesianSph: 1.0e-8 - ShapeletCartesian: 1.0e-8 - ShapeletPolarSph: 1.0e-8 - ShapeletPolar: 1.0e-8 - ShapeletExponentialSph: 1.0e-8 - ShapeletExponential: 1.0e-8 - SMBH: 1.0e-8 - SMBHBinary: 1.0e-8 - EllProfile: 1.0e-08 diff --git a/autogalaxy/config/notation.yaml b/autogalaxy/config/notation.yaml index 264a3c8de..8cf2f8d32 100644 --- a/autogalaxy/config/notation.yaml +++ b/autogalaxy/config/notation.yaml @@ -9,7 +9,6 @@ label: centre_1: x coefficient: \lambda c_2: c_{\rm 2} - c_gNFW: c_{\rm gNFW} concentration: conc core_radius: C_{\rm r} core_radius_0: C_{rm r0} @@ -141,4 +140,4 @@ label_format: virial_mass: '{:.4f}' virial_overdens: '{:.4f}' weight_floor: '{:.4f}' - weight_power: '{:.4f}' + weight_power: '{:.4f}' \ No newline at end of file diff --git a/autogalaxy/config/priors/basis.yaml b/autogalaxy/config/priors/basis.yaml index d4b4187f1..a208ccb42 100644 --- a/autogalaxy/config/priors/basis.yaml +++ b/autogalaxy/config/priors/basis.yaml @@ -1 +1 @@ -Basis: {} +Basis: {} diff --git a/autogalaxy/config/priors/cosmology.yaml b/autogalaxy/config/priors/cosmology.yaml index 1efc5d637..656941bba 100644 --- a/autogalaxy/config/priors/cosmology.yaml +++ b/autogalaxy/config/priors/cosmology.yaml @@ -1,63 +1,63 @@ -model.LambdaCDMWrap: - H0: - type: Constant - value: 67.66 - Om0: - type: Constant - value: 0.30966 - Ode0: - type: Constant - value: 0.69034 - Tcmb0: - type: Constant - value: 2.7255 - Neff: - type: Constant - value: 3.046 - m_nu: - type: Constant - value: 0.06 - Ob0: - type: Constant - value: 0.04897 -model.FlatLambdaCDMWrap: - H0: - type: Constant - value: 67.66 - Om0: - type: Constant - value: 0.30966 - Tcmb0: - type: Constant - value: 2.7255 - Neff: - type: Constant - value: 3.046 - m_nu: - type: Constant - value: 0.06 - Ob0: - type: Constant - value: 0.04897 -model.FlatwCDMWrap: - H0: - type: Constant - value: 67.66 - Om0: - type: Constant - value: 0.30966 - w0: - type: Constant - value: -1.0 - Tcmb0: - type: Constant - value: 2.7255 - Neff: - type: Constant - value: 3.046 - m_nu: - type: Constant - value: 0.06 - Ob0: - type: Constant +model.LambdaCDMWrap: + H0: + type: Constant + value: 67.66 + Om0: + type: Constant + value: 0.30966 + Ode0: + type: Constant + value: 0.69034 + Tcmb0: + type: Constant + value: 2.7255 + Neff: + type: Constant + value: 3.046 + m_nu: + type: Constant + value: 0.06 + Ob0: + type: Constant + value: 0.04897 +model.FlatLambdaCDMWrap: + H0: + type: Constant + value: 67.66 + Om0: + type: Constant + value: 0.30966 + Tcmb0: + type: Constant + value: 2.7255 + Neff: + type: Constant + value: 3.046 + m_nu: + type: Constant + value: 0.06 + Ob0: + type: Constant + value: 0.04897 +model.FlatwCDMWrap: + H0: + type: Constant + value: 67.66 + Om0: + type: Constant + value: 0.30966 + w0: + type: Constant + value: -1.0 + Tcmb0: + type: Constant + value: 2.7255 + Neff: + type: Constant + value: 3.046 + m_nu: + type: Constant + value: 0.06 + Ob0: + type: Constant value: 0.04897 \ No newline at end of file diff --git a/autogalaxy/config/priors/light/linear/chameleon.yaml b/autogalaxy/config/priors/light/linear/chameleon.yaml index 212701531..c6fc9d5ef 100644 --- a/autogalaxy/config/priors/light/linear/chameleon.yaml +++ b/autogalaxy/config/priors/light/linear/chameleon.yaml @@ -1,114 +1,114 @@ -Chameleon: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - core_radius_0: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Absolute - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - core_radius_1: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Absolute - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 -ChameleonSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - core_radius_0: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Absolute - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - core_radius_1: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Absolute - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf +Chameleon: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + core_radius_0: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Absolute + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + core_radius_1: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Absolute + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 +ChameleonSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + core_radius_0: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Absolute + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + core_radius_1: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Absolute + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/light/linear/dev_vaucouleurs.yaml b/autogalaxy/config/priors/light/linear/dev_vaucouleurs.yaml index 1c4bd5220..e6b47b4fb 100644 --- a/autogalaxy/config/priors/light/linear/dev_vaucouleurs.yaml +++ b/autogalaxy/config/priors/light/linear/dev_vaucouleurs.yaml @@ -1,94 +1,94 @@ -DevVaucouleurs: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 -DevVaucouleursSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf +DevVaucouleurs: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 +DevVaucouleursSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/light/linear/eff.yaml b/autogalaxy/config/priors/light/linear/eff.yaml index 548249856..7a2847408 100644 --- a/autogalaxy/config/priors/light/linear/eff.yaml +++ b/autogalaxy/config/priors/light/linear/eff.yaml @@ -1,114 +1,114 @@ -ElsonFreeFall: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - eta: - type: Uniform - lower_limit: 0.5 - upper_limit: 3.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.0 - upper: 5.0 -ElsonFreeFallSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - eta: - type: Uniform - lower_limit: 0.5 - upper_limit: 3.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.0 - upper: 5.0 +ElsonFreeFall: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + eta: + type: Uniform + lower_limit: 0.5 + upper_limit: 3.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.0 + upper: 5.0 +ElsonFreeFallSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + eta: + type: Uniform + lower_limit: 0.5 + upper_limit: 3.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.0 + upper: 5.0 diff --git a/autogalaxy/config/priors/light/linear/exponential.yaml b/autogalaxy/config/priors/light/linear/exponential.yaml index 5bc79c66b..1c840c800 100644 --- a/autogalaxy/config/priors/light/linear/exponential.yaml +++ b/autogalaxy/config/priors/light/linear/exponential.yaml @@ -1,94 +1,94 @@ -Exponential: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 -ExponentialSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf +Exponential: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 +ExponentialSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/light/linear/exponential_core.yaml b/autogalaxy/config/priors/light/linear/exponential_core.yaml index 041d297d3..f0f0845bb 100644 --- a/autogalaxy/config/priors/light/linear/exponential_core.yaml +++ b/autogalaxy/config/priors/light/linear/exponential_core.yaml @@ -1,112 +1,112 @@ -ExponentialCore: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - alpha: - type: Constant - value: 3.0 - gamma: - type: Constant - value: 0.25 - radius_break: - type: Constant - value: 0.025 -ExponentialCoreSph: - alpha: - type: Constant - value: 3.0 - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - gamma: - type: Constant - value: 0.25 - radius_break: - type: Constant - value: 0.025 +ExponentialCore: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + alpha: + type: Constant + value: 3.0 + gamma: + type: Constant + value: 0.25 + radius_break: + type: Constant + value: 0.025 +ExponentialCoreSph: + alpha: + type: Constant + value: 3.0 + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + gamma: + type: Constant + value: 0.25 + radius_break: + type: Constant + value: 0.025 diff --git a/autogalaxy/config/priors/light/linear/gaussian.yaml b/autogalaxy/config/priors/light/linear/gaussian.yaml index 6ded43381..ffe10a146 100644 --- a/autogalaxy/config/priors/light/linear/gaussian.yaml +++ b/autogalaxy/config/priors/light/linear/gaussian.yaml @@ -1,94 +1,94 @@ -Gaussian: - sigma: - type: Uniform - lower_limit: 0.0 - upper_limit: 25.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 -GaussianSph: - sigma: - type: Uniform - lower_limit: 0.0 - upper_limit: 25.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf +Gaussian: + sigma: + type: Uniform + lower_limit: 0.0 + upper_limit: 25.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 +GaussianSph: + sigma: + type: Uniform + lower_limit: 0.0 + upper_limit: 25.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf diff --git a/autogalaxy/config/priors/light/linear/moffat.yaml b/autogalaxy/config/priors/light/linear/moffat.yaml index a8a484a54..35f6e0740 100644 --- a/autogalaxy/config/priors/light/linear/moffat.yaml +++ b/autogalaxy/config/priors/light/linear/moffat.yaml @@ -1,114 +1,114 @@ -Moffat: - alpha: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - beta: - type: Uniform - lower_limit: 1.0 - upper_limit: 5.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 -MoffatSph: - alpha: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - beta: - type: Uniform - lower_limit: 1.0 - upper_limit: 5.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf +Moffat: + alpha: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + beta: + type: Uniform + lower_limit: 1.0 + upper_limit: 5.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 +MoffatSph: + alpha: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + beta: + type: Uniform + lower_limit: 1.0 + upper_limit: 5.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf diff --git a/autogalaxy/config/priors/light/linear/sersic.yaml b/autogalaxy/config/priors/light/linear/sersic.yaml index 277bad262..4ad9e921e 100644 --- a/autogalaxy/config/priors/light/linear/sersic.yaml +++ b/autogalaxy/config/priors/light/linear/sersic.yaml @@ -1,114 +1,114 @@ -Sersic: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - sersic_index: - type: Uniform - lower_limit: 0.8 - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.8 - upper: 5.0 -SersicSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - sersic_index: - type: Uniform - lower_limit: 0.8 - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.8 - upper: 5.0 +Sersic: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + sersic_index: + type: Uniform + lower_limit: 0.8 + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.8 + upper: 5.0 +SersicSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + sersic_index: + type: Uniform + lower_limit: 0.8 + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.8 + upper: 5.0 diff --git a/autogalaxy/config/priors/light/linear/sersic_core.yaml b/autogalaxy/config/priors/light/linear/sersic_core.yaml index 0b36998e7..7d3f4cd84 100644 --- a/autogalaxy/config/priors/light/linear/sersic_core.yaml +++ b/autogalaxy/config/priors/light/linear/sersic_core.yaml @@ -1,132 +1,132 @@ -SersicCore: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - sersic_index: - type: Uniform - lower_limit: 0.8 - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.8 - upper: 5.0 - alpha: - type: Constant - value: 3.0 - gamma: - type: Constant - value: 0.25 - radius_break: - type: Constant - value: 0.025 -SersicCoreSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - sersic_index: - type: Uniform - lower_limit: 0.8 - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.8 - upper: 5.0 - alpha: - type: Constant - value: 3.0 - gamma: - type: Constant - value: 0.25 - radius_break: - type: Constant +SersicCore: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + sersic_index: + type: Uniform + lower_limit: 0.8 + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.8 + upper: 5.0 + alpha: + type: Constant + value: 3.0 + gamma: + type: Constant + value: 0.25 + radius_break: + type: Constant + value: 0.025 +SersicCoreSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + sersic_index: + type: Uniform + lower_limit: 0.8 + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.8 + upper: 5.0 + alpha: + type: Constant + value: 3.0 + gamma: + type: Constant + value: 0.25 + radius_break: + type: Constant value: 0.025 \ No newline at end of file diff --git a/autogalaxy/config/priors/light/linear_operated/gaussian.yaml b/autogalaxy/config/priors/light/linear_operated/gaussian.yaml index 3d6a67991..37db03afa 100644 --- a/autogalaxy/config/priors/light/linear_operated/gaussian.yaml +++ b/autogalaxy/config/priors/light/linear_operated/gaussian.yaml @@ -1,69 +1,69 @@ -Gaussian: - sigma: - type: Uniform - lower_limit: 0.0 - upper_limit: 5.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf +Gaussian: + sigma: + type: Uniform + lower_limit: 0.0 + upper_limit: 5.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/light/linear_operated/moffat.yaml b/autogalaxy/config/priors/light/linear_operated/moffat.yaml index 8d3a97a23..526ea7765 100644 --- a/autogalaxy/config/priors/light/linear_operated/moffat.yaml +++ b/autogalaxy/config/priors/light/linear_operated/moffat.yaml @@ -1,69 +1,69 @@ -Moffat: - alpha: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - beta: - type: Uniform - lower_limit: 1.0 - upper_limit: 5.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 +Moffat: + alpha: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + beta: + type: Uniform + lower_limit: 1.0 + upper_limit: 5.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 diff --git a/autogalaxy/config/priors/light/operated/gaussian.yaml b/autogalaxy/config/priors/light/operated/gaussian.yaml index 3d6a67991..37db03afa 100644 --- a/autogalaxy/config/priors/light/operated/gaussian.yaml +++ b/autogalaxy/config/priors/light/operated/gaussian.yaml @@ -1,69 +1,69 @@ -Gaussian: - sigma: - type: Uniform - lower_limit: 0.0 - upper_limit: 5.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf +Gaussian: + sigma: + type: Uniform + lower_limit: 0.0 + upper_limit: 5.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/light/operated/moffat.yaml b/autogalaxy/config/priors/light/operated/moffat.yaml index 40addc1d9..34d6185fc 100644 --- a/autogalaxy/config/priors/light/operated/moffat.yaml +++ b/autogalaxy/config/priors/light/operated/moffat.yaml @@ -1,79 +1,79 @@ -Moffat: - alpha: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - beta: - type: Uniform - lower_limit: 1.0 - upper_limit: 5.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf +Moffat: + alpha: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + beta: + type: Uniform + lower_limit: 1.0 + upper_limit: 5.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/light/operated/sersic.yaml b/autogalaxy/config/priors/light/operated/sersic.yaml index 4db2ca6b1..d53a170e4 100644 --- a/autogalaxy/config/priors/light/operated/sersic.yaml +++ b/autogalaxy/config/priors/light/operated/sersic.yaml @@ -1,79 +1,79 @@ -ersic: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - sersic_index: - type: Uniform - lower_limit: 0.8 - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.8 - upper: 5.0 +ersic: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + sersic_index: + type: Uniform + lower_limit: 0.8 + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.8 + upper: 5.0 diff --git a/autogalaxy/config/priors/light/standard/chameleon.yaml b/autogalaxy/config/priors/light/standard/chameleon.yaml index 971679724..d5d25af83 100644 --- a/autogalaxy/config/priors/light/standard/chameleon.yaml +++ b/autogalaxy/config/priors/light/standard/chameleon.yaml @@ -1,134 +1,134 @@ -Chameleon: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - core_radius_0: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Absolute - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - core_radius_1: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Absolute - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf -ChameleonSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - core_radius_0: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Absolute - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - core_radius_1: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Absolute - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf +Chameleon: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + core_radius_0: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Absolute + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + core_radius_1: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Absolute + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf +ChameleonSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + core_radius_0: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Absolute + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + core_radius_1: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Absolute + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/light/standard/dev_vaucouleurs.yaml b/autogalaxy/config/priors/light/standard/dev_vaucouleurs.yaml index 02b23e42f..4a8b8e391 100644 --- a/autogalaxy/config/priors/light/standard/dev_vaucouleurs.yaml +++ b/autogalaxy/config/priors/light/standard/dev_vaucouleurs.yaml @@ -1,114 +1,114 @@ -DevVaucouleurs: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf -DevVaucouleursSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf +DevVaucouleurs: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf +DevVaucouleursSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/light/standard/eff.yaml b/autogalaxy/config/priors/light/standard/eff.yaml index 3c36e9b99..9e0819937 100644 --- a/autogalaxy/config/priors/light/standard/eff.yaml +++ b/autogalaxy/config/priors/light/standard/eff.yaml @@ -1,134 +1,134 @@ -ElsonFreeFall: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - eta: - type: Uniform - lower_limit: 0.5 - upper_limit: 3.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.0 - upper: 5.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf -ElsonFreeFallSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - eta: - type: Uniform - lower_limit: 0.5 - upper_limit: 3.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.0 - upper: 5.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf +ElsonFreeFall: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + eta: + type: Uniform + lower_limit: 0.5 + upper_limit: 3.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.0 + upper: 5.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf +ElsonFreeFallSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + eta: + type: Uniform + lower_limit: 0.5 + upper_limit: 3.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.0 + upper: 5.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/light/standard/exponential.yaml b/autogalaxy/config/priors/light/standard/exponential.yaml index c34c6e927..820fec183 100644 --- a/autogalaxy/config/priors/light/standard/exponential.yaml +++ b/autogalaxy/config/priors/light/standard/exponential.yaml @@ -1,114 +1,114 @@ -Exponential: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf -ExponentialSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf +Exponential: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf +ExponentialSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/light/standard/exponential_core.yaml b/autogalaxy/config/priors/light/standard/exponential_core.yaml index df091ff31..8d4597f47 100644 --- a/autogalaxy/config/priors/light/standard/exponential_core.yaml +++ b/autogalaxy/config/priors/light/standard/exponential_core.yaml @@ -1,132 +1,132 @@ -ExponentialCore: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-05 - upper_limit: 1000.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf - alpha: - type: Constant - value: 3.0 - gamma: - type: Constant - value: 0.25 - radius_break: - type: Constant - value: 0.025 -ExponentialCoreSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - intensity: - type: LogUniform - lower_limit: 1.0e-05 - upper_limit: 1000.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf - alpha: - type: Constant - value: 3.0 - gamma: - type: Constant - value: 0.25 - radius_break: - type: Constant - value: 0.025 +ExponentialCore: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-05 + upper_limit: 1000.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf + alpha: + type: Constant + value: 3.0 + gamma: + type: Constant + value: 0.25 + radius_break: + type: Constant + value: 0.025 +ExponentialCoreSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + intensity: + type: LogUniform + lower_limit: 1.0e-05 + upper_limit: 1000.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf + alpha: + type: Constant + value: 3.0 + gamma: + type: Constant + value: 0.25 + radius_break: + type: Constant + value: 0.025 diff --git a/autogalaxy/config/priors/light/standard/gaussian.yaml b/autogalaxy/config/priors/light/standard/gaussian.yaml index ac712a116..09cdaf30e 100644 --- a/autogalaxy/config/priors/light/standard/gaussian.yaml +++ b/autogalaxy/config/priors/light/standard/gaussian.yaml @@ -1,114 +1,114 @@ -Gaussian: - sigma: - type: Uniform - lower_limit: 0.0 - upper_limit: 25.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf -GaussianSph: - sigma: - type: Uniform - lower_limit: 0.0 - upper_limit: 25.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf +Gaussian: + sigma: + type: Uniform + lower_limit: 0.0 + upper_limit: 25.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf +GaussianSph: + sigma: + type: Uniform + lower_limit: 0.0 + upper_limit: 25.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/light/standard/moffat.yaml b/autogalaxy/config/priors/light/standard/moffat.yaml index 4894fb419..77dfa3353 100644 --- a/autogalaxy/config/priors/light/standard/moffat.yaml +++ b/autogalaxy/config/priors/light/standard/moffat.yaml @@ -1,134 +1,134 @@ -Moffat: - alpha: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - beta: - type: Uniform - lower_limit: 1.0 - upper_limit: 5.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf -MoffatSph: - alpha: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - beta: - type: Uniform - lower_limit: 1.0 - upper_limit: 5.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf +Moffat: + alpha: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + beta: + type: Uniform + lower_limit: 1.0 + upper_limit: 5.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf +MoffatSph: + alpha: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + beta: + type: Uniform + lower_limit: 1.0 + upper_limit: 5.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/light/standard/sersic.yaml b/autogalaxy/config/priors/light/standard/sersic.yaml index 5593b9562..660c3ebfd 100644 --- a/autogalaxy/config/priors/light/standard/sersic.yaml +++ b/autogalaxy/config/priors/light/standard/sersic.yaml @@ -1,134 +1,134 @@ -Sersic: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - sersic_index: - type: Uniform - lower_limit: 0.8 - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.8 - upper: 5.0 -SersicSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - sersic_index: - type: Uniform - lower_limit: 0.8 - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.8 - upper: 5.0 +Sersic: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + sersic_index: + type: Uniform + lower_limit: 0.8 + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.8 + upper: 5.0 +SersicSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + sersic_index: + type: Uniform + lower_limit: 0.8 + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.8 + upper: 5.0 diff --git a/autogalaxy/config/priors/light/standard/sersic_core.yaml b/autogalaxy/config/priors/light/standard/sersic_core.yaml index 19a894c9c..ad0b2f31c 100644 --- a/autogalaxy/config/priors/light/standard/sersic_core.yaml +++ b/autogalaxy/config/priors/light/standard/sersic_core.yaml @@ -1,152 +1,152 @@ -SersicCore: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-05 - upper_limit: 1000.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf - sersic_index: - type: Uniform - lower_limit: 0.8 - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.8 - upper: 5.0 - alpha: - type: Constant - value: 3.0 - gamma: - type: Constant - value: 0.25 - radius_break: - type: Constant - value: 0.025 -SersicCoreSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - intensity: - type: LogUniform - lower_limit: 1.0e-05 - upper_limit: 1000.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf - sersic_index: - type: Uniform - lower_limit: 0.8 - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.8 - upper: 5.0 - alpha: - type: Constant - value: 3.0 - gamma: - type: Constant - value: 0.25 - radius_break: - type: Constant - value: 0.025 +SersicCore: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-05 + upper_limit: 1000.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf + sersic_index: + type: Uniform + lower_limit: 0.8 + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.8 + upper: 5.0 + alpha: + type: Constant + value: 3.0 + gamma: + type: Constant + value: 0.25 + radius_break: + type: Constant + value: 0.025 +SersicCoreSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + intensity: + type: LogUniform + lower_limit: 1.0e-05 + upper_limit: 1000.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf + sersic_index: + type: Uniform + lower_limit: 0.8 + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.8 + upper: 5.0 + alpha: + type: Constant + value: 3.0 + gamma: + type: Constant + value: 0.25 + radius_break: + type: Constant + value: 0.025 diff --git a/autogalaxy/config/priors/mass/dark/gnfw.yaml b/autogalaxy/config/priors/mass/dark/gnfw.yaml index e7438167a..de3949a02 100644 --- a/autogalaxy/config/priors/mass/dark/gnfw.yaml +++ b/autogalaxy/config/priors/mass/dark/gnfw.yaml @@ -1,134 +1,134 @@ -gNFW: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - inner_slope: - type: Uniform - lower_limit: 0.0 - upper_limit: 2.0 - width_modifier: - type: Absolute - value: 0.3 - gaussian_limits: - lower: -1.0 - upper: 3.0 - kappa_s: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf - scale_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf -gNFWSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - inner_slope: - type: Uniform - lower_limit: 0.0 - upper_limit: 2.0 - width_modifier: - type: Absolute - value: 0.3 - gaussian_limits: - lower: -1.0 - upper: 3.0 - kappa_s: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf - scale_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf +gNFW: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + inner_slope: + type: Uniform + lower_limit: 0.0 + upper_limit: 2.0 + width_modifier: + type: Absolute + value: 0.3 + gaussian_limits: + lower: -1.0 + upper: 3.0 + kappa_s: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf + scale_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf +gNFWSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + inner_slope: + type: Uniform + lower_limit: 0.0 + upper_limit: 2.0 + width_modifier: + type: Absolute + value: 0.3 + gaussian_limits: + lower: -1.0 + upper: 3.0 + kappa_s: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf + scale_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/mass/dark/gnfw_mcr.yaml b/autogalaxy/config/priors/mass/dark/gnfw_mcr.yaml index 4e2a7ad3a..976821ec4 100644 --- a/autogalaxy/config/priors/mass/dark/gnfw_mcr.yaml +++ b/autogalaxy/config/priors/mass/dark/gnfw_mcr.yaml @@ -1,89 +1,89 @@ -gNFWMCRLudlow: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - inner_slope: - type: Uniform - lower_limit: 0.0 - upper_limit: 2.0 - width_modifier: - type: Absolute - value: 0.3 - gaussian_limits: - lower: -1.0 - upper: 3.0 - mass_at_200: - type: LogUniform - lower_limit: 100000000.0 - upper_limit: 1000000000000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_object: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_source: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf +gNFWMCRLudlow: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + inner_slope: + type: Uniform + lower_limit: 0.0 + upper_limit: 2.0 + width_modifier: + type: Absolute + value: 0.3 + gaussian_limits: + lower: -1.0 + upper: 3.0 + mass_at_200: + type: LogUniform + lower_limit: 100000000.0 + upper_limit: 1000000000000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_object: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_source: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/mass/dark/gnfw_virial_mass_conc.yaml b/autogalaxy/config/priors/mass/dark/gnfw_virial_mass_conc.yaml index f3f8ba6bf..20956f214 100644 --- a/autogalaxy/config/priors/mass/dark/gnfw_virial_mass_conc.yaml +++ b/autogalaxy/config/priors/mass/dark/gnfw_virial_mass_conc.yaml @@ -1,85 +1,85 @@ -gNFWVirialMassConcSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - log10m_vir: - type: Uniform - lower_limit: 7.0 - upper_limit: 12.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - c_2: - type: LogUniform - lower_limit: 1.0 - upper_limit: 100.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - overdens: - type: Uniform - lower_limit: 100.0 - upper_limit: 250.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_object: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_source: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - inner_slope: - type: Uniform - lower_limit: 0.0 - upper_limit: 2.0 - width_modifier: - type: Absolute - value: 0.3 - gaussian_limits: - lower: -1.0 +gNFWVirialMassConcSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + log10m_vir: + type: Uniform + lower_limit: 7.0 + upper_limit: 12.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + c_2: + type: LogUniform + lower_limit: 1.0 + upper_limit: 100.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + overdens: + type: Uniform + lower_limit: 100.0 + upper_limit: 250.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_object: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_source: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + inner_slope: + type: Uniform + lower_limit: 0.0 + upper_limit: 2.0 + width_modifier: + type: Absolute + value: 0.3 + gaussian_limits: + lower: -1.0 upper: 3.0 \ No newline at end of file diff --git a/autogalaxy/config/priors/mass/dark/nfw.yaml b/autogalaxy/config/priors/mass/dark/nfw.yaml index 0345d21ab..a6790a099 100644 --- a/autogalaxy/config/priors/mass/dark/nfw.yaml +++ b/autogalaxy/config/priors/mass/dark/nfw.yaml @@ -1,114 +1,114 @@ -NFW: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - kappa_s: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf - scale_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf -NFWSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - kappa_s: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf - scale_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf +NFW: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + kappa_s: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf + scale_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf +NFWSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + kappa_s: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf + scale_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/mass/dark/nfw_mcr.yaml b/autogalaxy/config/priors/mass/dark/nfw_mcr.yaml index 305a2285f..bb45526b1 100644 --- a/autogalaxy/config/priors/mass/dark/nfw_mcr.yaml +++ b/autogalaxy/config/priors/mass/dark/nfw_mcr.yaml @@ -1,189 +1,189 @@ -NFWMCRDuffySph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - mass_at_200: - type: LogUniform - lower_limit: 100000000.0 - upper_limit: 1000000000000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_object: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_source: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf -NFWMCRLudlow: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - mass_at_200: - type: LogUniform - lower_limit: 100000000.0 - upper_limit: 1000000000000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_object: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_source: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf -NFWMCRLudlowSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - mass_at_200: - type: LogUniform - lower_limit: 100000000.0 - upper_limit: 1000000000000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_object: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_source: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf +NFWMCRDuffySph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + mass_at_200: + type: LogUniform + lower_limit: 100000000.0 + upper_limit: 1000000000000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_object: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_source: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf +NFWMCRLudlow: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + mass_at_200: + type: LogUniform + lower_limit: 100000000.0 + upper_limit: 1000000000000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_object: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_source: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf +NFWMCRLudlowSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + mass_at_200: + type: LogUniform + lower_limit: 100000000.0 + upper_limit: 1000000000000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_object: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_source: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/mass/dark/nfw_mcr_scatter.yaml b/autogalaxy/config/priors/mass/dark/nfw_mcr_scatter.yaml index 660f0802f..b46e2c8f0 100644 --- a/autogalaxy/config/priors/mass/dark/nfw_mcr_scatter.yaml +++ b/autogalaxy/config/priors/mass/dark/nfw_mcr_scatter.yaml @@ -1,67 +1,67 @@ -NFWMCRScatterLudlowSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - mass_at_200: - type: LogUniform - lower_limit: 100000000.0 - upper_limit: 1000000000000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_object: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_source: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - scatter: - type: Gaussian - mean: 0.0 - sigma: 3.0 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 1.0 - gaussian_limits: - lower: -inf - upper: inf +NFWMCRScatterLudlowSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + mass_at_200: + type: LogUniform + lower_limit: 100000000.0 + upper_limit: 1000000000000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_object: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_source: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + scatter: + type: Gaussian + mean: 0.0 + sigma: 3.0 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 1.0 + gaussian_limits: + lower: -inf + upper: inf diff --git a/autogalaxy/config/priors/mass/dark/nfw_truncated.yaml b/autogalaxy/config/priors/mass/dark/nfw_truncated.yaml index c6fab741c..95368e812 100644 --- a/autogalaxy/config/priors/mass/dark/nfw_truncated.yaml +++ b/autogalaxy/config/priors/mass/dark/nfw_truncated.yaml @@ -1,55 +1,55 @@ -NFWTruncatedSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - kappa_s: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf - scale_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf - truncation_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf +NFWTruncatedSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + kappa_s: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf + scale_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf + truncation_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/mass/dark/nfw_truncated_mcr.yaml b/autogalaxy/config/priors/mass/dark/nfw_truncated_mcr.yaml index 30829067b..825f83cd0 100644 --- a/autogalaxy/config/priors/mass/dark/nfw_truncated_mcr.yaml +++ b/autogalaxy/config/priors/mass/dark/nfw_truncated_mcr.yaml @@ -1,177 +1,177 @@ -NFWTruncatedMCRDuffySph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - mass_at_200: - type: LogUniform - lower_limit: 100000000.0 - upper_limit: 1000000000000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_object: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_source: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf -NFWTruncatedMCRLudlowSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - mass_at_200: - type: LogUniform - lower_limit: 100000000.0 - upper_limit: 1000000000000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_object: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_source: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf -NFWTruncatedMCRScatterLudlowSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - mass_at_200: - type: LogUniform - lower_limit: 100000000.0 - upper_limit: 1000000000000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_object: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_source: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - scatter: - type: Gaussian - mean: 0.0 - sigma: 3.0 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 1.0 - gaussian_limits: - lower: -inf - upper: inf +NFWTruncatedMCRDuffySph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + mass_at_200: + type: LogUniform + lower_limit: 100000000.0 + upper_limit: 1000000000000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_object: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_source: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf +NFWTruncatedMCRLudlowSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + mass_at_200: + type: LogUniform + lower_limit: 100000000.0 + upper_limit: 1000000000000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_object: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_source: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf +NFWTruncatedMCRScatterLudlowSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + mass_at_200: + type: LogUniform + lower_limit: 100000000.0 + upper_limit: 1000000000000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_object: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_source: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + scatter: + type: Gaussian + mean: 0.0 + sigma: 3.0 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 1.0 + gaussian_limits: + lower: -inf + upper: inf diff --git a/autogalaxy/config/priors/mass/dark/nfw_virial_mass_conc.yaml b/autogalaxy/config/priors/mass/dark/nfw_virial_mass_conc.yaml index cfc064a4f..5dfc209ac 100644 --- a/autogalaxy/config/priors/mass/dark/nfw_virial_mass_conc.yaml +++ b/autogalaxy/config/priors/mass/dark/nfw_virial_mass_conc.yaml @@ -1,75 +1,75 @@ -NFWVirialMassConcSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - virial_mass: - type: LogUniform - lower_limit: 100000000.0 - upper_limit: 1000000000000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - concentration: - type: Uniform - lower_limit: 0.0 - upper_limit: 12.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - virial_overdens: - type: Uniform - lower_limit: 100.0 - upper_limit: 250.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_object: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_source: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf +NFWVirialMassConcSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + virial_mass: + type: LogUniform + lower_limit: 100000000.0 + upper_limit: 1000000000000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + concentration: + type: Uniform + lower_limit: 0.0 + upper_limit: 12.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + virial_overdens: + type: Uniform + lower_limit: 100.0 + upper_limit: 250.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_object: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_source: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/mass/point/point.yaml b/autogalaxy/config/priors/mass/point/point.yaml index cf40f0ac9..ec2710898 100644 --- a/autogalaxy/config/priors/mass/point/point.yaml +++ b/autogalaxy/config/priors/mass/point/point.yaml @@ -1,35 +1,35 @@ -PointMass: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - einstein_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 8.0 - width_modifier: - type: Relative - value: 0.25 - gaussian_limits: - lower: 0.0 - upper: inf +PointMass: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + einstein_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 8.0 + width_modifier: + type: Relative + value: 0.25 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/mass/point/smbh.yaml b/autogalaxy/config/priors/mass/point/smbh.yaml index 8d871d0eb..74319aa7d 100644 --- a/autogalaxy/config/priors/mass/point/smbh.yaml +++ b/autogalaxy/config/priors/mass/point/smbh.yaml @@ -1,55 +1,55 @@ -SMBH: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - mass: - type: LogUniform - lower_limit: 1000000.0 - upper_limit: 10000000000000.0 - width_modifier: - type: Relative - value: 0.25 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_object: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_source: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 +SMBH: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + mass: + type: LogUniform + lower_limit: 1000000.0 + upper_limit: 10000000000000.0 + width_modifier: + type: Relative + value: 0.25 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_object: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_source: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 upper: inf \ No newline at end of file diff --git a/autogalaxy/config/priors/mass/point/smbh_binary.yaml b/autogalaxy/config/priors/mass/point/smbh_binary.yaml index 50b95a91f..c87bf0e71 100644 --- a/autogalaxy/config/priors/mass/point/smbh_binary.yaml +++ b/autogalaxy/config/priors/mass/point/smbh_binary.yaml @@ -1,85 +1,85 @@ -SMBHBinary: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 1.0 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 1.0 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - separation: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.25 - gaussian_limits: - lower: 0.0 - upper: inf - angle_binary: - type: Uniform - lower_limit: 0.0 - upper_limit: 360.0 - width_modifier: - type: Relative - value: 0.25 - gaussian_limits: - lower: 0.0 - upper: inf - mass: - type: LogUniform - lower_limit: 1000000.0 - upper_limit: 10000000000000.0 - width_modifier: - type: Relative - value: 0.25 - gaussian_limits: - lower: 0.0 - upper: inf - mass_ratio: - type: Uniform - lower_limit: 1.0 - upper_limit: 10.0 - width_modifier: - type: Relative - value: 0.25 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_object: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - redshift_source: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 +SMBHBinary: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 1.0 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 1.0 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + separation: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.25 + gaussian_limits: + lower: 0.0 + upper: inf + angle_binary: + type: Uniform + lower_limit: 0.0 + upper_limit: 360.0 + width_modifier: + type: Relative + value: 0.25 + gaussian_limits: + lower: 0.0 + upper: inf + mass: + type: LogUniform + lower_limit: 1000000.0 + upper_limit: 10000000000000.0 + width_modifier: + type: Relative + value: 0.25 + gaussian_limits: + lower: 0.0 + upper: inf + mass_ratio: + type: Uniform + lower_limit: 1.0 + upper_limit: 10.0 + width_modifier: + type: Relative + value: 0.25 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_object: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + redshift_source: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 upper: inf \ No newline at end of file diff --git a/autogalaxy/config/priors/mass/sheets/external_shear.yaml b/autogalaxy/config/priors/mass/sheets/external_shear.yaml index ab46432e7..e55c841d8 100644 --- a/autogalaxy/config/priors/mass/sheets/external_shear.yaml +++ b/autogalaxy/config/priors/mass/sheets/external_shear.yaml @@ -1,21 +1,21 @@ -ExternalShear: - gamma_1: - type: Uniform - lower_limit: -0.2 - upper_limit: 0.2 - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - gamma_2: - type: Uniform - lower_limit: -0.2 - upper_limit: 0.2 - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf +ExternalShear: + gamma_1: + type: Uniform + lower_limit: -0.2 + upper_limit: 0.2 + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + gamma_2: + type: Uniform + lower_limit: -0.2 + upper_limit: 0.2 + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf diff --git a/autogalaxy/config/priors/mass/sheets/mass_sheet.yaml b/autogalaxy/config/priors/mass/sheets/mass_sheet.yaml index 4494af32c..e71a8d435 100644 --- a/autogalaxy/config/priors/mass/sheets/mass_sheet.yaml +++ b/autogalaxy/config/priors/mass/sheets/mass_sheet.yaml @@ -1,35 +1,35 @@ -MassSheet: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - kappa: - type: Uniform - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf +MassSheet: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + kappa: + type: Uniform + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf diff --git a/autogalaxy/config/priors/mass/stellar/chameleon.yaml b/autogalaxy/config/priors/mass/stellar/chameleon.yaml index fe09daafd..11694d7ce 100644 --- a/autogalaxy/config/priors/mass/stellar/chameleon.yaml +++ b/autogalaxy/config/priors/mass/stellar/chameleon.yaml @@ -1,154 +1,154 @@ -Chameleon: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - core_radius_0: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Absolute - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - core_radius_1: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Absolute - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - mass_to_light_ratio: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf -ChameleonSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - core_radius_0: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Absolute - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - core_radius_1: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Absolute - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - mass_to_light_ratio: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf +Chameleon: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + core_radius_0: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Absolute + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + core_radius_1: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Absolute + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + mass_to_light_ratio: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf +ChameleonSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + core_radius_0: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Absolute + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + core_radius_1: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Absolute + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + mass_to_light_ratio: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/mass/stellar/dev_vaucouleurs.yaml b/autogalaxy/config/priors/mass/stellar/dev_vaucouleurs.yaml index 692270371..460ac5c23 100644 --- a/autogalaxy/config/priors/mass/stellar/dev_vaucouleurs.yaml +++ b/autogalaxy/config/priors/mass/stellar/dev_vaucouleurs.yaml @@ -1,134 +1,134 @@ -DevVaucouleurs: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 10.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - mass_to_light_ratio: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf -DevVaucouleursSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 10.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - mass_to_light_ratio: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf +DevVaucouleurs: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 10.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + mass_to_light_ratio: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf +DevVaucouleursSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 10.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + mass_to_light_ratio: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/mass/stellar/exponential.yaml b/autogalaxy/config/priors/mass/stellar/exponential.yaml index deb9631da..380bc7123 100644 --- a/autogalaxy/config/priors/mass/stellar/exponential.yaml +++ b/autogalaxy/config/priors/mass/stellar/exponential.yaml @@ -1,134 +1,134 @@ -Exponential: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 10.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - mass_to_light_ratio: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf -ExponentialSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 10.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - mass_to_light_ratio: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf +Exponential: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 10.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + mass_to_light_ratio: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf +ExponentialSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 10.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + mass_to_light_ratio: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/mass/stellar/gaussian.yaml b/autogalaxy/config/priors/mass/stellar/gaussian.yaml index 1a593535a..591cb9185 100644 --- a/autogalaxy/config/priors/mass/stellar/gaussian.yaml +++ b/autogalaxy/config/priors/mass/stellar/gaussian.yaml @@ -1,79 +1,79 @@ -Gaussian: - sigma: - type: Uniform - lower_limit: 0.0 - upper_limit: 25.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - mass_to_light_ratio: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf +Gaussian: + sigma: + type: Uniform + lower_limit: 0.0 + upper_limit: 25.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + mass_to_light_ratio: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/mass/stellar/gaussian_gradient.yaml b/autogalaxy/config/priors/mass/stellar/gaussian_gradient.yaml index 8bcb2340d..4d8e5e5a3 100644 --- a/autogalaxy/config/priors/mass/stellar/gaussian_gradient.yaml +++ b/autogalaxy/config/priors/mass/stellar/gaussian_gradient.yaml @@ -1,92 +1,92 @@ -GaussianGradient: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - sigma: - type: Uniform - lower_limit: 0.0 - upper_limit: 25.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - mass_to_light_ratio_base: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - mass_to_light_gradient: - type: Uniform - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - mass_to_light_radius: - type: Constant +GaussianGradient: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + sigma: + type: Uniform + lower_limit: 0.0 + upper_limit: 25.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + mass_to_light_ratio_base: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + mass_to_light_gradient: + type: Uniform + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + mass_to_light_radius: + type: Constant value: 1.0 \ No newline at end of file diff --git a/autogalaxy/config/priors/mass/stellar/sersic.yaml b/autogalaxy/config/priors/mass/stellar/sersic.yaml index 37c18f926..8361ff6a4 100644 --- a/autogalaxy/config/priors/mass/stellar/sersic.yaml +++ b/autogalaxy/config/priors/mass/stellar/sersic.yaml @@ -1,154 +1,154 @@ -Sersic: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 10.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - mass_to_light_ratio: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - sersic_index: - type: Uniform - lower_limit: 0.8 - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.8 - upper: 5.0 -SersicSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 10.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - mass_to_light_ratio: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - sersic_index: - type: Uniform - lower_limit: 0.8 - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.8 - upper: 5.0 +Sersic: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 10.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + mass_to_light_ratio: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + sersic_index: + type: Uniform + lower_limit: 0.8 + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.8 + upper: 5.0 +SersicSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 10.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + mass_to_light_ratio: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + sersic_index: + type: Uniform + lower_limit: 0.8 + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.8 + upper: 5.0 diff --git a/autogalaxy/config/priors/mass/stellar/sersic_core.yaml b/autogalaxy/config/priors/mass/stellar/sersic_core.yaml index b05ebecf5..b1fc6f5e0 100644 --- a/autogalaxy/config/priors/mass/stellar/sersic_core.yaml +++ b/autogalaxy/config/priors/mass/stellar/sersic_core.yaml @@ -1,172 +1,172 @@ -SersicCore: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-05 - upper_limit: 1000.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf - alpha: - type: Constant - value: 3.0 - gamma: - type: Constant - value: 0.25 - radius_break: - type: Constant - value: 0.025 - mass_to_light_ratio: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - sersic_index: - type: Uniform - lower_limit: 0.8 - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.8 - upper: 5.0 -SersicCoreSph: - alpha: - type: Constant - value: 3.0 - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - gamma: - type: Constant - value: 0.25 - intensity: - type: LogUniform - lower_limit: 1.0e-05 - upper_limit: 1000.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf - mass_to_light_ratio: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - radius_break: - type: Constant - value: 0.025 - sersic_index: - type: Uniform - lower_limit: 0.8 - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.8 - upper: 5.0 +SersicCore: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-05 + upper_limit: 1000.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf + alpha: + type: Constant + value: 3.0 + gamma: + type: Constant + value: 0.25 + radius_break: + type: Constant + value: 0.025 + mass_to_light_ratio: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + sersic_index: + type: Uniform + lower_limit: 0.8 + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.8 + upper: 5.0 +SersicCoreSph: + alpha: + type: Constant + value: 3.0 + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + gamma: + type: Constant + value: 0.25 + intensity: + type: LogUniform + lower_limit: 1.0e-05 + upper_limit: 1000.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf + mass_to_light_ratio: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + radius_break: + type: Constant + value: 0.025 + sersic_index: + type: Uniform + lower_limit: 0.8 + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.8 + upper: 5.0 diff --git a/autogalaxy/config/priors/mass/stellar/sersic_gradient.yaml b/autogalaxy/config/priors/mass/stellar/sersic_gradient.yaml index 47e0a4a30..32b401797 100644 --- a/autogalaxy/config/priors/mass/stellar/sersic_gradient.yaml +++ b/autogalaxy/config/priors/mass/stellar/sersic_gradient.yaml @@ -1,174 +1,174 @@ -SersicGradient: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 10.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - mass_to_light_gradient: - type: Uniform - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -inf - upper: inf - mass_to_light_ratio: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - sersic_index: - type: Uniform - lower_limit: 0.8 - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.8 - upper: 5.0 -SersicGradientSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - effective_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - gaussian_limits: - lower: 0.0 - upper: inf - intensity: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 10.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - mass_to_light_gradient: - type: Uniform - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -inf - upper: inf - mass_to_light_ratio: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.3 - gaussian_limits: - lower: 0.0 - upper: inf - sersic_index: - type: Uniform - lower_limit: 0.8 - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 - gaussian_limits: - lower: 0.8 - upper: 5.0 +SersicGradient: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 10.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + mass_to_light_gradient: + type: Uniform + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -inf + upper: inf + mass_to_light_ratio: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + sersic_index: + type: Uniform + lower_limit: 0.8 + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.8 + upper: 5.0 +SersicGradientSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + effective_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + gaussian_limits: + lower: 0.0 + upper: inf + intensity: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 10.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + mass_to_light_gradient: + type: Uniform + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -inf + upper: inf + mass_to_light_ratio: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.3 + gaussian_limits: + lower: 0.0 + upper: inf + sersic_index: + type: Uniform + lower_limit: 0.8 + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 + gaussian_limits: + lower: 0.8 + upper: 5.0 diff --git a/autogalaxy/config/priors/mass/total/isothermal.yaml b/autogalaxy/config/priors/mass/total/isothermal.yaml index 2be7aeb3b..bafb6df1d 100644 --- a/autogalaxy/config/priors/mass/total/isothermal.yaml +++ b/autogalaxy/config/priors/mass/total/isothermal.yaml @@ -1,94 +1,94 @@ -Isothermal: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - einstein_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 8.0 - width_modifier: - type: Relative - value: 0.25 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 -IsothermalSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - einstein_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 8.0 - width_modifier: - type: Relative - value: 0.25 - gaussian_limits: - lower: 0.0 - upper: inf +Isothermal: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + einstein_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 8.0 + width_modifier: + type: Relative + value: 0.25 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 +IsothermalSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + einstein_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 8.0 + width_modifier: + type: Relative + value: 0.25 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/mass/total/isothermal_core.yaml b/autogalaxy/config/priors/mass/total/isothermal_core.yaml index c5d7989f1..7f32ff0eb 100644 --- a/autogalaxy/config/priors/mass/total/isothermal_core.yaml +++ b/autogalaxy/config/priors/mass/total/isothermal_core.yaml @@ -1,114 +1,114 @@ -IsothermalCore: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - core_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 0.2 - width_modifier: - type: Absolute - value: 0.1 - gaussian_limits: - lower: 0.0 - upper: inf - einstein_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 8.0 - width_modifier: - type: Relative - value: 0.25 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 -IsothermalCoreSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - core_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 0.2 - width_modifier: - type: Absolute - value: 0.1 - gaussian_limits: - lower: 0.0 - upper: inf - einstein_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 8.0 - width_modifier: - type: Relative - value: 0.25 - gaussian_limits: - lower: 0.0 - upper: inf +IsothermalCore: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + core_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 0.2 + width_modifier: + type: Absolute + value: 0.1 + gaussian_limits: + lower: 0.0 + upper: inf + einstein_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 8.0 + width_modifier: + type: Relative + value: 0.25 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 +IsothermalCoreSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + core_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 0.2 + width_modifier: + type: Absolute + value: 0.1 + gaussian_limits: + lower: 0.0 + upper: inf + einstein_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 8.0 + width_modifier: + type: Relative + value: 0.25 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/mass/total/power_law.yaml b/autogalaxy/config/priors/mass/total/power_law.yaml index 6d902237f..c4cdb210d 100644 --- a/autogalaxy/config/priors/mass/total/power_law.yaml +++ b/autogalaxy/config/priors/mass/total/power_law.yaml @@ -1,114 +1,114 @@ -PowerLaw: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - einstein_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 8.0 - width_modifier: - type: Relative - value: 0.25 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - slope: - type: Uniform - lower_limit: 1.5 - upper_limit: 3.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: 1.0 - upper: 3.0 -PowerLawSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - einstein_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 8.0 - width_modifier: - type: Relative - value: 0.25 - gaussian_limits: - lower: 0.0 - upper: inf - slope: - type: Uniform - lower_limit: 1.5 - upper_limit: 3.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: 1.0 - upper: 3.0 +PowerLaw: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + einstein_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 8.0 + width_modifier: + type: Relative + value: 0.25 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + slope: + type: Uniform + lower_limit: 1.5 + upper_limit: 3.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: 1.0 + upper: 3.0 +PowerLawSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + einstein_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 8.0 + width_modifier: + type: Relative + value: 0.25 + gaussian_limits: + lower: 0.0 + upper: inf + slope: + type: Uniform + lower_limit: 1.5 + upper_limit: 3.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: 1.0 + upper: 3.0 diff --git a/autogalaxy/config/priors/mass/total/power_law_broken.yaml b/autogalaxy/config/priors/mass/total/power_law_broken.yaml index d882e8a53..f07a61200 100644 --- a/autogalaxy/config/priors/mass/total/power_law_broken.yaml +++ b/autogalaxy/config/priors/mass/total/power_law_broken.yaml @@ -1,154 +1,154 @@ -PowerLawBroken: - break_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - einstein_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 8.0 - width_modifier: - type: Relative - value: 0.25 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - inner_slope: - type: Uniform - lower_limit: 0.0 - upper_limit: 3.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: 3.0 - outer_slope: - type: Uniform - lower_limit: 0.0 - upper_limit: 3.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: 3.0 -PowerLawBrokenSph: - break_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.1 - gaussian_limits: - lower: 0.0 - upper: inf - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - einstein_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 8.0 - width_modifier: - type: Relative - value: 0.25 - gaussian_limits: - lower: 0.0 - upper: inf - inner_slope: - type: Uniform - lower_limit: 0.0 - upper_limit: 3.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: 3.0 - outer_slope: - type: Uniform - lower_limit: 0.0 - upper_limit: 3.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: 3.0 +PowerLawBroken: + break_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + einstein_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 8.0 + width_modifier: + type: Relative + value: 0.25 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + inner_slope: + type: Uniform + lower_limit: 0.0 + upper_limit: 3.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: 3.0 + outer_slope: + type: Uniform + lower_limit: 0.0 + upper_limit: 3.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: 3.0 +PowerLawBrokenSph: + break_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.1 + gaussian_limits: + lower: 0.0 + upper: inf + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + einstein_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 8.0 + width_modifier: + type: Relative + value: 0.25 + gaussian_limits: + lower: 0.0 + upper: inf + inner_slope: + type: Uniform + lower_limit: 0.0 + upper_limit: 3.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: 3.0 + outer_slope: + type: Uniform + lower_limit: 0.0 + upper_limit: 3.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: 3.0 diff --git a/autogalaxy/config/priors/mass/total/power_law_core.yaml b/autogalaxy/config/priors/mass/total/power_law_core.yaml index bad6ee493..72f9f8de4 100644 --- a/autogalaxy/config/priors/mass/total/power_law_core.yaml +++ b/autogalaxy/config/priors/mass/total/power_law_core.yaml @@ -1,134 +1,134 @@ -PowerLawCore: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - core_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 0.2 - width_modifier: - type: Absolute - value: 0.1 - gaussian_limits: - lower: 0.0 - upper: inf - einstein_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 8.0 - width_modifier: - type: Relative - value: 0.25 - gaussian_limits: - lower: 0.0 - upper: inf - ell_comps_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - ell_comps_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -1.0 - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: -1.0 - upper: 1.0 - slope: - type: Uniform - lower_limit: 1.5 - upper_limit: 3.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: 1.0 - upper: 3.0 -PowerLawCoreSph: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.1 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - core_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 0.2 - width_modifier: - type: Absolute - value: 0.1 - gaussian_limits: - lower: 0.0 - upper: inf - einstein_radius: - type: Uniform - lower_limit: 0.0 - upper_limit: 8.0 - width_modifier: - type: Relative - value: 0.25 - gaussian_limits: - lower: 0.0 - upper: inf - slope: - type: Uniform - lower_limit: 1.5 - upper_limit: 3.0 - width_modifier: - type: Absolute - value: 0.2 - gaussian_limits: - lower: 1.0 - upper: 3.0 +PowerLawCore: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + core_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 0.2 + width_modifier: + type: Absolute + value: 0.1 + gaussian_limits: + lower: 0.0 + upper: inf + einstein_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 8.0 + width_modifier: + type: Relative + value: 0.25 + gaussian_limits: + lower: 0.0 + upper: inf + ell_comps_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + ell_comps_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -1.0 + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: -1.0 + upper: 1.0 + slope: + type: Uniform + lower_limit: 1.5 + upper_limit: 3.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: 1.0 + upper: 3.0 +PowerLawCoreSph: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.1 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + core_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 0.2 + width_modifier: + type: Absolute + value: 0.1 + gaussian_limits: + lower: 0.0 + upper: inf + einstein_radius: + type: Uniform + lower_limit: 0.0 + upper_limit: 8.0 + width_modifier: + type: Relative + value: 0.25 + gaussian_limits: + lower: 0.0 + upper: inf + slope: + type: Uniform + lower_limit: 1.5 + upper_limit: 3.0 + width_modifier: + type: Absolute + value: 0.2 + gaussian_limits: + lower: 1.0 + upper: 3.0 diff --git a/autogalaxy/config/priors/mesh/delaunay.yaml b/autogalaxy/config/priors/mesh/delaunay.yaml index 604de83de..783f4b746 100644 --- a/autogalaxy/config/priors/mesh/delaunay.yaml +++ b/autogalaxy/config/priors/mesh/delaunay.yaml @@ -1 +1 @@ -Delaunay: +Delaunay: diff --git a/autogalaxy/config/priors/mesh/rectangular.yaml b/autogalaxy/config/priors/mesh/rectangular.yaml index 26a1c354c..53c565cd6 100644 --- a/autogalaxy/config/priors/mesh/rectangular.yaml +++ b/autogalaxy/config/priors/mesh/rectangular.yaml @@ -1,21 +1,21 @@ -Rectangular: - shape_0: - type: Uniform - lower_limit: 20.0 - upper_limit: 45.0 - width_modifier: - type: Absolute - value: 8.0 - gaussian_limits: - lower: 3.0 - upper: inf - shape_1: - type: Uniform - lower_limit: 20.0 - upper_limit: 45.0 - width_modifier: - type: Absolute - value: 8.0 - gaussian_limits: - lower: 3.0 - upper: inf +Rectangular: + shape_0: + type: Uniform + lower_limit: 20.0 + upper_limit: 45.0 + width_modifier: + type: Absolute + value: 8.0 + gaussian_limits: + lower: 3.0 + upper: inf + shape_1: + type: Uniform + lower_limit: 20.0 + upper_limit: 45.0 + width_modifier: + type: Absolute + value: 8.0 + gaussian_limits: + lower: 3.0 + upper: inf diff --git a/autogalaxy/config/priors/point_sources.yaml b/autogalaxy/config/priors/point_sources.yaml index 67adf1f37..5ff02c31c 100644 --- a/autogalaxy/config/priors/point_sources.yaml +++ b/autogalaxy/config/priors/point_sources.yaml @@ -1,85 +1,85 @@ -Point: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf -PointFlux: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - flux: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf -PointSourceChi: - centre_0: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf - centre_1: - type: Gaussian - mean: 0.0 - sigma: 0.3 - lower_limit: -inf - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - gaussian_limits: - lower: -inf - upper: inf +Point: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf +PointFlux: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + flux: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf +PointSourceChi: + centre_0: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf + centre_1: + type: Gaussian + mean: 0.0 + sigma: 0.3 + lower_limit: -inf + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + gaussian_limits: + lower: -inf + upper: inf diff --git a/autogalaxy/config/priors/regularization/adaptive_brightness.yaml b/autogalaxy/config/priors/regularization/adaptive_brightness.yaml index 1697df3bd..5e911e9dc 100644 --- a/autogalaxy/config/priors/regularization/adaptive_brightness.yaml +++ b/autogalaxy/config/priors/regularization/adaptive_brightness.yaml @@ -1,62 +1,62 @@ -AdaptiveBrightness: - inner_coefficient: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - outer_coefficient: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - signal_scale: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf -AdaptiveBrightnessSplit: - inner_coefficient: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - outer_coefficient: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - signal_scale: - type: Uniform - lower_limit: 0.0 - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.2 - gaussian_limits: - lower: 0.0 - upper: inf +AdaptiveBrightness: + inner_coefficient: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + outer_coefficient: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + signal_scale: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf +AdaptiveBrightnessSplit: + inner_coefficient: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + outer_coefficient: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + signal_scale: + type: Uniform + lower_limit: 0.0 + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.2 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/regularization/constant.yaml b/autogalaxy/config/priors/regularization/constant.yaml index f54978b5a..35b1dbb9f 100644 --- a/autogalaxy/config/priors/regularization/constant.yaml +++ b/autogalaxy/config/priors/regularization/constant.yaml @@ -1,11 +1,11 @@ -Constant: - coefficient: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf +Constant: + coefficient: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/regularization/constant_split.yaml b/autogalaxy/config/priors/regularization/constant_split.yaml index 106692048..2ea6fba46 100644 --- a/autogalaxy/config/priors/regularization/constant_split.yaml +++ b/autogalaxy/config/priors/regularization/constant_split.yaml @@ -1,11 +1,11 @@ -ConstantSplit: - coefficient: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf +ConstantSplit: + coefficient: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/regularization/constant_zeroth.yaml b/autogalaxy/config/priors/regularization/constant_zeroth.yaml index 9122df418..a58d659de 100644 --- a/autogalaxy/config/priors/regularization/constant_zeroth.yaml +++ b/autogalaxy/config/priors/regularization/constant_zeroth.yaml @@ -1,21 +1,21 @@ -ConstantZeroth: - coefficient_neighbor: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf - coefficient_zeroth: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf +ConstantZeroth: + coefficient_neighbor: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf + coefficient_zeroth: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/priors/regularization/zeroth.yaml b/autogalaxy/config/priors/regularization/zeroth.yaml index 7ad61a7ff..16d05b0d2 100644 --- a/autogalaxy/config/priors/regularization/zeroth.yaml +++ b/autogalaxy/config/priors/regularization/zeroth.yaml @@ -1,11 +1,11 @@ -Zeroth: - coefficient: - type: LogUniform - lower_limit: 1.0e-06 - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - gaussian_limits: - lower: 0.0 - upper: inf +Zeroth: + coefficient: + type: LogUniform + lower_limit: 1.0e-06 + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + gaussian_limits: + lower: 0.0 + upper: inf diff --git a/autogalaxy/config/visualize/general.yaml b/autogalaxy/config/visualize/general.yaml index 4a6fd0ebc..e022ac819 100644 --- a/autogalaxy/config/visualize/general.yaml +++ b/autogalaxy/config/visualize/general.yaml @@ -1,9 +1,9 @@ -general: - backend: default - imshow_origin: upper - zoom_around_mask: true -inversion: - reconstruction_vmax_factor: 0.5 -zoom: - plane_percent: 0.01 +general: + backend: default + imshow_origin: upper + zoom_around_mask: true +inversion: + reconstruction_vmax_factor: 0.5 +zoom: + plane_percent: 0.01 inversion_percent: 0.01 \ No newline at end of file diff --git a/autogalaxy/config/visualize/include.yaml b/autogalaxy/config/visualize/include.yaml index 0c9a25708..54497fe44 100644 --- a/autogalaxy/config/visualize/include.yaml +++ b/autogalaxy/config/visualize/include.yaml @@ -1,11 +1,11 @@ -include_1d: - einstein_radius: true - half_light_radius: true -include_2d: - tangential_critical_curves: true - tangential_caustics: true - radial_critical_curves: true - radial_caustics: true - light_profile_centres: true - mass_profile_centres: true - multiple_images: true +include_1d: + einstein_radius: true + half_light_radius: true +include_2d: + tangential_critical_curves: true + tangential_caustics: true + radial_critical_curves: true + radial_caustics: true + light_profile_centres: true + mass_profile_centres: true + multiple_images: true diff --git a/autogalaxy/config/visualize/mat_wrap_1d.yaml b/autogalaxy/config/visualize/mat_wrap_1d.yaml index 2eca68f71..590cf0b5b 100644 --- a/autogalaxy/config/visualize/mat_wrap_1d.yaml +++ b/autogalaxy/config/visualize/mat_wrap_1d.yaml @@ -1,19 +1,19 @@ -EinsteinRadiusAXVLine: - figure: - c: b - linestyle: -- - subplot: - c: b - linestyle: -- -HalfLightRadiusAXVLine: - figure: - c: g - linestyle: -. - subplot: - c: kg - linestyle: -. -ModelFluxesYXScatter: - figure: - c: c - subplot: - c: c +EinsteinRadiusAXVLine: + figure: + c: b + linestyle: -- + subplot: + c: b + linestyle: -- +HalfLightRadiusAXVLine: + figure: + c: g + linestyle: -. + subplot: + c: kg + linestyle: -. +ModelFluxesYXScatter: + figure: + c: c + subplot: + c: c diff --git a/autogalaxy/config/visualize/mat_wrap_2d.yaml b/autogalaxy/config/visualize/mat_wrap_2d.yaml index 74d23f1db..3d8be5b01 100644 --- a/autogalaxy/config/visualize/mat_wrap_2d.yaml +++ b/autogalaxy/config/visualize/mat_wrap_2d.yaml @@ -1,63 +1,63 @@ -TangentialCriticalCurvesPlot: - figure: - c: w - linestyle: '-' - linewidth: 2 - subplot: - c: w - linestyle: '-' - linewidth: 2 -TangentialCausticsPlot: - figure: - c: w - linestyle: '-' - linewidth: 2 - subplot: - c: w - linestyle: '-' - linewidth: 2 -RadialCriticalCurvesPlot: - figure: - c: y - linestyle: '-' - linewidth: 2 - subplot: - c: y - linestyle: '-' - linewidth: 2 -RadialCausticsPlot: - figure: - c: y - linestyle: '-' - linewidth: 2 - subplot: - c: y - linestyle: '-' - linewidth: 2 -LightProfileCentresScatter: - figure: - c: k,r,g,b,m,y - marker: + - s: 20 - subplot: - c: r,g,b,m,y,k - marker: + - s: 26 -MassProfileCentresScatter: - figure: - c: k,r,g,b,m,y - marker: x - s: 20 - subplot: - c: r,g,b,m,y,k - marker: x - s: 26 -MultipleImagesScatter: - figure: - c: k,r,g,b,m,y - marker: o - s: 16 - subplot: - c: r,g,b,m,y,k - marker: o - s: 16 +TangentialCriticalCurvesPlot: + figure: + c: w + linestyle: '-' + linewidth: 2 + subplot: + c: w + linestyle: '-' + linewidth: 2 +TangentialCausticsPlot: + figure: + c: w + linestyle: '-' + linewidth: 2 + subplot: + c: w + linestyle: '-' + linewidth: 2 +RadialCriticalCurvesPlot: + figure: + c: y + linestyle: '-' + linewidth: 2 + subplot: + c: y + linestyle: '-' + linewidth: 2 +RadialCausticsPlot: + figure: + c: y + linestyle: '-' + linewidth: 2 + subplot: + c: y + linestyle: '-' + linewidth: 2 +LightProfileCentresScatter: + figure: + c: k,r,g,b,m,y + marker: + + s: 20 + subplot: + c: r,g,b,m,y,k + marker: + + s: 26 +MassProfileCentresScatter: + figure: + c: k,r,g,b,m,y + marker: x + s: 20 + subplot: + c: r,g,b,m,y,k + marker: x + s: 26 +MultipleImagesScatter: + figure: + c: k,r,g,b,m,y + marker: o + s: 16 + subplot: + c: r,g,b,m,y,k + marker: o + s: 16 diff --git a/autogalaxy/convert.py b/autogalaxy/convert.py index 3364b1812..80488824e 100644 --- a/autogalaxy/convert.py +++ b/autogalaxy/convert.py @@ -1,7 +1,10 @@ from astropy import units -import numpy as np +from autofit.jax_wrapper import numpy as np, use_jax from typing import Tuple +if use_jax: + import jax + def ell_comps_from(axis_ratio: float, angle: float) -> Tuple[float, float]: """ @@ -62,12 +65,19 @@ def axis_ratio_and_angle_from(ell_comps: Tuple[float, float]) -> Tuple[float, fl angle = np.arctan2(ell_comps[0], ell_comps[1]) / 2 angle *= 180.0 / np.pi - if abs(angle) > 45 and angle < 0: - angle += 180 + if use_jax: + angle = jax.lax.select(angle < -45, angle + 180, angle) + else: + if abs(angle) > 45 and angle < 0: + angle += 180 fac = np.sqrt(ell_comps[1] ** 2 + ell_comps[0] ** 2) - if fac > 0.999: - fac = 0.999 # avoid unphysical solution + if use_jax: + fac = jax.lax.min(fac, 0.999) + else: + fac = min(fac, 0.999) + # if fac > 0.999: + # fac = 0.999 # avoid unphysical solution # if fac > 1: print('unphysical e1,e2') axis_ratio = (1 - fac) / (1 + fac) return axis_ratio, angle diff --git a/autogalaxy/ellipse/model/analysis.py b/autogalaxy/ellipse/model/analysis.py index 068b730c4..5dce181ef 100644 --- a/autogalaxy/ellipse/model/analysis.py +++ b/autogalaxy/ellipse/model/analysis.py @@ -198,7 +198,7 @@ def profile_log_likelihood_function( An `info_dict` is also created which stores information on aspects of the model and dataset that dictate run times, so the profiled times can be interpreted with this context. - The results of this profiling are then output to hard-disk in the `preloads` folder of the model-fit results, + The results of this profiling are then output to hard-disk in the `profiling` folder of the model-fit results, which they can be inspected to ensure run-times are as expected. Parameters diff --git a/autogalaxy/galaxy/to_inversion.py b/autogalaxy/galaxy/to_inversion.py index 23660ad6c..00f47782c 100644 --- a/autogalaxy/galaxy/to_inversion.py +++ b/autogalaxy/galaxy/to_inversion.py @@ -15,7 +15,6 @@ from autogalaxy.profiles.light.linear import LightProfileLinear from autogalaxy.galaxy.galaxy import Galaxy from autogalaxy.galaxy.galaxies import Galaxies -from autogalaxy.analysis.preloads import Preloads class AbstractToInversion: @@ -24,7 +23,6 @@ def __init__( dataset: Optional[Union[aa.Imaging, aa.Interferometer, aa.DatasetInterface]], adapt_images: Optional[AdaptImages] = None, settings_inversion: aa.SettingsInversion = aa.SettingsInversion(), - preloads=Preloads(), run_time_dict: Optional[Dict] = None, ): """ @@ -59,8 +57,6 @@ def __init__( the pixelization's pixels to the brightest regions of the image. settings_inversion The settings of the inversion, which controls how the linear algebra calculation is performed. - preloads - Preloads of the inversion, which are used to speed up the linear algebra calculation. run_time_dict A dictionary of run-time values used to compute the inversion, for example the noise-map normalization. """ @@ -82,24 +78,23 @@ def __init__( self.settings_inversion = settings_inversion - self.preloads = preloads self.run_time_dict = run_time_dict @property - def convolver(self) -> Optional[aa.Convolver]: + def psf(self) -> Optional[aa.Kernel2D]: """ - Returns the convolver of the imaging dataset, if the inversion is performed on an imaging dataset. + Returns the PSF of the imaging dataset, if the inversion is performed on an imaging dataset. The `GalaxiesToInversion` class acts as an interface between the dataset and inversion module for - both imaging and interferometer datasets. Only imaging datasets have a convolver, thus this property - ensures that for an interferometer dataset code which references a convolver does not raise an error. + both imaging and interferometer datasets. Only imaging datasets have a PSF, thus this property + ensures that for an interferometer dataset code which references a PSF does not raise an error. Returns ------- - The convolver of the imaging dataset, if it is an imaging dataset. + The psf of the imaging dataset, if it is an imaging dataset. """ try: - return self.dataset.convolver + return self.dataset.psf except AttributeError: return None @@ -198,7 +193,6 @@ def __init__( galaxies: List[Galaxy], adapt_images: Optional[AdaptImages] = None, settings_inversion: aa.SettingsInversion = aa.SettingsInversion(), - preloads=aa.Preloads(), run_time_dict: Optional[Dict] = None, ): """ @@ -234,8 +228,6 @@ def __init__( the pixelization's pixels to the brightest regions of the image. settings_inversion The settings of the inversion, which controls how the linear algebra calculation is performed. - preloads - Preloads of the inversion, which are used to speed up the linear algebra calculation. run_time_dict A dictionary of run-time values used to compute the inversion, for example the noise-map normalization. """ @@ -245,7 +237,6 @@ def __init__( dataset=dataset, adapt_images=adapt_images, settings_inversion=settings_inversion, - preloads=preloads, run_time_dict=run_time_dict, ) @@ -319,7 +310,7 @@ def cls_light_profile_func_list_galaxy_dict_from( lp_linear_func = LightProfileLinearObjFuncList( grid=self.dataset.grids.lp, blurring_grid=self.dataset.grids.blurring, - convolver=self.dataset.convolver, + psf=self.dataset.psf, light_profile_list=light_profile_list, regularization=light_profile.regularization, ) @@ -500,7 +491,6 @@ def mapper_from( source_plane_mesh_grid=source_plane_mesh_grid, image_plane_mesh_grid=image_plane_mesh_grid, adapt_data=adapt_galaxy_image, - preloads=self.preloads, run_time_dict=self.run_time_dict, ) @@ -589,7 +579,6 @@ def inversion(self) -> aa.AbstractInversion: dataset=self.dataset, linear_obj_list=self.linear_obj_list, settings=self.settings_inversion, - preloads=self.preloads, run_time_dict=self.run_time_dict, ) diff --git a/autogalaxy/imaging/fit_imaging.py b/autogalaxy/imaging/fit_imaging.py index 4fba3a0de..8371acc76 100644 --- a/autogalaxy/imaging/fit_imaging.py +++ b/autogalaxy/imaging/fit_imaging.py @@ -7,7 +7,6 @@ from autogalaxy.abstract_fit import AbstractFitInversion from autogalaxy.analysis.adapt_images.adapt_images import AdaptImages -from autogalaxy.analysis.preloads import Preloads from autogalaxy.galaxy.galaxy import Galaxy from autogalaxy.galaxy.galaxies import Galaxies from autogalaxy.galaxy.to_inversion import GalaxiesToInversion @@ -26,7 +25,6 @@ def __init__( dataset_model: Optional[aa.DatasetModel] = None, adapt_images: Optional[AdaptImages] = None, settings_inversion: aa.SettingsInversion = aa.SettingsInversion(), - preloads: aa.Preloads = Preloads(), run_time_dict: Optional[Dict] = None, ): """ @@ -66,16 +64,12 @@ def __init__( reconstructed galaxy's morphology. settings_inversion Settings controlling how an inversion is fitted for example which linear algebra formalism is used. - preloads - Contains preloaded calculations (e.g. linear algebra matrices) which can skip certain calculations in - the fit. run_time_dict A dictionary which if passed to the fit records how long fucntion calls which have the `profile_func` decorator take to run. """ self.galaxies = Galaxies(galaxies=galaxies, run_time_dict=run_time_dict) - self.preloads = preloads super().__init__( dataset=dataset, @@ -109,7 +103,7 @@ def blurred_image(self) -> aa.Array2D: return self.galaxies.blurred_image_2d_from( grid=self.grids.lp, - convolver=self.dataset.convolver, + psf=self.dataset.psf, blurring_grid=self.grids.blurring, ) @@ -126,7 +120,7 @@ def galaxies_to_inversion(self) -> GalaxiesToInversion: data=self.profile_subtracted_image, noise_map=self.noise_map, grids=self.grids, - convolver=self.dataset.convolver, + psf=self.dataset.psf, w_tilde=self.w_tilde, ) @@ -135,7 +129,6 @@ def galaxies_to_inversion(self) -> GalaxiesToInversion: galaxies=self.galaxies, adapt_images=self.adapt_images, settings_inversion=self.settings_inversion, - preloads=self.preloads, run_time_dict=self.run_time_dict, ) @@ -186,7 +179,7 @@ def galaxy_model_image_dict(self) -> Dict[Galaxy, np.ndarray]: galaxy_blurred_image_2d_dict = self.galaxies.galaxy_blurred_image_2d_dict_from( grid=self.grids.lp, - convolver=self.dataset.convolver, + psf=self.dataset.psf, blurring_grid=self.grids.blurring, ) @@ -220,9 +213,9 @@ def subtracted_images_of_galaxies_dict(self) -> Dict[Galaxy, aa.Array2D]: subtracted_image = self.data - sum(other_galaxies_model_images) - subtracted_images_of_galaxies_dict[ - self.galaxies[galaxy_index] - ] = subtracted_image + subtracted_images_of_galaxies_dict[self.galaxies[galaxy_index]] = ( + subtracted_image + ) return subtracted_images_of_galaxies_dict @@ -285,44 +278,3 @@ def galaxies_linear_light_profiles_to_light_profiles(self) -> List[Galaxy]: or `GalaxyPlotter` objects. """ return self.model_obj_linear_light_profiles_to_light_profiles - - def refit_with_new_preloads( - self, - preloads: Preloads, - settings_inversion: Optional[aa.SettingsInversion] = None, - ) -> "FitImaging": - """ - Returns a new fit which uses the dataset, galaxies and other objects of this fit, but uses a different set of - preloads input into this function. - - This is used when setting up the preloads objects, to concisely test how using different preloads objects - changes the attributes of the fit. - - Parameters - ---------- - preloads - The new preloads which are used to refit the data using the - settings_inversion - Settings controlling how an inversion is fitted for example which linear algebra formalism is used. - - Returns - ------- - A new fit which has used new preloads input into this function but the same dataset, galaxies and other settings. - """ - run_time_dict = {} if self.run_time_dict is not None else None - - settings_inversion = ( - self.settings_inversion - if settings_inversion is None - else settings_inversion - ) - - return FitImaging( - dataset=self.dataset, - galaxies=self.galaxies, - dataset_model=self.dataset_model, - adapt_images=self.adapt_images, - settings_inversion=settings_inversion, - preloads=preloads, - run_time_dict=run_time_dict, - ) diff --git a/autogalaxy/imaging/model/analysis.py b/autogalaxy/imaging/model/analysis.py index 6f6b2f21e..8e0cbc486 100644 --- a/autogalaxy/imaging/model/analysis.py +++ b/autogalaxy/imaging/model/analysis.py @@ -10,7 +10,6 @@ from autogalaxy.analysis.adapt_images.adapt_image_maker import AdaptImageMaker from autogalaxy.analysis.analysis.dataset import AnalysisDataset -from autogalaxy.analysis.preloads import Preloads from autogalaxy.cosmology.lensing import LensingCosmology from autogalaxy.cosmology.wrap import Planck15 from autogalaxy.imaging.model.result import ResultImaging @@ -95,9 +94,6 @@ def modify_before_fit(self, paths: af.DirectoryPaths, model: af.Collection): super().modify_before_fit(paths=paths, model=model) - if not paths.is_complete: - self.set_preloads(paths=paths, model=model) - return self def log_likelihood_function(self, instance: af.ModelInstance) -> float: @@ -154,7 +150,6 @@ def log_likelihood_function(self, instance: af.ModelInstance) -> float: def fit_from( self, instance: af.ModelInstance, - preload_overwrite: Optional[Preloads] = None, run_time_dict: Optional[Dict] = None, ) -> FitImaging: """ @@ -187,15 +182,12 @@ def fit_from( adapt_images = self.adapt_images_via_instance_from(instance=instance) - preloads = self.preloads if preload_overwrite is None else preload_overwrite - return FitImaging( dataset=self.dataset, galaxies=galaxies, dataset_model=dataset_model, adapt_images=adapt_images, settings_inversion=self.settings_inversion, - preloads=preloads, run_time_dict=run_time_dict, ) @@ -241,7 +233,7 @@ def profile_log_likelihood_function( An `info_dict` is also created which stores information on aspects of the model and dataset that dictate run times, so the profiled times can be interpreted with this context. - The results of this profiling are then output to hard-disk in the `preloads` folder of the model-fit results, + The results of this profiling are then output to hard-disk in the `profiling` folder of the model-fit results, which they can be inspected to ensure run-times are as expected. Parameters diff --git a/autogalaxy/interferometer/fit_interferometer.py b/autogalaxy/interferometer/fit_interferometer.py index 634382c1a..3aa12c882 100644 --- a/autogalaxy/interferometer/fit_interferometer.py +++ b/autogalaxy/interferometer/fit_interferometer.py @@ -7,7 +7,6 @@ from autogalaxy.abstract_fit import AbstractFitInversion from autogalaxy.analysis.adapt_images.adapt_images import AdaptImages -from autogalaxy.analysis.preloads import Preloads from autogalaxy.galaxy.galaxy import Galaxy from autogalaxy.galaxy.galaxies import Galaxies from autogalaxy.galaxy.to_inversion import GalaxiesToInversion @@ -21,7 +20,6 @@ def __init__( dataset_model: Optional[aa.DatasetModel] = None, adapt_images: Optional[AdaptImages] = None, settings_inversion: aa.SettingsInversion = aa.SettingsInversion(), - preloads: aa.Preloads = Preloads(), run_time_dict: Optional[Dict] = None, ): """ @@ -62,9 +60,6 @@ def __init__( reconstructed galaxy's morphology. settings_inversion Settings controlling how an inversion is fitted for example which linear algebra formalism is used. - preloads - Contains preloaded calculations (e.g. linear algebra matrices) which can skip certain calculations in - the fit. run_time_dict A dictionary which if passed to the fit records how long fucntion calls which have the `profile_func` decorator take to run. @@ -92,8 +87,6 @@ def __init__( self.adapt_images = adapt_images self.settings_inversion = settings_inversion - self.preloads = preloads - @property def profile_visibilities(self) -> aa.Visibilities: """ @@ -126,7 +119,6 @@ def galaxies_to_inversion(self) -> GalaxiesToInversion: galaxies=self.galaxies, adapt_images=self.adapt_images, settings_inversion=self.settings_inversion, - preloads=self.preloads, run_time_dict=self.run_time_dict, ) @@ -223,44 +215,3 @@ def galaxies_linear_light_profiles_to_light_profiles(self) -> List[Galaxy]: or `GalaxyPlotter` objects. """ return self.model_obj_linear_light_profiles_to_light_profiles - - def refit_with_new_preloads( - self, - preloads: Preloads, - settings_inversion: Optional[aa.SettingsInversion] = None, - ) -> "FitInterferometer": - """ - Returns a new fit which uses the dataset, galaxies and other objects of this fit, but uses a different set of - preloads input into this function. - - This is used when setting up the preloads objects, to concisely test how using different preloads objects - changes the attributes of the fit. - - Parameters - ---------- - preloads - The new preloads which are used to refit the data using the - settings_inversion - Settings controlling how an inversion is fitted for example which linear algebra formalism is used. - - Returns - ------- - A new fit which has used new preloads input into this function but the same dataset, galaxies and other settings. - """ - if self.run_time_dict is not None: - run_time_dict = {} - else: - run_time_dict = None - - if settings_inversion is None: - settings_inversion = self.settings_inversion - - return FitInterferometer( - dataset=self.dataset, - galaxies=self.galaxies, - dataset_model=self.dataset_model, - adapt_images=self.adapt_images, - settings_inversion=settings_inversion, - preloads=preloads, - run_time_dict=run_time_dict, - ) diff --git a/autogalaxy/interferometer/model/analysis.py b/autogalaxy/interferometer/model/analysis.py index 1dce6801f..fa6bf976f 100644 --- a/autogalaxy/interferometer/model/analysis.py +++ b/autogalaxy/interferometer/model/analysis.py @@ -12,7 +12,6 @@ from autogalaxy.analysis.adapt_images.adapt_image_maker import AdaptImageMaker from autogalaxy.analysis.analysis.dataset import AnalysisDataset -from autogalaxy.analysis.preloads import Preloads from autogalaxy.cosmology.lensing import LensingCosmology from autogalaxy.cosmology.wrap import Planck15 from autogalaxy.interferometer.model.result import ResultInterferometer @@ -100,13 +99,6 @@ def modify_before_fit(self, paths: af.DirectoryPaths, model: af.Collection): super().modify_before_fit(paths=paths, model=model) - if not paths.is_complete: - logger.info( - "PRELOADS - Setting up preloads, may take a few minutes for fits using an inversion." - ) - - self.set_preloads(paths=paths, model=model) - return self def log_likelihood_function(self, instance: af.ModelInstance) -> float: @@ -162,7 +154,6 @@ def log_likelihood_function(self, instance: af.ModelInstance) -> float: def fit_from( self, instance: af.ModelInstance, - preload_overwrite: Optional[Preloads] = None, run_time_dict: Optional[Dict] = None, ) -> FitInterferometer: """ @@ -192,14 +183,11 @@ def fit_from( adapt_images = self.adapt_images_via_instance_from(instance=instance) - preloads = self.preloads if preload_overwrite is None else preload_overwrite - return FitInterferometer( dataset=self.dataset, galaxies=galaxies, adapt_images=adapt_images, settings_inversion=self.settings_inversion, - preloads=preloads, run_time_dict=run_time_dict, ) @@ -253,7 +241,7 @@ def profile_log_likelihood_function( An `info_dict` is also created which stores information on aspects of the model and dataset that dictate run times, so the profiled times can be interpreted with this context. - The results of this profiling are then output to hard-disk in the `preloads` folder of the model-fit results, + The results of this profiling are then output to hard-disk in the `profiling` folder of the model-fit results, which they can be inspected to ensure run-times are as expected. Parameters diff --git a/autogalaxy/operate/deflections.py b/autogalaxy/operate/deflections.py index 28f01958c..f1ef3a89f 100644 --- a/autogalaxy/operate/deflections.py +++ b/autogalaxy/operate/deflections.py @@ -1,8 +1,11 @@ -from functools import wraps +from functools import wraps, partial import logging -import numpy as np +from autofit.jax_wrapper import numpy as np, use_jax, jit from typing import List, Tuple, Union +if use_jax: + import jax + from autoconf import conf import autoarray as aa @@ -88,6 +91,20 @@ def wrapper( return wrapper +def one_step(r, _, theta, fun, fun_dr): + r = np.abs(r - fun(r, theta) / fun_dr(r, theta)) + return r, None + + +@partial(jit, static_argnums=(4,)) +def step_r(r, theta, fun, fun_dr, N=20): + one_step_partial = jax.tree_util.Partial( + one_step, theta=theta, fun=fun, fun_dr=fun_dr + ) + new_r = jax.lax.scan(one_step_partial, r, xs=np.arange(N))[0] + return np.stack([new_r * np.sin(theta), new_r * np.cos(theta)]).T + + class OperateDeflections: """ Packages methods which manipulate the 2D deflection angle map returned from the `deflections_yx_2d_from` function @@ -107,9 +124,26 @@ class OperateDeflections: def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): raise NotImplementedError + def deflections_yx_scalar(self, y, x, pixel_scales): + if not use_jax: + return + else: + # A version of the deflection function that takes in two scalars + # and outputs a 2D vector. Needed for JAX auto differentiation. + g = aa.Grid2D.from_yx_1d( + y=y.reshape(1), + x=x.reshape(1), + shape_native=(1, 1), + pixel_scales=pixel_scales, + ) + return self.deflections_yx_2d_from(g).squeeze() + def __eq__(self, other): return self.__dict__ == other.__dict__ and self.__class__ is other.__class__ + def __hash__(self): + return hash(repr(self)) + @precompute_jacobian def tangential_eigen_value_from(self, grid, jacobian=None) -> aa.Array2D: """ @@ -662,9 +696,7 @@ def einstein_mass_angular_list_from( einstein_radius_list = self.einstein_radius_list_from( grid=grid, pixel_scale=pixel_scale ) - return [ - np.pi * einstein_radius**2 for einstein_radius in einstein_radius_list - ] + return [np.pi * einstein_radius**2 for einstein_radius in einstein_radius_list] @evaluation_grid def einstein_mass_angular_from( @@ -711,6 +743,175 @@ def einstein_mass_angular_from( return einstein_mass_angular_list[0] + def jacobian_stack(self, y, x, pixel_scales): + if not use_jax: + return + else: + return np.stack( + jax.jacfwd(self.deflections_yx_scalar, argnums=(0, 1))( + y, x, pixel_scales + ) + ) + + def jacobian_stack_vector(self, y, x, pixel_scales): + if not use_jax: + return + else: + return np.vectorize( + jax.tree_util.Partial(self.jacobian_stack, pixel_scales=pixel_scales), + signature="(),()->(i,i)", + )(y, x) + + def convergence_mag_shear_yx(self, y, x): + J = self.jacobian_stack_vector(y, x, 0.05) + K = 0.5 * (J[..., 0, 0] + J[..., 1, 1]) + mag_shear = 0.5 * np.sqrt( + (J[..., 0, 1] + J[..., 1, 0]) ** 2 + (J[..., 0, 0] - J[..., 1, 1]) ** 2 + ) + return K, mag_shear + + @partial(jit, static_argnums=(0,)) + def tangential_eigen_value_yx(self, y, x): + K, mag_shear = self.convergence_mag_shear_yx(y, x) + return 1 - K - mag_shear + + @partial(jit, static_argnums=(0, 3)) + def tangential_eigen_value_rt(self, r, theta, centre=(0.0, 0.0)): + y = r * np.sin(theta) + centre[0] + x = r * np.cos(theta) + centre[1] + return self.tangential_eigen_value_yx(y, x) + + @partial(jit, static_argnums=(0, 3)) + def grad_r_tangential_eigen_value(self, r, theta, centre=(0.0, 0.0)): + # ignore `self` with the `argnums` below + tangential_eigen_part = partial(self.tangential_eigen_value_rt, centre=centre) + return np.vectorize( + jax.jacfwd(tangential_eigen_part, argnums=(0,)), signature="(),()->()" + )(r, theta)[0] + + @partial(jit, static_argnums=(0,)) + def radial_eigen_value_yx(self, y, x): + K, mag_shear = self.convergence_mag_shear_yx(y, x) + return 1 - K + mag_shear + + @partial(jit, static_argnums=(0, 3)) + def radial_eigen_value_rt(self, r, theta, centre=(0.0, 0.0)): + y = r * np.sin(theta) + centre[0] + x = r * np.cos(theta) + centre[1] + return self.radial_eigen_value_yx(y, x) + + @partial(jit, static_argnums=(0, 3)) + def grad_r_radial_eigen_value(self, r, theta, centre=(0.0, 0.0)): + # ignore `self` with the `argnums` below + radial_eigen_part = partial(self.radial_eigen_value_rt, centre=centre) + return np.vectorize( + jax.jacfwd(radial_eigen_part, argnums=(0,)), signature="(),()->()" + )(r, theta)[0] + + def tangential_critical_curve_jax( + self, + init_r=0.1, + init_centre=(0.0, 0.0), + n_points=300, + n_steps=20, + threshold=1e-5, + ): + """ + Returns all tangential critical curves of the lensing system, which are computed as follows: + + 1) Create a set of `n_points` initial points in a circle of radius `init_r` and centred on `init_centre` + 2) Apply `n_steps` of Newton's method to these points in the "radial" direction only (i.e. keeping angle fixed). + Jax's auto differentiation is used to find the radial derivatives of the tangential eigen value function for + this step. + 3) Filter the results and only keep point that have their tangential eigen value `threshold` of 0 + + No underlying grid is needed for the method, but the quality of the results are dependent on the initial + circle of points. + + Parameters + ---------- + init_r : float + Radius of the circle of initial guess points + init_centre : tuple + centre of the circle of initial guess points as `(y, x)` + n_points : Int + Number of initial guess points to create (evenly spaced in angle around `init_centre`) + n_steps : Int + Number of iterations of Newton's method to apply + threshold : float + Only keep points whose tangential eigen value is within this value of zero (inclusive) + """ + r = np.ones(n_points) * init_r + theta = np.linspace(0, 2 * np.pi, n_points + 1)[:-1] + new_yx = step_r( + r, + theta, + jax.tree_util.Partial(self.tangential_eigen_value_rt, centre=init_centre), + jax.tree_util.Partial( + self.grad_r_tangential_eigen_value, centre=init_centre + ), + n_steps, + ) + new_yx = new_yx + np.array(init_centre) + # filter out nan values + fdx = np.isfinite(new_yx).all(axis=1) + new_yx = new_yx[fdx] + # filter out failed points + value = np.abs(self.tangential_eigen_value_yx(new_yx[:, 0], new_yx[:, 1])) + gdx = value <= threshold + return aa.structures.grids.irregular_2d.Grid2DIrregular(values=new_yx[gdx]) + + def radial_critical_curve_jax( + self, + init_r=0.01, + init_centre=(0.0, 0.0), + n_points=300, + n_steps=20, + threshold=1e-5, + ): + """ + Returns all radial critical curves of the lensing system, which are computed as follows: + + 1) Create a set of `n_points` initial points in a circle of radius `init_r` and centred on `init_centre` + 2) Apply `n_steps` of Newton's method to these points in the "radial" direction only (i.e. keeping angle fixed). + Jax's auto differentiation is used to find the radial derivatives of the radial eigen value function for + this step. + 3) Filter the results and only keep point that have their radial eigen value `threshold` of 0 + + No underlying grid is needed for the method, but the quality of the results are dependent on the initial + circle of points. + + Parameters + ---------- + init_r : float + Radius of the circle of initial guess points + init_centre : tuple + centre of the circle of initial guess points as `(y, x)` + n_points : Int + Number of initial guess points to create (evenly spaced in angle around `init_centre`) + n_steps : Int + Number of iterations of Newton's method to apply + threshold : float + Only keep points whose radial eigen value is within this value of zero (inclusive) + """ + r = np.ones(n_points) * init_r + theta = np.linspace(0, 2 * np.pi, n_points + 1)[:-1] + new_yx = step_r( + r, + theta, + jax.tree_util.Partial(self.radial_eigen_value_rt, centre=init_centre), + jax.tree_util.Partial(self.grad_r_radial_eigen_value, centre=init_centre), + n_steps, + ) + new_yx = new_yx + np.array(init_centre) + # filter out nan values + fdx = np.isfinite(new_yx).all(axis=1) + new_yx = new_yx[fdx] + # filter out failed points + value = np.abs(self.radial_eigen_value_yx(new_yx[:, 0], new_yx[:, 1])) + gdx = value <= threshold + return aa.structures.grids.irregular_2d.Grid2DIrregular(values=new_yx[gdx]) + def jacobian_from(self, grid): """ Returns the Jacobian of the lensing object, which is computed by taking the gradient of the 2D deflection @@ -729,35 +930,63 @@ def jacobian_from(self, grid): The 2D grid of (y,x) arc-second coordinates the deflection angles and Jacobian are computed on. """ - deflections = self.deflections_yx_2d_from(grid=grid) + if not use_jax: + deflections = self.deflections_yx_2d_from(grid=grid) - # TODO : Can probably make this work on irregular grid? Is there any point? + # TODO : Can probably make this work on irregular grid? Is there any point? - a11 = aa.Array2D( - values=1.0 - - np.gradient(deflections.native[:, :, 1], grid.native[0, :, 1], axis=1), - mask=grid.mask, - ) + a11 = aa.Array2D( + values=1.0 + - np.gradient( + deflections.native[:, :, 1], grid.native[0, :, 1], axis=1 + ), + mask=grid.mask, + ) - a12 = aa.Array2D( - values=-1.0 - * np.gradient(deflections.native[:, :, 1], grid.native[:, 0, 0], axis=0), - mask=grid.mask, - ) + a12 = aa.Array2D( + values=-1.0 + * np.gradient( + deflections.native[:, :, 1], grid.native[:, 0, 0], axis=0 + ), + mask=grid.mask, + ) - a21 = aa.Array2D( - values=-1.0 - * np.gradient(deflections.native[:, :, 0], grid.native[0, :, 1], axis=1), - mask=grid.mask, - ) + a21 = aa.Array2D( + values=-1.0 + * np.gradient( + deflections.native[:, :, 0], grid.native[0, :, 1], axis=1 + ), + mask=grid.mask, + ) - a22 = aa.Array2D( - values=1 - - np.gradient(deflections.native[:, :, 0], grid.native[:, 0, 0], axis=0), - mask=grid.mask, - ) + a22 = aa.Array2D( + values=1 + - np.gradient( + deflections.native[:, :, 0], grid.native[:, 0, 0], axis=0 + ), + mask=grid.mask, + ) - return [[a11, a12], [a21, a22]] + return [[a11, a12], [a21, a22]] + else: + A = self.jacobian_stack_vector( + grid.array[:, 0], grid.array[:, 1], grid.pixel_scales + ) + a = np.eye(2).reshape(1, 2, 2) - A + return [ + [ + aa.Array2D(values=a[..., 1, 1], mask=grid.mask), + aa.Array2D(values=a[..., 1, 0], mask=grid.mask), + ], + [ + aa.Array2D(values=a[..., 0, 1], mask=grid.mask), + aa.Array2D(values=a[..., 0, 0], mask=grid.mask), + ], + ] + + # transpose the result + # use `moveaxis` as grid might not be nx2 + # return np.moveaxis(np.moveaxis(a, -1, 0), -1, 0) @precompute_jacobian def convergence_2d_via_jacobian_from(self, grid, jacobian=None) -> aa.Array2D: @@ -807,9 +1036,15 @@ def shear_yx_2d_via_jacobian_from( A precomputed lensing jacobian, which is passed throughout the `CalcLens` functions for efficiency. """ - shear_yx_2d = np.zeros(shape=(grid.shape_slim, 2)) - shear_yx_2d[:, 0] = -0.5 * (jacobian[0][1] + jacobian[1][0]) - shear_yx_2d[:, 1] = 0.5 * (jacobian[1][1] - jacobian[0][0]) + if not use_jax: + shear_yx_2d = np.zeros(shape=(grid.shape_slim, 2)) + shear_yx_2d[:, 0] = -0.5 * (jacobian[0][1] + jacobian[1][0]) + shear_yx_2d[:, 1] = 0.5 * (jacobian[1][1] - jacobian[0][0]) + + else: + shear_y = -0.5 * (jacobian[0][1] + jacobian[1][0]).array + shear_x = 0.5 * (jacobian[1][1] - jacobian[0][0]).array + shear_yx_2d = np.stack([shear_y, shear_x]).T if isinstance(grid, aa.Grid2DIrregular): return ShearYX2DIrregular(values=shear_yx_2d, grid=grid) diff --git a/autogalaxy/operate/image.py b/autogalaxy/operate/image.py index bc639e421..a1fa126da 100644 --- a/autogalaxy/operate/image.py +++ b/autogalaxy/operate/image.py @@ -2,6 +2,8 @@ import numpy as np from typing import TYPE_CHECKING, Dict, List, Optional +from autoarray import Array2D + if TYPE_CHECKING: from autogalaxy.galaxy.galaxy import Galaxy @@ -34,31 +36,20 @@ def _blurred_image_2d_from( self, image_2d: aa.Array2D, blurring_image_2d: aa.Array2D, - psf: Optional[aa.Kernel2D], - convolver: aa.Convolver, + psf: aa.Kernel2D, ) -> aa.Array2D: - if psf is not None: - return psf.convolved_array_with_mask_from( - array=image_2d.native + blurring_image_2d.native, - mask=image_2d.mask, - ) - - elif convolver is not None: - return convolver.convolve_image( - image=image_2d, blurring_image=blurring_image_2d - ) - else: - raise exc.OperateException( - "A PSF or Convolver was not passed to the `blurred_image_2d_list_from()` function." - ) + values = psf.convolve_image( + image=image_2d, + blurring_image=blurring_image_2d, + ) + return Array2D(values=values, mask=image_2d.mask) def blurred_image_2d_from( self, grid: aa.Grid2D, blurring_grid: aa.Grid2D, - psf: Optional[aa.Kernel2D] = None, - convolver: aa.Convolver = None, + psf: aa.Kernel2D = None, ) -> aa.Array2D: """ Evaluate the light object's 2D image from a input 2D grid of coordinates and convolve it with a PSF. @@ -92,7 +83,6 @@ def blurred_image_2d_from( image_2d=image_2d_not_operated, blurring_image_2d=blurring_image_2d_not_operated, psf=psf, - convolver=convolver, ) if self.has(cls=LightProfileOperated): @@ -224,8 +214,7 @@ def blurred_image_2d_list_from( self, grid: aa.Grid2D, blurring_grid: aa.Grid2D, - psf: Optional[aa.Kernel2D] = None, - convolver: aa.Convolver = None, + psf: aa.Kernel2D = None, ) -> List[aa.Array2D]: """ Evaluate the light object's list of 2D images from a input 2D grid of coordinates and convolve each image with @@ -267,7 +256,6 @@ def blurred_image_2d_list_from( image_2d=image_2d_not_operated, blurring_image_2d=blurring_image_2d_not_operated, psf=psf, - convolver=convolver, ) image_2d_operated = image_2d_operated_list[i] @@ -375,7 +363,7 @@ def galaxy_image_2d_dict_from( raise NotImplementedError def galaxy_blurred_image_2d_dict_from( - self, grid, convolver, blurring_grid + self, grid, psf, blurring_grid ) -> Dict[Galaxy, aa.Array2D]: """ Evaluate the light object's dictionary mapping galaixes to their corresponding 2D images and convolve each @@ -418,7 +406,7 @@ def galaxy_blurred_image_2d_dict_from( galaxy_key ] - blurred_image_2d = convolver.convolve_image( + blurred_image_2d = psf.convolve_image( image=image_2d_not_operated, blurring_image=blurring_image_2d_not_operated, ) diff --git a/autogalaxy/profiles/basis.py b/autogalaxy/profiles/basis.py index 63747b22c..f71777a00 100644 --- a/autogalaxy/profiles/basis.py +++ b/autogalaxy/profiles/basis.py @@ -125,9 +125,11 @@ def image_2d_list_from( The image of the light profiles in the basis summed together. """ return [ - light_profile.image_2d_from(grid=grid, operated_only=operated_only) - if not isinstance(light_profile, lp_linear.LightProfileLinear) - else np.zeros((grid.shape[0],)) + ( + light_profile.image_2d_from(grid=grid, operated_only=operated_only) + if not isinstance(light_profile, lp_linear.LightProfileLinear) + else np.zeros((grid.shape[0],)) + ) for light_profile in self.light_profile_list ] diff --git a/autogalaxy/profiles/geometry_profiles.py b/autogalaxy/profiles/geometry_profiles.py index c75b8cdbf..33e86cefa 100644 --- a/autogalaxy/profiles/geometry_profiles.py +++ b/autogalaxy/profiles/geometry_profiles.py @@ -1,6 +1,15 @@ +import os + from typing import Optional, Tuple, Type -import numpy as np +if os.environ.get("USE_JAX", "0") == "1": + import jax.numpy as np + + use_jax = True +else: + import numpy as np + + use_jax = False import autoarray as aa @@ -86,7 +95,7 @@ def __init__(self, centre: Tuple[float, float] = (0.0, 0.0)): def radial_grid_from(self, grid: aa.type.Grid2DLike, **kwargs) -> np.ndarray: """ Convert a grid of (y, x) coordinates, to their radial distances from the profile - centre (e.g. :math: r = x**2 + y**2). + centre (e.g. :math: r = sqrt(x**2 + y**2)). Parameters ---------- @@ -124,7 +133,10 @@ def _cartesian_grid_via_radial_from( radius The circular radius of each coordinate from the profile center. """ - grid_angles = np.arctan2(grid[:, 0], grid[:, 1]) + if use_jax: + grid_angles = np.arctan2(np.array(grid)[:, 0], np.array(grid)[:, 1]) + else: + grid_angles = np.arctan2(grid[:, 0], grid[:, 1]) cos_theta, sin_theta = self.angle_to_profile_grid_from(grid_angles=grid_angles) return np.multiply(radius[:, None], np.vstack((sin_theta, cos_theta)).T) @@ -140,7 +152,10 @@ def transformed_to_reference_frame_grid_from(self, grid, **kwargs): grid The (y, x) coordinates in the original reference frame of the grid. """ - return np.subtract(grid, self.centre) + if use_jax: + return np.subtract(np.array(grid), np.array(self.centre)) + else: + return np.subtract(grid, self.centre) @aa.grid_dec.to_grid def transformed_from_reference_frame_grid_from(self, grid, **kwargs): @@ -292,7 +307,6 @@ def rotated_grid_from_reference_frame_from( ) @aa.grid_dec.to_array - @aa.grid_dec.relocate_to_radial_minimum def elliptical_radii_grid_from( self, grid: aa.type.Grid2DLike, **kwargs ) -> np.ndarray: @@ -306,12 +320,12 @@ def elliptical_radii_grid_from( """ return np.sqrt( np.add( - np.square(grid[:, 1]), np.square(np.divide(grid[:, 0], self.axis_ratio)) + np.square(np.array(grid)[:, 1]), + np.square(np.divide(np.array(grid)[:, 0], self.axis_ratio)), ) ) @aa.grid_dec.to_array - @aa.grid_dec.relocate_to_radial_minimum def eccentric_radii_grid_from( self, grid: aa.type.Grid2DLike, **kwargs ) -> np.ndarray: @@ -329,9 +343,9 @@ def eccentric_radii_grid_from( The (y, x) coordinates in the reference frame of the elliptical profile. """ - grid_radii = self.elliptical_radii_grid_from(grid=grid, **kwargs) + grid_radii = np.array(self.elliptical_radii_grid_from(grid=grid, **kwargs)) - return np.multiply(np.sqrt(self.axis_ratio), grid_radii).view(np.ndarray) + return np.multiply(np.sqrt(self.axis_ratio), grid_radii) # .view(np.ndarray) @aa.grid_dec.to_grid def transformed_to_reference_frame_grid_from( diff --git a/autogalaxy/profiles/light/decorators.py b/autogalaxy/profiles/light/decorators.py index d963612b6..7e75029cb 100644 --- a/autogalaxy/profiles/light/decorators.py +++ b/autogalaxy/profiles/light/decorators.py @@ -1,72 +1,72 @@ -import numpy as np -from functools import wraps -from typing import Optional, Union - -import autoarray as aa - - -def check_operated_only(func): - """ - Checks if a light profile is a `LightProfileOperated` class and therefore already has had operations like a - PSF convolution performed. - - This is compared to the `only_operated` input to determine if the image of that light profile is returned, or - an array of zeros. - - Parameters - ---------- - func - A function which checks the light profile class and determines what image is returned. - - Returns - ------- - A function that returns a 2D image. - """ - - @wraps(func) - def wrapper( - obj, - grid: aa.type.Grid1D2DLike, - operated_only: Optional[bool] = None, - *args, - **kwargs - ) -> Union[aa.Array2D, np.ndarray]: - """ - This decorator checks if a light profile is a `LightProfileOperated` class and therefore already has had operations like a - PSF convolution performed. - - This is compared to the `only_operated` input to determine if the image of that light profile is returned, or - an array of zeros. - - Parameters - ---------- - obj - A light profile with an `image_2d_from` function whose class is inspected to determine if the image is - operated on. - grid - A grid_like object of (y,x) coordinates on which the function values are evaluated. - operated_only - By default this is None and the image is returned irrespecive of light profile class (E.g. it does not matter - if it is already operated or not). If this input is included as a bool, the light profile image is only - returned if they are or are not already operated. - - Returns - ------- - The 2D image, which is customized depending on whether it has been operated on. - """ - - from autogalaxy.profiles.light.operated import ( - LightProfileOperated, - ) - - if operated_only is None: - return func(obj, grid, operated_only, *args, **kwargs) - elif operated_only: - if isinstance(obj, LightProfileOperated): - return func(obj, grid, operated_only, *args, **kwargs) - return np.zeros((grid.shape[0],)) - if not isinstance(obj, LightProfileOperated): - return func(obj, grid, operated_only, *args, **kwargs) - return np.zeros((grid.shape[0],)) - - return wrapper +import numpy as np +from functools import wraps +from typing import Optional, Union + +import autoarray as aa + + +def check_operated_only(func): + """ + Checks if a light profile is a `LightProfileOperated` class and therefore already has had operations like a + PSF convolution performed. + + This is compared to the `only_operated` input to determine if the image of that light profile is returned, or + an array of zeros. + + Parameters + ---------- + func + A function which checks the light profile class and determines what image is returned. + + Returns + ------- + A function that returns a 2D image. + """ + + @wraps(func) + def wrapper( + obj, + grid: aa.type.Grid1D2DLike, + operated_only: Optional[bool] = None, + *args, + **kwargs + ) -> Union[aa.Array2D, np.ndarray]: + """ + This decorator checks if a light profile is a `LightProfileOperated` class and therefore already has had operations like a + PSF convolution performed. + + This is compared to the `only_operated` input to determine if the image of that light profile is returned, or + an array of zeros. + + Parameters + ---------- + obj + A light profile with an `image_2d_from` function whose class is inspected to determine if the image is + operated on. + grid + A grid_like object of (y,x) coordinates on which the function values are evaluated. + operated_only + By default this is None and the image is returned irrespecive of light profile class (E.g. it does not matter + if it is already operated or not). If this input is included as a bool, the light profile image is only + returned if they are or are not already operated. + + Returns + ------- + The 2D image, which is customized depending on whether it has been operated on. + """ + + from autogalaxy.profiles.light.operated import ( + LightProfileOperated, + ) + + if operated_only is None: + return func(obj, grid, operated_only, *args, **kwargs) + elif operated_only: + if isinstance(obj, LightProfileOperated): + return func(obj, grid, operated_only, *args, **kwargs) + return np.zeros((grid.shape[0],)) + if not isinstance(obj, LightProfileOperated): + return func(obj, grid, operated_only, *args, **kwargs) + return np.zeros((grid.shape[0],)) + + return wrapper diff --git a/autogalaxy/profiles/light/linear/abstract.py b/autogalaxy/profiles/light/linear/abstract.py index a44194e3b..ff96ed0ca 100644 --- a/autogalaxy/profiles/light/linear/abstract.py +++ b/autogalaxy/profiles/light/linear/abstract.py @@ -143,7 +143,7 @@ def __init__( self, grid: aa.type.Grid1D2DLike, blurring_grid: aa.type.Grid1D2DLike, - convolver: Optional[aa.Convolver], + psf: Optional[aa.Kernel2D], light_profile_list: List[LightProfileLinear], regularization=Optional[aa.reg.Regularization], run_time_dict: Optional[Dict] = None, @@ -184,8 +184,8 @@ def __init__( blurring_grid The blurring grid is all points whose light is outside the data's mask but close enough to the mask that it may be blurred into the mask. This is also used when evaluating the image of each light profile. - convolver - The convolver used to blur the light profile images of each light profile, the output of which + psf + The psf used to blur the light profile images of each light profile, the output of which makes up the columns of the `operated_mapping matrix`. light_profile_list A list of the linear light profiles that are used to fit the data via linear algebra. @@ -210,7 +210,7 @@ def __init__( ) self.blurring_grid = blurring_grid - self.convolver = convolver + self.psf = psf self.light_profile_list = light_profile_list @property @@ -271,7 +271,7 @@ def mapping_matrix(self) -> np.ndarray: @cached_property def operated_mapping_matrix_override(self) -> Optional[np.ndarray]: """ - The inversion object takes the `mapping_matrix` of each linear object and combines it with the `Convolver` + The inversion object takes the `mapping_matrix` of each linear object and combines it with the PSF operator to perform a 2D convolution and compute the `operated_mapping_matrix`. If this property is overwritten this operation is not performed, with the `operated_mapping_matrix` output this @@ -298,7 +298,7 @@ def operated_mapping_matrix_override(self) -> Optional[np.ndarray]: blurring_image_2d = light_profile.image_2d_from(grid=self.blurring_grid) - blurred_image_2d = self.convolver.convolve_image( + blurred_image_2d = self.psf.convolve_image( image=image_2d, blurring_image=blurring_image_2d ) diff --git a/autogalaxy/profiles/light/linear/shapelets/cartesian.py b/autogalaxy/profiles/light/linear/shapelets/cartesian.py index f6363a093..989f2c18f 100644 --- a/autogalaxy/profiles/light/linear/shapelets/cartesian.py +++ b/autogalaxy/profiles/light/linear/shapelets/cartesian.py @@ -54,7 +54,6 @@ def __init__( @aa.grid_dec.to_array @check_operated_only @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def image_2d_from( self, grid: aa.type.Grid2DLike, operated_only: Optional[bool] = None, **kwargs ) -> np.ndarray: diff --git a/autogalaxy/profiles/light/linear/shapelets/exponential.py b/autogalaxy/profiles/light/linear/shapelets/exponential.py index 2fd12efa8..2469116dd 100644 --- a/autogalaxy/profiles/light/linear/shapelets/exponential.py +++ b/autogalaxy/profiles/light/linear/shapelets/exponential.py @@ -53,7 +53,6 @@ def __init__( @aa.grid_dec.to_array @check_operated_only @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def image_2d_from( self, grid: aa.type.Grid2DLike, operated_only: Optional[bool] = None, **kwargs ) -> np.ndarray: diff --git a/autogalaxy/profiles/light/snr/abstract.py b/autogalaxy/profiles/light/snr/abstract.py index 49b34a766..71350f0c0 100644 --- a/autogalaxy/profiles/light/snr/abstract.py +++ b/autogalaxy/profiles/light/snr/abstract.py @@ -84,7 +84,9 @@ def set_intensity_from( image_2d = self.image_2d_from(grid=grid) if psf is not None: - image_2d = psf.convolved_array_from(array=image_2d) + image_2d = psf.convolve_image_no_blurring( + image=image_2d, mask=image_2d.mask + ) brightest_value = np.max(image_2d) diff --git a/autogalaxy/profiles/light/snr/sersic.py b/autogalaxy/profiles/light/snr/sersic.py index d44a6b12a..2ea33deac 100644 --- a/autogalaxy/profiles/light/snr/sersic.py +++ b/autogalaxy/profiles/light/snr/sersic.py @@ -1,75 +1,75 @@ -from typing import Tuple - -from autogalaxy.profiles.light.snr.abstract import LightProfileSNR -from autogalaxy.profiles.light import standard as lp - - -class Sersic(lp.Sersic, LightProfileSNR): - def __init__( - self, - signal_to_noise_ratio: float = 10.0, - centre: Tuple[float, float] = (0.0, 0.0), - ell_comps: Tuple[float, float] = (0.0, 0.0), - effective_radius: float = 0.6, - sersic_index: float = 4.0, - ): - """ - An elliptical Sersic light profile. - - Instead of an `intensity` a `signal_to_noise_ratio` is input which sets the signal to noise of the brightest - pixel of the profile's image when used to simulate imaging data. - - Parameters - ---------- - signal_to_noise_ratio - The signal to noise of the light profile when it is used to simulate strong lens imaging. - centre - The (y,x) arc-second coordinates of the profile centre. - ell_comps - The first and second ellipticity components of the elliptical coordinate system. - effective_radius - The circular radius containing half the light of this profile. - sersic_index - Controls the concentration of the profile (lower -> less concentrated, higher -> more concentrated). - """ - super().__init__( - centre=centre, - ell_comps=ell_comps, - intensity=0.0, - effective_radius=effective_radius, - sersic_index=sersic_index, - ) - - LightProfileSNR.__init__(self, signal_to_noise_ratio=signal_to_noise_ratio) - - -class SersicSph(lp.SersicSph, LightProfileSNR): - def __init__( - self, - signal_to_noise_ratio: float = 10.0, - centre: Tuple[float, float] = (0.0, 0.0), - effective_radius: float = 0.6, - sersic_index: float = 4.0, - ): - """ - The spherical Sersic light profile. - - Parameters - ---------- - centre - The (y,x) arc-second coordinates of the profile centre. - intensity - Overall intensity normalisation of the light profile (units are dimensionless and derived from the data - the light profile's image is compared too, which is expected to be electrons per second). - effective_radius - The circular radius containing half the light of this profile. - sersic_index - Controls the concentration of the of the light profile. - """ - super().__init__( - centre=centre, - intensity=0.0, - effective_radius=effective_radius, - sersic_index=sersic_index, - ) - LightProfileSNR.__init__(self, signal_to_noise_ratio=signal_to_noise_ratio) +from typing import Tuple + +from autogalaxy.profiles.light.snr.abstract import LightProfileSNR +from autogalaxy.profiles.light import standard as lp + + +class Sersic(lp.Sersic, LightProfileSNR): + def __init__( + self, + signal_to_noise_ratio: float = 10.0, + centre: Tuple[float, float] = (0.0, 0.0), + ell_comps: Tuple[float, float] = (0.0, 0.0), + effective_radius: float = 0.6, + sersic_index: float = 4.0, + ): + """ + An elliptical Sersic light profile. + + Instead of an `intensity` a `signal_to_noise_ratio` is input which sets the signal to noise of the brightest + pixel of the profile's image when used to simulate imaging data. + + Parameters + ---------- + signal_to_noise_ratio + The signal to noise of the light profile when it is used to simulate strong lens imaging. + centre + The (y,x) arc-second coordinates of the profile centre. + ell_comps + The first and second ellipticity components of the elliptical coordinate system. + effective_radius + The circular radius containing half the light of this profile. + sersic_index + Controls the concentration of the profile (lower -> less concentrated, higher -> more concentrated). + """ + super().__init__( + centre=centre, + ell_comps=ell_comps, + intensity=0.0, + effective_radius=effective_radius, + sersic_index=sersic_index, + ) + + LightProfileSNR.__init__(self, signal_to_noise_ratio=signal_to_noise_ratio) + + +class SersicSph(lp.SersicSph, LightProfileSNR): + def __init__( + self, + signal_to_noise_ratio: float = 10.0, + centre: Tuple[float, float] = (0.0, 0.0), + effective_radius: float = 0.6, + sersic_index: float = 4.0, + ): + """ + The spherical Sersic light profile. + + Parameters + ---------- + centre + The (y,x) arc-second coordinates of the profile centre. + intensity + Overall intensity normalisation of the light profile (units are dimensionless and derived from the data + the light profile's image is compared too, which is expected to be electrons per second). + effective_radius + The circular radius containing half the light of this profile. + sersic_index + Controls the concentration of the of the light profile. + """ + super().__init__( + centre=centre, + intensity=0.0, + effective_radius=effective_radius, + sersic_index=sersic_index, + ) + LightProfileSNR.__init__(self, signal_to_noise_ratio=signal_to_noise_ratio) diff --git a/autogalaxy/profiles/light/standard/chameleon.py b/autogalaxy/profiles/light/standard/chameleon.py index 6e1ce199d..96279be5d 100644 --- a/autogalaxy/profiles/light/standard/chameleon.py +++ b/autogalaxy/profiles/light/standard/chameleon.py @@ -94,7 +94,6 @@ def image_2d_via_radii_from(self, grid_radii: np.ndarray) -> np.ndarray: @aa.grid_dec.to_array @check_operated_only @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def image_2d_from( self, grid: aa.type.Grid2DLike, operated_only: Optional[bool] = None, **kwargs ) -> np.ndarray: diff --git a/autogalaxy/profiles/light/standard/eff.py b/autogalaxy/profiles/light/standard/eff.py index 138e094f8..675834995 100644 --- a/autogalaxy/profiles/light/standard/eff.py +++ b/autogalaxy/profiles/light/standard/eff.py @@ -61,7 +61,6 @@ def image_2d_via_radii_from(self, grid_radii: np.ndarray) -> np.ndarray: @aa.grid_dec.to_array @check_operated_only @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def image_2d_from( self, grid: aa.type.Grid2DLike, operated_only: Optional[bool] = None, **kwargs ) -> np.ndarray: diff --git a/autogalaxy/profiles/light/standard/gaussian.py b/autogalaxy/profiles/light/standard/gaussian.py index 87717ae5f..18f5e69b0 100644 --- a/autogalaxy/profiles/light/standard/gaussian.py +++ b/autogalaxy/profiles/light/standard/gaussian.py @@ -1,4 +1,5 @@ -import numpy as np +# import numpy as np +from autofit.jax_wrapper import numpy as np, use_jax from typing import Optional, Tuple import autoarray as aa @@ -59,21 +60,33 @@ def image_2d_via_radii_from(self, grid_radii: np.ndarray) -> np.ndarray: grid_radii The radial distances from the centre of the profile, for each coordinate on the grid. """ - return np.multiply( - self._intensity, - np.exp( - -0.5 - * np.square( - np.divide(grid_radii, self.sigma / np.sqrt(self.axis_ratio)) - ) - ), - ) + if use_jax: + return np.multiply( + self._intensity, + np.exp( + -0.5 + * np.square( + np.divide( + grid_radii.array, self.sigma / np.sqrt(self.axis_ratio) + ) + ) + ), + ) + else: + return np.multiply( + self._intensity, + np.exp( + -0.5 + * np.square( + np.divide(grid_radii, self.sigma / np.sqrt(self.axis_ratio)) + ) + ), + ) @aa.over_sample @aa.grid_dec.to_array @check_operated_only @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def image_2d_from( self, grid: aa.type.Grid2DLike, operated_only: Optional[bool] = None, **kwargs ) -> np.ndarray: diff --git a/autogalaxy/profiles/light/standard/moffat.py b/autogalaxy/profiles/light/standard/moffat.py index 8b6c69f38..fb88e5cc8 100644 --- a/autogalaxy/profiles/light/standard/moffat.py +++ b/autogalaxy/profiles/light/standard/moffat.py @@ -72,7 +72,6 @@ def image_2d_via_radii_from(self, grid_radii: np.ndarray) -> np.ndarray: @aa.grid_dec.to_array @check_operated_only @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def image_2d_from( self, grid: aa.type.Grid2DLike, operated_only: Optional[bool] = None, **kwargs ) -> np.ndarray: diff --git a/autogalaxy/profiles/light/standard/sersic.py b/autogalaxy/profiles/light/standard/sersic.py index 675d052b8..94d2364d5 100644 --- a/autogalaxy/profiles/light/standard/sersic.py +++ b/autogalaxy/profiles/light/standard/sersic.py @@ -1,4 +1,5 @@ -import numpy as np +from autofit.jax_wrapper import numpy as np +from numpy import seterr from typing import Optional, Tuple import autoarray as aa @@ -127,7 +128,7 @@ def image_2d_via_radii_from(self, grid_radii: np.ndarray, **kwargs) -> np.ndarra grid_radii The radial distances from the centre of the profile, for each coordinate on the grid. """ - np.seterr(all="ignore") + seterr(all="ignore") return np.multiply( self._intensity, np.exp( @@ -135,7 +136,7 @@ def image_2d_via_radii_from(self, grid_radii: np.ndarray, **kwargs) -> np.ndarra -self.sersic_constant, np.add( np.power( - np.divide(grid_radii, self.effective_radius), + np.divide(np.array(grid_radii), self.effective_radius), 1.0 / self.sersic_index, ), -1, @@ -148,7 +149,6 @@ def image_2d_via_radii_from(self, grid_radii: np.ndarray, **kwargs) -> np.ndarra @aa.grid_dec.to_array @check_operated_only @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def image_2d_from( self, grid: aa.type.Grid2DLike, operated_only: Optional[bool] = None, **kwargs ) -> aa.Array2D: diff --git a/autogalaxy/profiles/light/standard/shapelets/cartesian.py b/autogalaxy/profiles/light/standard/shapelets/cartesian.py index a98856bc8..9045eaeb2 100644 --- a/autogalaxy/profiles/light/standard/shapelets/cartesian.py +++ b/autogalaxy/profiles/light/standard/shapelets/cartesian.py @@ -63,7 +63,6 @@ def coefficient_tag(self) -> str: @aa.grid_dec.to_array @check_operated_only @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def image_2d_from( self, grid: aa.type.Grid2DLike, operated_only: Optional[bool] = None, **kwargs ) -> np.ndarray: diff --git a/autogalaxy/profiles/light/standard/shapelets/exponential.py b/autogalaxy/profiles/light/standard/shapelets/exponential.py index d15d4eda0..78915d4ff 100644 --- a/autogalaxy/profiles/light/standard/shapelets/exponential.py +++ b/autogalaxy/profiles/light/standard/shapelets/exponential.py @@ -64,7 +64,6 @@ def coefficient_tag(self) -> str: @aa.grid_dec.to_array @check_operated_only @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def image_2d_from( self, grid: aa.type.Grid2DLike, operated_only: Optional[bool] = None, **kwargs ) -> np.ndarray: diff --git a/autogalaxy/profiles/light/standard/shapelets/polar.py b/autogalaxy/profiles/light/standard/shapelets/polar.py index f9da6ad4f..84f144efb 100644 --- a/autogalaxy/profiles/light/standard/shapelets/polar.py +++ b/autogalaxy/profiles/light/standard/shapelets/polar.py @@ -64,7 +64,6 @@ def coefficient_tag(self) -> str: @aa.grid_dec.to_array @check_operated_only @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def image_2d_from( self, grid: aa.type.Grid2DLike, operated_only: Optional[bool] = None, **kwargs ) -> np.ndarray: diff --git a/autogalaxy/profiles/mass/abstract/jax_utils.py b/autogalaxy/profiles/mass/abstract/jax_utils.py new file mode 100644 index 000000000..e241488f3 --- /dev/null +++ b/autogalaxy/profiles/mass/abstract/jax_utils.py @@ -0,0 +1,99 @@ +import jax.numpy as jnp + +from jax import custom_jvp + + +r1_s1 = [2.5, 2, 1.5, 1, 0.5] + + +def reg1(z, _, i_sqrt_pi): + v = z + for coef in r1_s1: + v = z - coef / v + return i_sqrt_pi / v + + +r2_s1 = [1.320522, 35.7668, 219.031, 1540.787, 3321.99, 36183.31] +r2_s2 = [1.841439, 61.57037, 364.2191, 2186.181, 9022.228, 24322.84, 32066.6] + + +def reg2(z, sqrt_pi, _): + mz2 = -(z**2) + f1 = sqrt_pi + f2 = 1.0 + for s in r2_s1: + f1 = s - f1 * mz2 + for s in r2_s2: + f2 = s - f2 * mz2 + + return jnp.exp(mz2) + 1j * z * f1 / f2 + + +r3_s1 = [5.9126262, 30.180142, 93.15558, 181.92853, 214.38239, 122.60793] +r3_s2 = [10.479857, 53.992907, 170.35400, 348.70392, 457.33448, 352.73063, 122.60793] + + +def reg3(z, sqrt_pi, _): + miz = -1j * z + f1 = sqrt_pi + f2 = 1 + for s in r3_s1: + f1 = s + f1 * miz + for s in r3_s2: + f2 = s + f2 * miz + + return f1 / f2 + + +@custom_jvp +def w_f_approx(z): + """Compute the Faddeeva function :math:`w_{\\mathrm F}(z)` using the + approximation given in Zaghloul (2017). + + :param z: complex number + :type z: ``complex`` or ``numpy.array(dtype=complex)`` + :return: :math:`w_\\mathrm{F}(z)` + :rtype: ``complex`` + """ + sqrt_pi = 1 / jnp.sqrt(jnp.pi) + i_sqrt_pi = 1j * sqrt_pi + + z_imag2 = z.imag**2 + abs_z2 = z.real**2 + z_imag2 + + # use a single partial fraction approx for all large abs(z)**2 + # to have better approx of the auto-derivatives + r1 = (abs_z2 >= 62.0) | ((abs_z2 >= 30.0) & (abs_z2 < 62.0) & (z_imag2 >= 1e-13)) + # region bounds for 5 taken directly from Zaghloul (2017) + # https://dl.acm.org/doi/pdf/10.1145/3119904 + r2_1 = (abs_z2 >= 30.0) & (abs_z2 < 62.0) & (z_imag2 < 1e-13) + r2_2 = (abs_z2 >= 2.5) & (abs_z2 < 30.0) & (z_imag2 < 0.072) + r2 = r2_1 | r2_2 + r3 = jnp.logical_not(r1) & jnp.logical_not(r2) + + # exploit symmetry to avoid overflow in some regions + r_flip = z.imag < 0 + z_adjust = jnp.where(r_flip, -z, z) + two_exp_zz = 2 * jnp.exp(-(z_adjust**2)) + + args = (z_adjust, sqrt_pi, i_sqrt_pi) + wz = jnp.empty_like(z) + wz = jnp.where(r1, reg1(*args), wz) + wz = jnp.where(r2, reg2(*args), wz) + wz = jnp.where(r3, reg3(*args), wz) + + # exploit symmetry to avoid overflow in some regions + wz = jnp.where(r_flip, two_exp_zz - wz, wz) + + return wz + + +@w_f_approx.defjvp +def w_f_approx_jvp(primals, tangents): + # define a custom jvp to avoid the issue using `jnp.where` with `jax.grad` + (z,) = primals + (z_dot,) = tangents + primal_out = w_f_approx(z) + i_sqrt_pi = 1j / jnp.sqrt(jnp.pi) + tangent_out = z_dot * 2 * (i_sqrt_pi - z * primal_out) + return primal_out, tangent_out diff --git a/autogalaxy/profiles/mass/abstract/mge.py b/autogalaxy/profiles/mass/abstract/mge.py index 3f534ff91..4ad78e82e 100644 --- a/autogalaxy/profiles/mass/abstract/mge.py +++ b/autogalaxy/profiles/mass/abstract/mge.py @@ -1,280 +1,8 @@ -import numpy as np -from scipy.special import comb - - -def w_f_approx(z): - """ - Compute the Faddeeva function :math:`w_{\mathrm F}(z)` using the - approximation given in Zaghloul (2017). - :param z: complex number - :type z: ``complex`` or ``numpy.array(dtype=complex)`` - :return: :math:`w_\mathrm{F}(z)` - :rtype: ``complex`` - - # This function is copied from - # "https://github.com/sibirrer/lenstronomy/tree/main/lenstronomy/LensModel/Profiles" - # written by Anowar J. Shajib (see 1906.08263) - """ - - reg_minus_imag = z.imag < 0.0 - z[reg_minus_imag] = np.conj(z[reg_minus_imag]) - - sqrt_pi = 1 / np.sqrt(np.pi) - i_sqrt_pi = 1j * sqrt_pi - - wz = np.empty_like(z) - - z_imag2 = z.imag**2 - abs_z2 = z.real**2 + z_imag2 - - reg1 = abs_z2 >= 38000.0 - if np.any(reg1): - wz[reg1] = i_sqrt_pi / z[reg1] - - reg2 = (256.0 <= abs_z2) & (abs_z2 < 38000.0) - if np.any(reg2): - t = z[reg2] - wz[reg2] = i_sqrt_pi * t / (t * t - 0.5) - - reg3 = (62.0 <= abs_z2) & (abs_z2 < 256.0) - if np.any(reg3): - t = z[reg3] - wz[reg3] = (i_sqrt_pi / t) * (1 + 0.5 / (t * t - 1.5)) - - reg4 = (30.0 <= abs_z2) & (abs_z2 < 62.0) & (z_imag2 >= 1e-13) - if np.any(reg4): - t = z[reg4] - tt = t * t - wz[reg4] = (i_sqrt_pi * t) * (tt - 2.5) / (tt * (tt - 3.0) + 0.75) - - reg5 = (62.0 > abs_z2) & np.logical_not(reg4) & (abs_z2 > 2.5) & (z_imag2 < 0.072) - if np.any(reg5): - t = z[reg5] - u = -t * t - f1 = sqrt_pi - f2 = 1 - s1 = [1.320522, 35.7668, 219.031, 1540.787, 3321.99, 36183.31] - s2 = [1.841439, 61.57037, 364.2191, 2186.181, 9022.228, 24322.84, 32066.6] - - for s in s1: - f1 = s - f1 * u - for s in s2: - f2 = s - f2 * u - - wz[reg5] = np.exp(u) + 1j * t * f1 / f2 - - reg6 = (30.0 > abs_z2) & np.logical_not(reg5) - if np.any(reg6): - t3 = -1j * z[reg6] - - f1 = sqrt_pi - f2 = 1 - s1 = [5.9126262, 30.180142, 93.15558, 181.92853, 214.38239, 122.60793] - s2 = [ - 10.479857, - 53.992907, - 170.35400, - 348.70392, - 457.33448, - 352.73063, - 122.60793, - ] - - for s in s1: - f1 = f1 * t3 + s - for s in s2: - f2 = f2 * t3 + s - - wz[reg6] = f1 / f2 - - # wz[reg_minus_imag] = np.conj(wz[reg_minus_imag]) - - return wz - - -class MassProfileMGE: - """ - This class speeds up deflection angle calculations of certain mass profiles by decompositing them into many - Gaussians. - - This follows the method of Shajib 2019 - https://academic.oup.com/mnras/article/488/1/1387/5526256 - """ - - def __init__(self): - self.count = 0 - self.sigma_calc = 0 - self.z = 0 - self.zq = 0 - self.expv = 0 - - @staticmethod - # @aa.util.numba.jit() - def zeta_from(grid, amps, sigmas, axis_ratio): - """ - The key part to compute the deflection angle of each Gaussian. - Because of my optimization, there are blocks looking weird and indirect. What I'm doing here - is trying to avoid big matrix operation to save time. - I think there are still spaces we can optimize. - - It seems when using w_f_approx, it gives some errors if y < 0. So when computing for places - where y < 0, we first compute the value at - y, and then change its sign. - """ - - output_grid_final = np.zeros(grid.shape[0], dtype="complex128") - - q2 = axis_ratio**2.0 - - scale_factor = axis_ratio / (sigmas[0] * np.sqrt(2.0 * (1.0 - q2))) - - xs = np.array((grid[:, 1] * scale_factor).copy()) - ys = np.array((grid[:, 0] * scale_factor).copy()) - - ys_minus = ys < 0.0 - ys[ys_minus] *= -1 - z = xs + 1j * ys - zq = axis_ratio * xs + 1j * ys / axis_ratio - - expv = -(xs**2.0) * (1.0 - q2) - ys**2.0 * (1.0 / q2 - 1.0) - - for i in range(len(sigmas)): - if i > 0: - z /= sigmas[i] / sigmas[i - 1] - zq /= sigmas[i] / sigmas[i - 1] - expv /= (sigmas[i] / sigmas[i - 1]) ** 2.0 - - output_grid = -1j * (w_f_approx(z) - np.exp(expv) * w_f_approx(zq)) - - output_grid[ys_minus] = np.conj(output_grid[ys_minus]) - - output_grid_final += (amps[i] * sigmas[i]) * output_grid - - return output_grid_final - - @staticmethod - def kesi(p): - """ - see Eq.(6) of 1906.08263 - """ - n_list = np.arange(0, 2 * p + 1, 1) - return (2.0 * p * np.log(10) / 3.0 + 2.0 * np.pi * n_list * 1j) ** (0.5) - - @staticmethod - def eta(p): - """ - see Eq.(6) of 1906.00263 - """ - eta_list = np.zeros(int(2 * p + 1)) - kesi_list = np.zeros(int(2 * p + 1)) - kesi_list[0] = 0.5 - kesi_list[1 : p + 1] = 1.0 - kesi_list[int(2 * p)] = 1.0 / 2.0**p - - for i in np.arange(1, p, 1): - kesi_list[2 * p - i] = kesi_list[2 * p - i + 1] + 2 ** (-p) * comb(p, i) - - for i in np.arange(0, 2 * p + 1, 1): - eta_list[i] = ( - (-1) ** i * 2.0 * np.sqrt(2.0 * np.pi) * 10 ** (p / 3.0) * kesi_list[i] - ) - - return eta_list - - def decompose_convergence_via_mge(self): - raise NotImplementedError() - - def _decompose_convergence_via_mge( - self, func, radii_min, radii_max, func_terms=28, func_gaussians=20 - ): - """ - - Parameters - ---------- - func : func - The function representing the profile that is decomposed into Gaussians. - normalization - A normalization factor tyh - func_terms - The number of terms used to approximate the input func. - func_gaussians - The number of Gaussians used to represent the input func. - - Returns - ------- - """ - - kesis = self.kesi(func_terms) # kesi in Eq.(6) of 1906.08263 - etas = self.eta(func_terms) # eta in Eqr.(6) of 1906.08263 - - def f(sigma): - """Eq.(5) of 1906.08263""" - return np.sum(etas * np.real(target_function(sigma * kesis))) - - # sigma is sampled from logspace between these radii. - - log_sigmas = np.linspace(np.log(radii_min), np.log(radii_max), func_gaussians) - d_log_sigma = log_sigmas[1] - log_sigmas[0] - sigma_list = np.exp(log_sigmas) - - amplitude_list = np.zeros(func_gaussians) - - for i in range(func_gaussians): - f_sigma = np.sum(etas * np.real(func(sigma_list[i] * kesis))) - if (i == -1) or (i == (func_gaussians - 1)): - amplitude_list[i] = 0.5 * f_sigma * d_log_sigma / np.sqrt(2.0 * np.pi) - else: - amplitude_list[i] = f_sigma * d_log_sigma / np.sqrt(2.0 * np.pi) - - return amplitude_list, sigma_list - - def convergence_2d_via_mge_from(self, grid_radii): - raise NotImplementedError() - - def _convergence_2d_via_mge_from(self, grid_radii): - """Calculate the projected convergence at a given set of arc-second gridded coordinates. - - Parameters - ---------- - grid - The grid of (y,x) arc-second coordinates the convergence is computed on. - - """ - - self.count = 0 - self.sigma_calc = 0 - self.z = 0 - self.zq = 0 - self.expv = 0 - - amps, sigmas = self.decompose_convergence_via_mge() - - convergence = 0.0 - - for i in range(len(sigmas)): - convergence += self.convergence_func_gaussian( - grid_radii=grid_radii, sigma=sigmas[i], intensity=amps[i] - ) - return convergence - - def convergence_func_gaussian(self, grid_radii, sigma, intensity): - return np.multiply( - intensity, np.exp(-0.5 * np.square(np.divide(grid_radii, sigma))) - ) - - def _deflections_2d_via_mge_from(self, grid, sigmas_factor=1.0): - axis_ratio = self.axis_ratio - - if axis_ratio > 0.9999: - axis_ratio = 0.9999 - - amps, sigmas = self.decompose_convergence_via_mge() - sigmas *= sigmas_factor - - angle = self.zeta_from( - grid=grid, amps=amps, sigmas=sigmas, axis_ratio=axis_ratio - ) - - angle *= np.sqrt((2.0 * np.pi) / (1.0 - axis_ratio**2.0)) - - return self.rotated_grid_from_reference_frame_from( - np.vstack((-angle.imag, angle.real)).T - ) +import os + +if os.environ.get("USE_JAX", "0") == "1": + USING_JAX = True + from .mge_jax import MassProfileMGE +else: + USING_JAX = False + from .mge_numpy import MassProfileMGE diff --git a/autogalaxy/profiles/mass/abstract/mge_jax.py b/autogalaxy/profiles/mass/abstract/mge_jax.py new file mode 100644 index 000000000..42a568a4c --- /dev/null +++ b/autogalaxy/profiles/mass/abstract/mge_jax.py @@ -0,0 +1,161 @@ +import jax.numpy as np + +from .jax_utils import w_f_approx + + +class MassProfileMGE: + """ + This class speeds up deflection angle calculations of certain mass profiles by decompositing them into many + Gaussians. + + This follows the method of Shajib 2019 - https://academic.oup.com/mnras/article/488/1/1387/5526256 + """ + + def __init__(self): + pass + + @staticmethod + def zeta_from(grid, amps, sigmas, axis_ratio): + """ + The key part to compute the deflection angle of each Gaussian. + """ + q2 = axis_ratio**2.0 + + scale_factor = axis_ratio / np.sqrt(2.0 * (1.0 - q2)) + + xs = np.array((grid.array[:, 1] * scale_factor).copy()) + ys = np.array((grid.array[:, 0] * scale_factor).copy()) + + y_sign = np.sign(ys) + ys = ys * y_sign + + z = xs + 1j * ys + zq = axis_ratio * xs + 1j * ys / axis_ratio + expv = -(xs**2.0) * (1.0 - q2) - ys**2.0 * (1.0 / q2 - 1.0) + sigma_ = sigmas.reshape((-1,) + (1,) * xs.ndim) + inv_sigma_ = 1 / sigma_ + amps_ = amps.reshape((-1,) + (1,) * xs.ndim) + + # process as one big vectorized calculation + # could try `jax.lax.scan` instead if this is too much memory + w = w_f_approx(inv_sigma_ * z) + wq = w_f_approx(inv_sigma_ * zq) + exp_factor = np.exp(inv_sigma_**2 * expv) + + sigma_func_real = w.imag - exp_factor * wq.imag + sigma_func_imag = (-w.real + exp_factor * wq.real) * y_sign + + output_grid = sigma_ * amps_ * (sigma_func_real + 1j * sigma_func_imag) + return output_grid.sum(axis=0) + + @staticmethod + def kesi(p): + """ + see Eq.(6) of 1906.08263 + """ + n_list = np.arange(0, 2 * p + 1, 1) + return (2.0 * p * np.log(10) / 3.0 + 2.0 * np.pi * n_list * 1j) ** (0.5) + + @staticmethod + def eta(p): + """ + see Eq.(6) of 1906.00263 + """ + + i = np.arange(1, p, 1) + kesi_last = 1 / 2**p + k = kesi_last + np.cumsum(np.cumprod((p + 1 - i) / i) * kesi_last) + + kesi_list = np.hstack( + [np.array([0.5]), np.ones(p), k[::-1], np.array([kesi_last])] + ) + coef = (-1) ** np.arange(0, 2 * p + 1, 1) + eta_const = 2.0 * np.sqrt(2.0 * np.pi) * 10 ** (p / 3.0) + eta_list = coef * kesi_list + return eta_const, eta_list + + def decompose_convergence_via_mge(self): + raise NotImplementedError() + + def _decompose_convergence_via_mge( + self, func, radii_min, radii_max, func_terms=28, func_gaussians=20 + ): + """ + + Parameters + ---------- + func : func + The function representing the profile that is decomposed into Gaussians. + normalization + A normalization factor tyh + func_terms + The number of terms used to approximate the input func. + func_gaussians + The number of Gaussians used to represent the input func. + + Returns + ------- + """ + + kesis = self.kesi(func_terms) # kesi in Eq.(6) of 1906.08263 + eta_constant, eta_n = self.eta(func_terms) # eta in Eqr.(6) of 1906.08263 + + # sigma is sampled from logspace between these radii. + + log_sigmas = np.linspace(np.log(radii_min), np.log(radii_max), func_gaussians) + d_log_sigma = log_sigmas[1] - log_sigmas[0] + sigma_list = np.exp(log_sigmas) + + amplitude_list = np.zeros(func_gaussians) + f_sigma = eta_constant * np.sum( + eta_n * np.real(func(sigma_list.reshape(-1, 1) * kesis)), axis=1 + ) + amplitude_list = f_sigma * d_log_sigma / np.sqrt(2.0 * np.pi) + amplitude_list = amplitude_list.at[0].multiply(0.5) + amplitude_list = amplitude_list.at[-1].multiply(0.5) + return amplitude_list, sigma_list + + def convergence_2d_via_mge_from(self, grid_radii): + raise NotImplementedError() + + def _convergence_2d_via_mge_from( + self, grid_radii, func_terms=28, func_gaussians=20 + ): + """Calculate the projected convergence at a given set of arc-second gridded coordinates. + + Parameters + ---------- + grid + The grid of (y,x) arc-second coordinates the convergence is computed on. + + """ + amps, sigmas = self.decompose_convergence_via_mge( + func_terms=func_terms, func_gaussians=func_gaussians + ) + + convergence = 0.0 + + inv_sigma_ = 1 / sigmas.reshape((-1,) + (1,) * grid_radii.array.ndim) + amps_ = amps.reshape((-1,) + (1,) * grid_radii.array.ndim) + convergence = amps_ * np.exp(-0.5 * (grid_radii.array * inv_sigma_) ** 2) + return convergence.sum(axis=0) + + def _deflections_2d_via_mge_from( + self, grid, sigmas_factor=1.0, func_terms=28, func_gaussians=20 + ): + axis_ratio = np.min(np.array([self.axis_ratio, 0.9999])) + + amps, sigmas = self.decompose_convergence_via_mge( + func_terms=func_terms, func_gaussians=func_gaussians + ) + sigmas *= sigmas_factor + + angle = self.zeta_from( + grid=grid, amps=amps, sigmas=sigmas, axis_ratio=axis_ratio + ) + + angle *= np.sqrt((2.0 * np.pi) / (1.0 - axis_ratio**2.0)) + + return self.rotated_grid_from_reference_frame_from( + np.vstack((-angle.imag, angle.real)).T + ) diff --git a/autogalaxy/profiles/mass/abstract/mge_numpy.py b/autogalaxy/profiles/mass/abstract/mge_numpy.py new file mode 100644 index 000000000..08fd0c50d --- /dev/null +++ b/autogalaxy/profiles/mass/abstract/mge_numpy.py @@ -0,0 +1,280 @@ +import numpy as np +from scipy.special import comb + + +def w_f_approx(z): + """ + Compute the Faddeeva function :math:`w_{\mathrm F}(z)` using the + approximation given in Zaghloul (2017). + :param z: complex number + :type z: ``complex`` or ``numpy.array(dtype=complex)`` + :return: :math:`w_\mathrm{F}(z)` + :rtype: ``complex`` + + # This function is copied from + # "https://github.com/sibirrer/lenstronomy/tree/main/lenstronomy/LensModel/Profiles" + # written by Anowar J. Shajib (see 1906.08263) + """ + + reg_minus_imag = z.imag < 0.0 + z[reg_minus_imag] = np.conj(z[reg_minus_imag]) + + sqrt_pi = 1 / np.sqrt(np.pi) + i_sqrt_pi = 1j * sqrt_pi + + wz = np.empty_like(z) + + z_imag2 = z.imag**2 + abs_z2 = z.real**2 + z_imag2 + + reg1 = abs_z2 >= 38000.0 + if np.any(reg1): + wz[reg1] = i_sqrt_pi / z[reg1] + + reg2 = (256.0 <= abs_z2) & (abs_z2 < 38000.0) + if np.any(reg2): + t = z[reg2] + wz[reg2] = i_sqrt_pi * t / (t * t - 0.5) + + reg3 = (62.0 <= abs_z2) & (abs_z2 < 256.0) + if np.any(reg3): + t = z[reg3] + wz[reg3] = (i_sqrt_pi / t) * (1 + 0.5 / (t * t - 1.5)) + + reg4 = (30.0 <= abs_z2) & (abs_z2 < 62.0) & (z_imag2 >= 1e-13) + if np.any(reg4): + t = z[reg4] + tt = t * t + wz[reg4] = (i_sqrt_pi * t) * (tt - 2.5) / (tt * (tt - 3.0) + 0.75) + + reg5 = (62.0 > abs_z2) & np.logical_not(reg4) & (abs_z2 > 2.5) & (z_imag2 < 0.072) + if np.any(reg5): + t = z[reg5] + u = -t * t + f1 = sqrt_pi + f2 = 1 + s1 = [1.320522, 35.7668, 219.031, 1540.787, 3321.99, 36183.31] + s2 = [1.841439, 61.57037, 364.2191, 2186.181, 9022.228, 24322.84, 32066.6] + + for s in s1: + f1 = s - f1 * u + for s in s2: + f2 = s - f2 * u + + wz[reg5] = np.exp(u) + 1j * t * f1 / f2 + + reg6 = (30.0 > abs_z2) & np.logical_not(reg5) + if np.any(reg6): + t3 = -1j * z[reg6] + + f1 = sqrt_pi + f2 = 1 + s1 = [5.9126262, 30.180142, 93.15558, 181.92853, 214.38239, 122.60793] + s2 = [ + 10.479857, + 53.992907, + 170.35400, + 348.70392, + 457.33448, + 352.73063, + 122.60793, + ] + + for s in s1: + f1 = f1 * t3 + s + for s in s2: + f2 = f2 * t3 + s + + wz[reg6] = f1 / f2 + + # wz[reg_minus_imag] = np.conj(wz[reg_minus_imag]) + + return wz + + +class MassProfileMGE: + """ + This class speeds up deflection angle calculations of certain mass profiles by decompositing them into many + Gaussians. + + This follows the method of Shajib 2019 - https://academic.oup.com/mnras/article/488/1/1387/5526256 + """ + + def __init__(self): + self.count = 0 + self.sigma_calc = 0 + self.z = 0 + self.zq = 0 + self.expv = 0 + + @staticmethod + # @aa.util.numba.jit() + def zeta_from(grid, amps, sigmas, axis_ratio): + """ + The key part to compute the deflection angle of each Gaussian. + Because of my optimization, there are blocks looking weird and indirect. What I'm doing here + is trying to avoid big matrix operation to save time. + I think there are still spaces we can optimize. + + It seems when using w_f_approx, it gives some errors if y < 0. So when computing for places + where y < 0, we first compute the value at - y, and then change its sign. + """ + + output_grid_final = np.zeros(grid.shape[0], dtype="complex128") + + q2 = axis_ratio**2.0 + + scale_factor = axis_ratio / (sigmas[0] * np.sqrt(2.0 * (1.0 - q2))) + + xs = np.array((grid[:, 1] * scale_factor).copy()) + ys = np.array((grid[:, 0] * scale_factor).copy()) + + ys_minus = ys < 0.0 + ys[ys_minus] *= -1 + z = xs + 1j * ys + zq = axis_ratio * xs + 1j * ys / axis_ratio + + expv = -(xs**2.0) * (1.0 - q2) - ys**2.0 * (1.0 / q2 - 1.0) + + for i in range(len(sigmas)): + if i > 0: + z /= sigmas[i] / sigmas[i - 1] + zq /= sigmas[i] / sigmas[i - 1] + expv /= (sigmas[i] / sigmas[i - 1]) ** 2.0 + + output_grid = -1j * (w_f_approx(z) - np.exp(expv) * w_f_approx(zq)) + + output_grid[ys_minus] = np.conj(output_grid[ys_minus]) + + output_grid_final += (amps[i] * sigmas[i]) * output_grid + + return output_grid_final + + @staticmethod + def kesi(p): + """ + see Eq.(6) of 1906.08263 + """ + n_list = np.arange(0, 2 * p + 1, 1) + return (2.0 * p * np.log(10) / 3.0 + 2.0 * np.pi * n_list * 1j) ** (0.5) + + @staticmethod + def eta(p): + """ + see Eq.(6) of 1906.00263 + """ + eta_list = np.zeros(int(2 * p + 1)) + kesi_list = np.zeros(int(2 * p + 1)) + kesi_list[0] = 0.5 + kesi_list[1 : p + 1] = 1.0 + kesi_list[int(2 * p)] = 1.0 / 2.0**p + + for i in np.arange(1, p, 1): + kesi_list[2 * p - i] = kesi_list[2 * p - i + 1] + 2 ** (-p) * comb(p, i) + + for i in np.arange(0, 2 * p + 1, 1): + eta_list[i] = ( + (-1) ** i * 2.0 * np.sqrt(2.0 * np.pi) * 10 ** (p / 3.0) * kesi_list[i] + ) + + return eta_list + + def decompose_convergence_via_mge(self): + raise NotImplementedError() + + def _decompose_convergence_via_mge( + self, func, radii_min, radii_max, func_terms=28, func_gaussians=20 + ): + """ + + Parameters + ---------- + func : func + The function representing the profile that is decomposed into Gaussians. + normalization + A normalization factor tyh + func_terms + The number of terms used to approximate the input func. + func_gaussians + The number of Gaussians used to represent the input func. + + Returns + ------- + """ + + kesis = self.kesi(func_terms) # kesi in Eq.(6) of 1906.08263 + etas = self.eta(func_terms) # eta in Eqr.(6) of 1906.08263 + + def f(sigma): + """Eq.(5) of 1906.08263""" + return np.sum(etas * np.real(target_function(sigma * kesis))) + + # sigma is sampled from logspace between these radii. + + log_sigmas = np.linspace(np.log(radii_min), np.log(radii_max), func_gaussians) + d_log_sigma = log_sigmas[1] - log_sigmas[0] + sigma_list = np.exp(log_sigmas) + + amplitude_list = np.zeros(func_gaussians) + + for i in range(func_gaussians): + f_sigma = np.sum(etas * np.real(func(sigma_list[i] * kesis))) + if (i == 0) or (i == (func_gaussians - 1)): + amplitude_list[i] = 0.5 * f_sigma * d_log_sigma / np.sqrt(2.0 * np.pi) + else: + amplitude_list[i] = f_sigma * d_log_sigma / np.sqrt(2.0 * np.pi) + + return amplitude_list, sigma_list + + def convergence_2d_via_mge_from(self, grid_radii): + raise NotImplementedError() + + def _convergence_2d_via_mge_from(self, grid_radii): + """Calculate the projected convergence at a given set of arc-second gridded coordinates. + + Parameters + ---------- + grid + The grid of (y,x) arc-second coordinates the convergence is computed on. + + """ + + self.count = 0 + self.sigma_calc = 0 + self.z = 0 + self.zq = 0 + self.expv = 0 + + amps, sigmas = self.decompose_convergence_via_mge() + + convergence = 0.0 + + for i in range(len(sigmas)): + convergence += self.convergence_func_gaussian( + grid_radii=grid_radii, sigma=sigmas[i], intensity=amps[i] + ) + return convergence + + def convergence_func_gaussian(self, grid_radii, sigma, intensity): + return np.multiply( + intensity, np.exp(-0.5 * np.square(np.divide(grid_radii, sigma))) + ) + + def _deflections_2d_via_mge_from(self, grid, sigmas_factor=1.0): + axis_ratio = self.axis_ratio + + if axis_ratio > 0.9999: + axis_ratio = 0.9999 + + amps, sigmas = self.decompose_convergence_via_mge() + sigmas *= sigmas_factor + + angle = self.zeta_from( + grid=grid, amps=amps, sigmas=sigmas, axis_ratio=axis_ratio + ) + + angle *= np.sqrt((2.0 * np.pi) / (1.0 - axis_ratio**2.0)) + + return self.rotated_grid_from_reference_frame_from( + np.vstack((-angle.imag, angle.real)).T + ) diff --git a/autogalaxy/profiles/mass/dark/abstract.py b/autogalaxy/profiles/mass/dark/abstract.py index faba381d4..5379ed17e 100644 --- a/autogalaxy/profiles/mass/dark/abstract.py +++ b/autogalaxy/profiles/mass/dark/abstract.py @@ -58,7 +58,6 @@ def __init__( @aa.over_sample @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def convergence_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """Calculate the projected convergence at a given set of arc-second gridded coordinates. @@ -76,7 +75,6 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.over_sample @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def convergence_2d_via_mge_from(self, grid: aa.type.Grid2DLike, **kwargs): """Calculate the projected convergence at a given set of arc-second gridded coordinates. diff --git a/autogalaxy/profiles/mass/dark/gnfw.py b/autogalaxy/profiles/mass/dark/gnfw.py index 96cda9a4e..35066d62e 100644 --- a/autogalaxy/profiles/mass/dark/gnfw.py +++ b/autogalaxy/profiles/mass/dark/gnfw.py @@ -88,7 +88,6 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_2d_via_mge_from(self, grid: aa.type.Grid2DLike, **kwargs): return self._deflections_2d_via_mge_from( grid=grid, sigmas_factor=self.axis_ratio @@ -96,7 +95,6 @@ def deflections_2d_via_mge_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_2d_via_integral_from( self, grid: aa.type.Grid2DLike, tabulate_bins=1000, **kwargs ): @@ -233,7 +231,6 @@ def integral_y(y, eta): @aa.over_sample @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def potential_2d_from(self, grid: aa.type.Grid2DLike, tabulate_bins=1000, **kwargs): """ Calculate the potential at a given set of arc-second gridded coordinates. @@ -365,7 +362,6 @@ def __init__( @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_2d_via_integral_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the deflection angles at a given set of arc-second gridded coordinates. diff --git a/autogalaxy/profiles/mass/dark/gnfw_virial_mass_conc.py b/autogalaxy/profiles/mass/dark/gnfw_virial_mass_conc.py index 9247c9c9d..838b67453 100644 --- a/autogalaxy/profiles/mass/dark/gnfw_virial_mass_conc.py +++ b/autogalaxy/profiles/mass/dark/gnfw_virial_mass_conc.py @@ -43,9 +43,7 @@ def kappa_s_and_scale_radius( ############################## def integrand(r): - return (r**2 / r**inner_slope) * (1 + r / scale_radius_kpc) ** ( - inner_slope - 3 - ) + return (r**2 / r**inner_slope) * (1 + r / scale_radius_kpc) ** (inner_slope - 3) de_c = ( (overdens / 3.0) diff --git a/autogalaxy/profiles/mass/dark/gnfw_virial_mass_gnfw_conc.py b/autogalaxy/profiles/mass/dark/gnfw_virial_mass_gnfw_conc.py index ad466df1a..5be2e7840 100644 --- a/autogalaxy/profiles/mass/dark/gnfw_virial_mass_gnfw_conc.py +++ b/autogalaxy/profiles/mass/dark/gnfw_virial_mass_gnfw_conc.py @@ -49,9 +49,7 @@ def kappa_s_and_scale_radius( ############################## def integrand(r): - return (r**2 / r**inner_slope) * (1 + r / scale_radius_kpc) ** ( - inner_slope - 3 - ) + return (r**2 / r**inner_slope) * (1 + r / scale_radius_kpc) ** (inner_slope - 3) de_c = ( (overdens / 3.0) diff --git a/autogalaxy/profiles/mass/dark/nfw.py b/autogalaxy/profiles/mass/dark/nfw.py index 489db98c8..8da6dd9a3 100644 --- a/autogalaxy/profiles/mass/dark/nfw.py +++ b/autogalaxy/profiles/mass/dark/nfw.py @@ -48,7 +48,6 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_2d_via_integral_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the deflection angles at a given set of arc-second gridded coordinates. @@ -91,7 +90,6 @@ def calculate_deflection_component(npow, index): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_2d_via_cse_from(self, grid: aa.type.Grid2DLike, **kwargs): return self._deflections_2d_via_cse_from(grid=grid, **kwargs) @@ -122,7 +120,6 @@ def deflection_func(u, y, x, npow, axis_ratio, scale_radius): @aa.over_sample @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def convergence_2d_via_cse_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the projected 2D convergence from a grid of (y,x) arc second coordinates, by computing and summing @@ -149,7 +146,6 @@ def convergence_func(self, grid_radius: float) -> float: @aa.over_sample @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def potential_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the potential at a given set of arc-second gridded coordinates. @@ -263,7 +259,6 @@ def coord_func(r): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def shear_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Analytic calculation shear from Heyrovský & Karamazov 2024 @@ -304,7 +299,6 @@ def shear_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def convergence_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Analytic calculation convergence from Heyrovský & Karamazov 2024 @@ -376,7 +370,6 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_2d_via_analytic_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the deflection angles at a given set of arc-second gridded coordinates. @@ -405,7 +398,6 @@ def deflection_func_sph(self, grid_radius): @aa.over_sample @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def potential_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the potential at a given set of arc-second gridded coordinates. diff --git a/autogalaxy/profiles/mass/dark/nfw_hk24_util.py b/autogalaxy/profiles/mass/dark/nfw_hk24_util.py index 0c46b4cfa..2dceb9bf8 100644 --- a/autogalaxy/profiles/mass/dark/nfw_hk24_util.py +++ b/autogalaxy/profiles/mass/dark/nfw_hk24_util.py @@ -1,274 +1,256 @@ -""" -Created on Wed Apr 3 15:07:27 2024 - -@author: felixvecchi -""" -import numpy as np -from astropy.cosmology import Planck15 - -cosmo = Planck15 - - -def semi_major_axis_from(x1: np.ndarray, x2: np.ndarray, e: np.ndarray) -> np.ndarray: - """ - Returns the semi-major axis of the ellipse at a given point. - - Parameters - ---------- - x1 - Horizontal coordinate, scaled by r_s, so unitless - x2 - Vertical coordinate, scaled by r_s, so unitless - e - Eccentricity. - """ - return np.sqrt(x1**2 + x2**2 / (1 - e**2)) - - -def capital_F_from(chi: np.ndarray) -> np.ndarray: - """ - Equation 16 from Heyrovský & Karamazov. - - Parameters - ---------- - chi - Dimenionless radial coordinate. - - Returns - ------- - F(chi) - """ - F = np.zeros(chi.shape) - - root_min = np.sqrt(1 - chi[chi < 1] ** 2) - F[chi < 1] = np.arctanh(root_min) / root_min - F[chi == 1] = 1 - root_plus = np.sqrt(chi[chi > 1] ** 2 - 1) - F[chi > 1] = np.arctan(root_plus) / root_plus - return F - - -def kappa_from(k_s: float, a: np.ndarray) -> np.ndarray: - """ - Equation 16 from Heyrovský & Karamazov. - - Parameters - ---------- - k_s - Halo convergence parameter. - a - Semi major axis scaled by a_scale. - - Returns - ------- - Convergence as a function of a - """ - F = capital_F_from(a) - kappa = 2 * k_s * (1 - F) / (a**2 - 1) - kappa[a == 1] = 2 / 3 * k_s - return kappa - - -def small_f_1(x1: np.ndarray, x2: np.ndarray, e: float) -> np.ndarray: - """ - Equation 32 HK+24 - - Parameters - ---------- - x1 - Horizontal coordinate, scaled by r_s, so unitless - x2 - Vertical coordinate, scaled by r_s, so unitless - e - Eccentricity. - - Returns - ------- - f_1 - """ - a = semi_major_axis_from(x1, x2, e) - F = capital_F_from(a) - f1 = (1 - e**2) ** (-1 / 2) * F - return f1 - - -def small_f_2(x1: np.ndarray, x2: np.ndarray, e: float) -> np.ndarray: - """ - Equation 32 HK+24 - - Parameters - ---------- - x1 - Horizontal coordinate, scaled by r_s, so unitless - x2 - Vertical coordinate, scaled by r_s, so unitless - e - Eccentricity. - - Returns - ------- - f_3 - - """ - norm = np.sqrt(x1**2 + x2**2) - f2 = np.log(norm / (1 + np.sqrt(1 - e**2))) - return f2 - - -def small_f_3(x1: np.ndarray, x2: np.ndarray, e: float) -> np.ndarray: - """ - Equation 32 HK+24 - - Parameters - ---------- - x1 - Horizontal coordinate, scaled by r_s, so unitless - x2 - Vertical coordinate, scaled by r_s, so unitless - e - Eccentricity. - - Returns - ------- - f_3 - - """ - root = np.sqrt(1 - e**2) - f3 = np.arctan(x1 * x2 * (1 - root) / (x1**2 * root + x2**2)) - return f3 - - -def small_f_0(x1: np.ndarray, x2: np.ndarray, e: float) -> np.ndarray: - """ - Equation 37 HK+24 - - Parameters - ---------- - x1 - Horizontal coordinate, scaled by r_s, so unitless - x2 - Vertical coordinate, scaled by r_s, so unitless - e - Eccentricity. - - Returns - ------- - f_0 - - """ - a = semi_major_axis_from(x1, x2, e) - F = capital_F_from(a) - pre_factor = 1 / (2 * np.sqrt(1 - e**2)) - nominator = x1**2 + x2**2 + e**2 - 2 + (1 - e**2 * x1**2) * F - denominator = 1 - x1**2 - x2**2 / (1 - e**2) - - f0 = 1 + pre_factor * (nominator / denominator) - - return f0 - - -def g1_g2_from(x1, x2, e, k_s): - """ - Both components of the shear - - Equation 35 and 36 HK+24 - - Parameters - ---------- - x1 : numpy array - horizontal coordinate, scaled by r_s, so unitless - x2 : numpy array - vertical coordinate, scaled by r_s, so unitless - e : scalar - eccentricity. - k_s : scaler - halo convergence parameter - - Returns - ------- - tuple of 2 numpy arrays - gamma1, gamma2 (g1 in '+' and g2 in 'x' shape) - """ - - # Factorized functions g1 and g2 - f0 = small_f_0(x1, x2, e) - f1 = small_f_1(x1, x2, e) - f2 = small_f_2(x1, x2, e) - f3 = small_f_3(x1, x2, e) - - # Prefactor for both g1 and g2 - full_pre_factor = ( - 4 - * k_s - * np.sqrt(1 - e**2) - / (((x1 - e) ** 2 + x2**2) ** 2 * ((x1 + e) ** 2 + x2**2) ** 2) - ) - - # Prefactors for g1 - pre_f0_g1 = ( - ((x1 - e) ** 2 + x2**2) - * ((x1 + e) ** 2 + x2**2) - * (x1**2 - x2**2 - e**2) - ) - - pre_f1_g1 = ( - 2 - * e**2 - * (x1**2 - 1) - * ((x1**2 - x2**2 - e**2) ** 2 - 4 * x1**2 * x2**2) - - (x1**2 - x2**2 - e**2) ** 3 * (3 + e**2) / 2 - + 6 * x1**2 * x2**2 * (e**2 - 1) * (x1**2 - x2**2 - e**2) - ) - - pre_f2_g1 = -( - (x1**2 - x2**2 - e**2) * ((x1**2 + x2**2) ** 2 - e**4) - - 8 * e**2 * x1**2 * x2**2 - ) - - pre_f3_g1 = ( - 2 - * x1 - * x2 - * ((x1**2 + x2**2 + e**2) ** 2 - 4 * e**2 * (x2**2 + e**2)) - ) - - # First component shear - g1 = full_pre_factor * ( - pre_f0_g1 * f0 + pre_f1_g1 * f1 + pre_f2_g1 * f2 + pre_f3_g1 * f3 - ) - - # Prefactors g2 - pre_f0_g2 = 2 * x1 * x2 * ((x1 - e) ** 2 + x2**2) * ((x1 + e) ** 2 + x2**2) - - pre_f1_g2 = ( - x1 - * x2 - * ( - (x1**2 + x2**2 + e**2) - * ( - (5 * e**2 - 3) * x1**2 - - 3 * (1 + e**2) * x2**2 - + (5 - 3 * e**2) * e**2 - ) - - 4 * e**2 * x1**2 * (1 + e**2) - ) - ) - - pre_f2_g2 = ( - -2 - * x1 - * x2 - * ((x1**2 + x2**2 + e**2) ** 2 - 4 * e**2 * (x2**2 + e**2)) - ) - - pre_f3_g2 = -( - (x1**2 - x2**2 - e**2) * ((x1**2 + x2**2) ** 2 - e**4) - - 8 * e**2 * x1**2 * x2**2 - ) - - # Second component shear - g2 = full_pre_factor * ( - pre_f0_g2 * f0 + pre_f1_g2 * f1 + pre_f2_g2 * f2 + pre_f3_g2 * f3 - ) - - return g1, g2 +""" +Created on Wed Apr 3 15:07:27 2024 + +@author: felixvecchi +""" + +import numpy as np +from astropy.cosmology import Planck15 + +cosmo = Planck15 + + +def semi_major_axis_from(x1: np.ndarray, x2: np.ndarray, e: np.ndarray) -> np.ndarray: + """ + Returns the semi-major axis of the ellipse at a given point. + + Parameters + ---------- + x1 + Horizontal coordinate, scaled by r_s, so unitless + x2 + Vertical coordinate, scaled by r_s, so unitless + e + Eccentricity. + """ + return np.sqrt(x1**2 + x2**2 / (1 - e**2)) + + +def capital_F_from(chi: np.ndarray) -> np.ndarray: + """ + Equation 16 from Heyrovský & Karamazov. + + Parameters + ---------- + chi + Dimenionless radial coordinate. + + Returns + ------- + F(chi) + """ + F = np.zeros(chi.shape) + + root_min = np.sqrt(1 - chi[chi < 1] ** 2) + F[chi < 1] = np.arctanh(root_min) / root_min + F[chi == 1] = 1 + root_plus = np.sqrt(chi[chi > 1] ** 2 - 1) + F[chi > 1] = np.arctan(root_plus) / root_plus + return F + + +def kappa_from(k_s: float, a: np.ndarray) -> np.ndarray: + """ + Equation 16 from Heyrovský & Karamazov. + + Parameters + ---------- + k_s + Halo convergence parameter. + a + Semi major axis scaled by a_scale. + + Returns + ------- + Convergence as a function of a + """ + F = capital_F_from(a) + kappa = 2 * k_s * (1 - F) / (a**2 - 1) + kappa[a == 1] = 2 / 3 * k_s + return kappa + + +def small_f_1(x1: np.ndarray, x2: np.ndarray, e: float) -> np.ndarray: + """ + Equation 32 HK+24 + + Parameters + ---------- + x1 + Horizontal coordinate, scaled by r_s, so unitless + x2 + Vertical coordinate, scaled by r_s, so unitless + e + Eccentricity. + + Returns + ------- + f_1 + """ + a = semi_major_axis_from(x1, x2, e) + F = capital_F_from(a) + f1 = (1 - e**2) ** (-1 / 2) * F + return f1 + + +def small_f_2(x1: np.ndarray, x2: np.ndarray, e: float) -> np.ndarray: + """ + Equation 32 HK+24 + + Parameters + ---------- + x1 + Horizontal coordinate, scaled by r_s, so unitless + x2 + Vertical coordinate, scaled by r_s, so unitless + e + Eccentricity. + + Returns + ------- + f_3 + + """ + norm = np.sqrt(x1**2 + x2**2) + f2 = np.log(norm / (1 + np.sqrt(1 - e**2))) + return f2 + + +def small_f_3(x1: np.ndarray, x2: np.ndarray, e: float) -> np.ndarray: + """ + Equation 32 HK+24 + + Parameters + ---------- + x1 + Horizontal coordinate, scaled by r_s, so unitless + x2 + Vertical coordinate, scaled by r_s, so unitless + e + Eccentricity. + + Returns + ------- + f_3 + + """ + root = np.sqrt(1 - e**2) + f3 = np.arctan(x1 * x2 * (1 - root) / (x1**2 * root + x2**2)) + return f3 + + +def small_f_0(x1: np.ndarray, x2: np.ndarray, e: float) -> np.ndarray: + """ + Equation 37 HK+24 + + Parameters + ---------- + x1 + Horizontal coordinate, scaled by r_s, so unitless + x2 + Vertical coordinate, scaled by r_s, so unitless + e + Eccentricity. + + Returns + ------- + f_0 + + """ + a = semi_major_axis_from(x1, x2, e) + F = capital_F_from(a) + pre_factor = 1 / (2 * np.sqrt(1 - e**2)) + nominator = x1**2 + x2**2 + e**2 - 2 + (1 - e**2 * x1**2) * F + denominator = 1 - x1**2 - x2**2 / (1 - e**2) + + f0 = 1 + pre_factor * (nominator / denominator) + + return f0 + + +def g1_g2_from(x1, x2, e, k_s): + """ + Both components of the shear + + Equation 35 and 36 HK+24 + + Parameters + ---------- + x1 : numpy array + horizontal coordinate, scaled by r_s, so unitless + x2 : numpy array + vertical coordinate, scaled by r_s, so unitless + e : scalar + eccentricity. + k_s : scaler + halo convergence parameter + + Returns + ------- + tuple of 2 numpy arrays + gamma1, gamma2 (g1 in '+' and g2 in 'x' shape) + """ + + # Factorized functions g1 and g2 + f0 = small_f_0(x1, x2, e) + f1 = small_f_1(x1, x2, e) + f2 = small_f_2(x1, x2, e) + f3 = small_f_3(x1, x2, e) + + # Prefactor for both g1 and g2 + full_pre_factor = ( + 4 + * k_s + * np.sqrt(1 - e**2) + / (((x1 - e) ** 2 + x2**2) ** 2 * ((x1 + e) ** 2 + x2**2) ** 2) + ) + + # Prefactors for g1 + pre_f0_g1 = ( + ((x1 - e) ** 2 + x2**2) * ((x1 + e) ** 2 + x2**2) * (x1**2 - x2**2 - e**2) + ) + + pre_f1_g1 = ( + 2 * e**2 * (x1**2 - 1) * ((x1**2 - x2**2 - e**2) ** 2 - 4 * x1**2 * x2**2) + - (x1**2 - x2**2 - e**2) ** 3 * (3 + e**2) / 2 + + 6 * x1**2 * x2**2 * (e**2 - 1) * (x1**2 - x2**2 - e**2) + ) + + pre_f2_g1 = -( + (x1**2 - x2**2 - e**2) * ((x1**2 + x2**2) ** 2 - e**4) + - 8 * e**2 * x1**2 * x2**2 + ) + + pre_f3_g1 = 2 * x1 * x2 * ((x1**2 + x2**2 + e**2) ** 2 - 4 * e**2 * (x2**2 + e**2)) + + # First component shear + g1 = full_pre_factor * ( + pre_f0_g1 * f0 + pre_f1_g1 * f1 + pre_f2_g1 * f2 + pre_f3_g1 * f3 + ) + + # Prefactors g2 + pre_f0_g2 = 2 * x1 * x2 * ((x1 - e) ** 2 + x2**2) * ((x1 + e) ** 2 + x2**2) + + pre_f1_g2 = ( + x1 + * x2 + * ( + (x1**2 + x2**2 + e**2) + * ((5 * e**2 - 3) * x1**2 - 3 * (1 + e**2) * x2**2 + (5 - 3 * e**2) * e**2) + - 4 * e**2 * x1**2 * (1 + e**2) + ) + ) + + pre_f2_g2 = -2 * x1 * x2 * ((x1**2 + x2**2 + e**2) ** 2 - 4 * e**2 * (x2**2 + e**2)) + + pre_f3_g2 = -( + (x1**2 - x2**2 - e**2) * ((x1**2 + x2**2) ** 2 - e**4) + - 8 * e**2 * x1**2 * x2**2 + ) + + # Second component shear + g2 = full_pre_factor * ( + pre_f0_g2 * f0 + pre_f1_g2 * f1 + pre_f2_g2 * f2 + pre_f3_g2 * f3 + ) + + return g1, g2 diff --git a/autogalaxy/profiles/mass/dark/nfw_truncated.py b/autogalaxy/profiles/mass/dark/nfw_truncated.py index 773ef10c9..5f634cff5 100644 --- a/autogalaxy/profiles/mass/dark/nfw_truncated.py +++ b/autogalaxy/profiles/mass/dark/nfw_truncated.py @@ -29,7 +29,6 @@ def __init__( @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the deflection angles at a given set of arc-second gridded coordinates. diff --git a/autogalaxy/profiles/mass/dark/nfw_virial_mass_conc.py b/autogalaxy/profiles/mass/dark/nfw_virial_mass_conc.py index ef890eead..5ca0d3590 100644 --- a/autogalaxy/profiles/mass/dark/nfw_virial_mass_conc.py +++ b/autogalaxy/profiles/mass/dark/nfw_virial_mass_conc.py @@ -1,92 +1,92 @@ -from typing import Tuple - -from autogalaxy.profiles.mass.dark.nfw import NFWSph - -from astropy import units - -import numpy as np -import warnings - -from autogalaxy.cosmology.wrap import Planck15 - - -def kappa_s_and_scale_radius( - virial_mass, concentration, virial_overdens, redshift_object, redshift_source -): - cosmology = Planck15() - - cosmic_average_density = ( - cosmology.critical_density(redshift_object).to(units.solMass / units.kpc**3) - ).value - - critical_surface_density = ( - cosmology.critical_surface_density_between_redshifts_solar_mass_per_kpc2_from( - redshift_0=redshift_object, redshift_1=redshift_source - ) - ) - - kpc_per_arcsec = cosmology.kpc_per_arcsec_from(redshift=redshift_object) - - virial_radius = ( - virial_mass / (virial_overdens * cosmic_average_density * (4.0 * np.pi / 3.0)) - ) ** ( - 1.0 / 3.0 - ) # r_vir - de_c = ( - virial_overdens - / 3.0 - * ( - concentration**3 - / (np.log(1.0 + concentration) - concentration / (1.0 + concentration)) - ) - ) # rho_c - - scale_radius_kpc = virial_radius / concentration # scale radius in kpc - rho_s = cosmic_average_density * de_c # rho_s - kappa_s = rho_s * scale_radius_kpc / critical_surface_density # kappa_s - scale_radius = scale_radius_kpc / kpc_per_arcsec # scale radius in arcsec - - return kappa_s, scale_radius, virial_radius - - -class NFWVirialMassConcSph(NFWSph): - def __init__( - self, - centre: Tuple[float, float] = (0.0, 0.0), - virial_mass: float = 1e12, - concentration: float = 10, - virial_overdens: float = 200, - redshift_object: float = 0.5, - redshift_source: float = 1.0, - ): - """ - Spherical NFW profile initialized with the mass and concentration of the halo. - - Parameters - ---------- - centre - The (y,x) arc-second coordinates of the profile centre. - virial_mass - The virial mass of the dark matter halo. - concentration - The concentration of the dark matter halo. - virial_overdens - The virial overdensity. - """ - self.virial_mass = virial_mass - self.concentration = concentration - self.virial_overdens = virial_overdens - - ( - kappa_s, - scale_radius, - virial_radius, - ) = kappa_s_and_scale_radius( - virial_mass=virial_mass, - concentration=concentration, - virial_overdens=virial_overdens, - redshift_object=redshift_object, - redshift_source=redshift_source, - ) - - super().__init__(centre=centre, kappa_s=kappa_s, scale_radius=scale_radius) +from typing import Tuple + +from autogalaxy.profiles.mass.dark.nfw import NFWSph + +from astropy import units + +import numpy as np +import warnings + +from autogalaxy.cosmology.wrap import Planck15 + + +def kappa_s_and_scale_radius( + virial_mass, concentration, virial_overdens, redshift_object, redshift_source +): + cosmology = Planck15() + + cosmic_average_density = ( + cosmology.critical_density(redshift_object).to(units.solMass / units.kpc**3) + ).value + + critical_surface_density = ( + cosmology.critical_surface_density_between_redshifts_solar_mass_per_kpc2_from( + redshift_0=redshift_object, redshift_1=redshift_source + ) + ) + + kpc_per_arcsec = cosmology.kpc_per_arcsec_from(redshift=redshift_object) + + virial_radius = ( + virial_mass / (virial_overdens * cosmic_average_density * (4.0 * np.pi / 3.0)) + ) ** ( + 1.0 / 3.0 + ) # r_vir + de_c = ( + virial_overdens + / 3.0 + * ( + concentration**3 + / (np.log(1.0 + concentration) - concentration / (1.0 + concentration)) + ) + ) # rho_c + + scale_radius_kpc = virial_radius / concentration # scale radius in kpc + rho_s = cosmic_average_density * de_c # rho_s + kappa_s = rho_s * scale_radius_kpc / critical_surface_density # kappa_s + scale_radius = scale_radius_kpc / kpc_per_arcsec # scale radius in arcsec + + return kappa_s, scale_radius, virial_radius + + +class NFWVirialMassConcSph(NFWSph): + def __init__( + self, + centre: Tuple[float, float] = (0.0, 0.0), + virial_mass: float = 1e12, + concentration: float = 10, + virial_overdens: float = 200, + redshift_object: float = 0.5, + redshift_source: float = 1.0, + ): + """ + Spherical NFW profile initialized with the mass and concentration of the halo. + + Parameters + ---------- + centre + The (y,x) arc-second coordinates of the profile centre. + virial_mass + The virial mass of the dark matter halo. + concentration + The concentration of the dark matter halo. + virial_overdens + The virial overdensity. + """ + self.virial_mass = virial_mass + self.concentration = concentration + self.virial_overdens = virial_overdens + + ( + kappa_s, + scale_radius, + virial_radius, + ) = kappa_s_and_scale_radius( + virial_mass=virial_mass, + concentration=concentration, + virial_overdens=virial_overdens, + redshift_object=redshift_object, + redshift_source=redshift_source, + ) + + super().__init__(centre=centre, kappa_s=kappa_s, scale_radius=scale_radius) diff --git a/autogalaxy/profiles/mass/point/point.py b/autogalaxy/profiles/mass/point/point.py index 711db7c25..581484e62 100644 --- a/autogalaxy/profiles/mass/point/point.py +++ b/autogalaxy/profiles/mass/point/point.py @@ -40,7 +40,6 @@ def potential_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): grid_radii = self.radial_grid_from(grid=grid, **kwargs) return self._cartesian_grid_via_radial_from( diff --git a/autogalaxy/profiles/mass/sheets/external_shear.py b/autogalaxy/profiles/mass/sheets/external_shear.py index 083c48963..01ee3b45a 100644 --- a/autogalaxy/profiles/mass/sheets/external_shear.py +++ b/autogalaxy/profiles/mass/sheets/external_shear.py @@ -56,7 +56,6 @@ def potential_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the deflection angles at a given set of arc-second gridded coordinates. diff --git a/autogalaxy/profiles/mass/sheets/mass_sheet.py b/autogalaxy/profiles/mass/sheets/mass_sheet.py index ed9c1144a..ee28451e0 100644 --- a/autogalaxy/profiles/mass/sheets/mass_sheet.py +++ b/autogalaxy/profiles/mass/sheets/mass_sheet.py @@ -34,7 +34,6 @@ def potential_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): grid_radii = self.radial_grid_from(grid=grid, **kwargs) return self._cartesian_grid_via_radial_from( diff --git a/autogalaxy/profiles/mass/stellar/chameleon.py b/autogalaxy/profiles/mass/stellar/chameleon.py index 580b94ad4..77d8005ac 100644 --- a/autogalaxy/profiles/mass/stellar/chameleon.py +++ b/autogalaxy/profiles/mass/stellar/chameleon.py @@ -53,7 +53,6 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_2d_via_analytic_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the deflection angles at a given set of arc-second gridded coordinates. @@ -127,7 +126,6 @@ def deflections_2d_via_analytic_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.over_sample @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def convergence_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """Calculate the projected convergence at a given set of arc-second gridded coordinates. Parameters diff --git a/autogalaxy/profiles/mass/stellar/gaussian.py b/autogalaxy/profiles/mass/stellar/gaussian.py index 42fa8d540..f16998fae 100644 --- a/autogalaxy/profiles/mass/stellar/gaussian.py +++ b/autogalaxy/profiles/mass/stellar/gaussian.py @@ -1,5 +1,9 @@ import copy import numpy as np +from autofit.jax_wrapper import use_jax + +if use_jax: + import jax from scipy.special import wofz from scipy.integrate import quad from typing import Tuple @@ -59,7 +63,6 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_2d_via_analytic_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the deflection angles at a given set of arc-second gridded coordinates. @@ -87,7 +90,6 @@ def deflections_2d_via_analytic_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_2d_via_integral_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the deflection angles at a given set of arc-second gridded coordinates. @@ -144,7 +146,6 @@ def deflection_func(u, y, x, npow, axis_ratio, sigma): @aa.over_sample @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def convergence_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """Calculate the projected convergence at a given set of arc-second gridded coordinates. @@ -188,7 +189,10 @@ def image_2d_via_radii_from(self, grid_radii: np.ndarray): @property def axis_ratio(self): axis_ratio = super().axis_ratio - return axis_ratio if axis_ratio < 0.9999 else 0.9999 + if use_jax: + return jax.lax.select(axis_ratio < 0.9999, axis_ratio, 0.9999) + else: + return axis_ratio if axis_ratio < 0.9999 else 0.9999 def zeta_from(self, grid: aa.type.Grid2DLike): q2 = self.axis_ratio**2.0 diff --git a/autogalaxy/profiles/mass/stellar/sersic.py b/autogalaxy/profiles/mass/stellar/sersic.py index 0d0b8ec97..4c9e57a0c 100644 --- a/autogalaxy/profiles/mass/stellar/sersic.py +++ b/autogalaxy/profiles/mass/stellar/sersic.py @@ -1,5 +1,13 @@ +import os + +if os.environ.get("USE_JAX", "0") == "1": + USING_JAX = True + import jax.numpy as np +else: + USING_JAX = False + import numpy as np + import copy -import numpy as np from scipy.integrate import quad from typing import List, Tuple @@ -129,8 +137,9 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum - def deflections_2d_via_mge_from(self, grid: aa.type.Grid2DLike, **kwargs): + def deflections_2d_via_mge_from( + self, grid: aa.type.Grid2DLike, func_terms=28, func_gaussians=20, **kwargs + ): """ Calculate the projected 2D deflection angles from a grid of (y,x) arc second coordinates, by computing and summing the convergence of each individual cse used to decompose the mass profile. @@ -145,12 +154,14 @@ def deflections_2d_via_mge_from(self, grid: aa.type.Grid2DLike, **kwargs): The grid of (y,x) arc-second coordinates the convergence is computed on. """ return self._deflections_2d_via_mge_from( - grid=grid, sigmas_factor=np.sqrt(self.axis_ratio) + grid=grid, + sigmas_factor=np.sqrt(self.axis_ratio), + func_terms=func_terms, + func_gaussians=func_gaussians, ) @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_2d_via_cse_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the projected 2D deflection angles from a grid of (y,x) arc second coordinates, by computing and @@ -170,7 +181,6 @@ def deflections_2d_via_cse_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.over_sample @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def convergence_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """Calculate the projected convergence at a given set of arc-second gridded coordinates. @@ -187,8 +197,9 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.over_sample @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum - def convergence_2d_via_mge_from(self, grid: aa.type.Grid2DLike, **kwargs): + def convergence_2d_via_mge_from( + self, grid: aa.type.Grid2DLike, func_terms=28, func_gaussians=20, **kwargs + ): """ Calculate the projected convergence at a given set of arc-second gridded coordinates. @@ -201,12 +212,15 @@ def convergence_2d_via_mge_from(self, grid: aa.type.Grid2DLike, **kwargs): eccentric_radii = self.eccentric_radii_grid_from(grid=grid, **kwargs) - return self._convergence_2d_via_mge_from(grid_radii=eccentric_radii) + return self._convergence_2d_via_mge_from( + grid_radii=eccentric_radii, + func_terms=func_terms, + func_gaussians=func_gaussians, + ) @aa.over_sample @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def convergence_2d_via_cse_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the projected 2D convergence from a grid of (y,x) arc second coordinates, by computing and summing @@ -247,7 +261,9 @@ def image_2d_via_radii_from(self, radius: np.ndarray): * (((radius / self.effective_radius) ** (1.0 / self.sersic_index)) - 1) ) - def decompose_convergence_via_mge(self) -> Tuple[List, List]: + def decompose_convergence_via_mge( + self, func_terms=28, func_gaussians=20 + ) -> Tuple[List, List]: radii_min = self.effective_radius / 100.0 radii_max = self.effective_radius * 20.0 @@ -262,7 +278,11 @@ def sersic_2d(r): ) return self._decompose_convergence_via_mge( - func=sersic_2d, radii_min=radii_min, radii_max=radii_max + func=sersic_2d, + radii_min=radii_min, + radii_max=radii_max, + func_terms=func_terms, + func_gaussians=func_gaussians, ) def decompose_convergence_via_cse( @@ -359,7 +379,6 @@ def elliptical_effective_radius(self): class Sersic(AbstractSersic, MassProfileMGE, MassProfileCSE): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_2d_via_integral_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the deflection angles at a given set of arc-second gridded coordinates. @@ -374,10 +393,10 @@ def deflections_2d_via_integral_from(self, grid: aa.type.Grid2DLike, **kwargs): def calculate_deflection_component(npow, index): sersic_constant = self.sersic_constant - deflection_grid = self.axis_ratio * grid[:, index] + deflection_grid = self.axis_ratio * grid.array[:, index] for i in range(grid.shape[0]): - deflection_grid[i] *= ( + deflection_grid = deflection_grid.at[i].multiply( self.intensity * self.mass_to_light_ratio * quad( @@ -385,8 +404,8 @@ def calculate_deflection_component(npow, index): a=0.0, b=1.0, args=( - grid[i, 0], - grid[i, 1], + grid.array[i, 0], + grid.array[i, 1], npow, self.axis_ratio, self.sersic_index, diff --git a/autogalaxy/profiles/mass/stellar/sersic_gradient.py b/autogalaxy/profiles/mass/stellar/sersic_gradient.py index 3b2495548..426e7a1cc 100644 --- a/autogalaxy/profiles/mass/stellar/sersic_gradient.py +++ b/autogalaxy/profiles/mass/stellar/sersic_gradient.py @@ -52,7 +52,6 @@ def __init__( @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_2d_via_integral_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the deflection angles at a given set of arc-second gridded coordinates. @@ -126,7 +125,6 @@ def deflection_func( @aa.over_sample @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def convergence_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """Calculate the projected convergence at a given set of arc-second gridded coordinates. diff --git a/autogalaxy/profiles/mass/total/isothermal.py b/autogalaxy/profiles/mass/total/isothermal.py index e9a9ce41e..e7fac6830 100644 --- a/autogalaxy/profiles/mass/total/isothermal.py +++ b/autogalaxy/profiles/mass/total/isothermal.py @@ -1,4 +1,13 @@ -import numpy as np +import os + +if os.environ.get("USE_JAX", "0") == "1": + USING_JAX = True + import jax.numpy as np + from jax.lax import min +else: + USING_JAX = False + import numpy as np + from typing import Tuple import autoarray as aa @@ -30,14 +39,21 @@ def psi_from(grid, axis_ratio, core_radius): The value of the Psi term. """ - return np.sqrt( - np.add( - np.multiply( - axis_ratio**2.0, np.add(np.square(grid[:, 1]), core_radius**2.0) - ), - np.square(grid[:, 0]), + if USING_JAX: + return np.sqrt( + (axis_ratio**2.0 * (grid[:, 1] ** 2.0 + core_radius**2.0)) + + grid[:, 0] ** 2.0 + + 1e-16 + ) + else: + return np.sqrt( + np.add( + np.multiply( + axis_ratio**2.0, np.add(np.square(grid[:, 1]), core_radius**2.0) + ), + np.square(grid[:, 0]), + ) ) - ) class Isothermal(PowerLaw): @@ -75,7 +91,6 @@ def axis_ratio(self): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the deflection angles on a grid of (y,x) arc-second coordinates. @@ -95,6 +110,8 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): * self.axis_ratio / np.sqrt(1 - self.axis_ratio**2) ) + if USING_JAX: + grid = grid.array psi = psi_from(grid=grid, axis_ratio=self.axis_ratio, core_radius=0.0) @@ -111,7 +128,6 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def shear_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the (gamma_y, gamma_x) shear vector field on a grid of (y,x) arc-second coordinates. @@ -173,7 +189,6 @@ def axis_ratio(self): @aa.over_sample @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def potential_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the potential on a grid of (y,x) arc-second coordinates. @@ -188,7 +203,6 @@ def potential_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the deflection angles on a grid of (y,x) arc-second coordinates. diff --git a/autogalaxy/profiles/mass/total/jax_utils.py b/autogalaxy/profiles/mass/total/jax_utils.py new file mode 100644 index 000000000..5237f34cd --- /dev/null +++ b/autogalaxy/profiles/mass/total/jax_utils.py @@ -0,0 +1,47 @@ +import jax +import jax.numpy as jnp +from jax.tree_util import Partial as partial + + +# A version of scan that will *not* re-compile partial functions when variables change +# taken from https://github.com/google/jax/issues/14743#issuecomment-1456900634 +scan = jax.jit(jax.lax.scan, static_argnames=("length", "reverse", "unroll")) + + +def body_fun(carry, n, factor, ei2phi, slope): + omega_nm1, partial_sum = carry + two_n = 2 * n + two_minus_slope = 2 - slope + ratio = (two_n - two_minus_slope) / (two_n + two_minus_slope) + omega_n = -factor * ratio * ei2phi * omega_nm1 + partial_sum = partial_sum + omega_n + return (omega_n, partial_sum), None + + +def omega(eiphi, slope, factor, n_terms=20): + """JAX implementation of the numerical evaluation of the angular component of + the complex deflection angle for the elliptical power law profile as given as + given by Tessore and Metcalf 2015. Based on equation 29, and gives + omega (e.g. can be used as a drop in replacement for the exp(i * phi) * special.hyp2f1 + term in equation 13). + + Parameters + ---------- + eiphi: + `exp(i * phi)` where `phi` is the elliptical angle of the profile + slope: + The density slope of the power-law (lower value -> shallower profile, higher value + -> steeper profile). + factor: + The second flattening of and ellipse with axis ration q give by `f = (1 - q) / (1 + q)` + n_terms: + The number of terms to calculate for the series expansion, defaults to 20 (this should + be sufficient most of the time) + """ + # use modified scan with a partial'ed function to avoid re-compile + (_, partial_sum), _ = scan( + partial(body_fun, factor=factor, ei2phi=eiphi**2, slope=slope), + (eiphi, eiphi), + jnp.arange(1, n_terms), + ) + return partial_sum diff --git a/autogalaxy/profiles/mass/total/power_law.py b/autogalaxy/profiles/mass/total/power_law.py index 9fc619e15..ee0864e71 100644 --- a/autogalaxy/profiles/mass/total/power_law.py +++ b/autogalaxy/profiles/mass/total/power_law.py @@ -1,4 +1,13 @@ -import numpy as np +import os + +if os.environ.get("USE_JAX", "0") == "1": + USING_JAX = True + import jax.numpy as np + from .jax_utils import omega +else: + USING_JAX = False + import numpy as np + from scipy import special from typing import Tuple @@ -52,7 +61,6 @@ def potential_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the deflection angles on a grid of (y,x) arc-second coordinates. @@ -79,20 +87,24 @@ def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): angle = np.arctan2( grid[:, 0], np.multiply(self.axis_ratio, grid[:, 1]) ) # Note, this angle is not the position angle - R = np.sqrt( - np.add(np.multiply(self.axis_ratio**2, grid[:, 1] ** 2), grid[:, 0] ** 2) - ) z = np.add( np.multiply(np.cos(angle), 1 + 0j), np.multiply(np.sin(angle), 0 + 1j) ) + if USING_JAX: + # offset radius so calculation is finite at (0, 0) + R = np.sqrt((self.axis_ratio * grid[:, 1]) ** 2 + grid[:, 0] ** 2 + 1e-16) + zh = omega(z, slope, factor, n_terms=20) + else: + R = np.sqrt( + np.add( + np.multiply(self.axis_ratio**2, grid[:, 1] ** 2), grid[:, 0] ** 2 + ) + ) + zh = z * special.hyp2f1(1.0, 0.5 * slope, 2.0 - 0.5 * slope, -factor * z**2) + complex_angle = ( - 2.0 - * b - / (1.0 + self.axis_ratio) - * (b / R) ** (slope - 1.0) - * z - * special.hyp2f1(1.0, 0.5 * slope, 2.0 - 0.5 * slope, -factor * z**2) + 2.0 * b / (1.0 + self.axis_ratio) * (b / R) ** (slope - 1.0) * zh ) deflection_y = complex_angle.imag @@ -152,7 +164,6 @@ def __init__( @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): eta = self.radial_grid_from(grid=grid, **kwargs) deflection_r = ( diff --git a/autogalaxy/profiles/mass/total/power_law_broken.py b/autogalaxy/profiles/mass/total/power_law_broken.py index 233240550..530ca4faa 100644 --- a/autogalaxy/profiles/mass/total/power_law_broken.py +++ b/autogalaxy/profiles/mass/total/power_law_broken.py @@ -52,7 +52,6 @@ def __init__( @aa.over_sample @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def convergence_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Returns the dimensionless density kappa=Sigma/Sigma_c (eq. 1) @@ -77,7 +76,6 @@ def potential_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_yx_2d_from(self, grid, max_terms=20, **kwargs): """ Returns the complex deflection angle from eq. 18 and 19 diff --git a/autogalaxy/profiles/mass/total/power_law_core.py b/autogalaxy/profiles/mass/total/power_law_core.py index 3a5a52d49..dc43fa235 100644 --- a/autogalaxy/profiles/mass/total/power_law_core.py +++ b/autogalaxy/profiles/mass/total/power_law_core.py @@ -52,7 +52,6 @@ def einstein_radius_rescaled(self): @aa.over_sample @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def convergence_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Returns the two dimensional projected convergence on a grid of (y,x) arc-second coordinates. @@ -78,7 +77,6 @@ def convergence_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.over_sample @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def potential_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the potential on a grid of (y,x) arc-second coordinates. @@ -109,7 +107,6 @@ def potential_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the deflection angles on a grid of (y,x) arc-second coordinates. @@ -219,7 +216,6 @@ def __init__( @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_yx_2d_from(self, grid: aa.type.Grid2DLike, **kwargs): """ Calculate the deflection angles on a grid of (y,x) arc-second coordinates. diff --git a/autogalaxy/profiles/mass/total/power_law_multipole.py b/autogalaxy/profiles/mass/total/power_law_multipole.py index da5c5cc8a..47ff2aa17 100644 --- a/autogalaxy/profiles/mass/total/power_law_multipole.py +++ b/autogalaxy/profiles/mass/total/power_law_multipole.py @@ -148,7 +148,6 @@ def jacobian( @aa.grid_dec.to_vector_yx @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def deflections_yx_2d_from( self, grid: aa.type.Grid1D2DLike, **kwargs ) -> np.ndarray: @@ -195,7 +194,6 @@ def deflections_yx_2d_from( @aa.over_sample @aa.grid_dec.to_array @aa.grid_dec.transform - @aa.grid_dec.relocate_to_radial_minimum def convergence_2d_from(self, grid: aa.type.Grid1D2DLike, **kwargs) -> np.ndarray: """ Returns the two dimensional projected convergence on a grid of (y,x) arc-second coordinates. diff --git a/autogalaxy/util/shear_field.py b/autogalaxy/util/shear_field.py index b0f5f02d2..179e8f09a 100644 --- a/autogalaxy/util/shear_field.py +++ b/autogalaxy/util/shear_field.py @@ -94,7 +94,6 @@ class ShearYX2D(aa.VectorYX2D, AbstractShearField): class ShearYX2DIrregular(aa.VectorYX2DIrregular, AbstractShearField): - """ An irregular shear field, which is collection of (y,x) vectors which are located on an irregular grid of (y,x) coordinates. diff --git a/docs/installation/conda.rst b/docs/installation/conda.rst index 2df01a4ed..e0cdf6096 100644 --- a/docs/installation/conda.rst +++ b/docs/installation/conda.rst @@ -106,7 +106,6 @@ For interferometer analysis there are two optional dependencies that must be ins .. code-block:: bash pip install pynufft - pip install pylops==2.3.1 **PyAutoGalaxy** will run without these libraries and it is recommended that you only install them if you intend to do interferometer analysis. diff --git a/docs/installation/overview.rst b/docs/installation/overview.rst index 87beb953c..b4fcddafa 100644 --- a/docs/installation/overview.rst +++ b/docs/installation/overview.rst @@ -65,5 +65,3 @@ Dependencies And the following optional dependencies: **pynufft**: https://github.com/jyhmiinlin/pynufft - -**PyLops**: https://github.com/PyLops/pylops diff --git a/docs/installation/pip.rst b/docs/installation/pip.rst index e5c90874d..22cc619bb 100644 --- a/docs/installation/pip.rst +++ b/docs/installation/pip.rst @@ -86,7 +86,6 @@ For interferometer analysis there are two optional dependencies that must be ins .. code-block:: bash pip install pynufft - pip install pylops==2.3.1 **PyAutoGalaxy** will run without these libraries and it is recommended that you only install them if you intend to do interferometer analysis. diff --git a/docs/installation/source.rst b/docs/installation/source.rst index ec1d3ca02..5028ca403 100644 --- a/docs/installation/source.rst +++ b/docs/installation/source.rst @@ -56,7 +56,6 @@ For unit tests to pass you will also need the following optional requirements: .. code-block:: bash pip install pynufft - pip install pylops==2.3.1 If you are using a ``conda`` environment, add the source repository as follows: diff --git a/eden.ini b/eden.ini index d16b30eb0..a22a58033 100644 --- a/eden.ini +++ b/eden.ini @@ -1,3 +1,3 @@ -[eden] -name=autogalaxy -prefix=ag +[eden] +name=autogalaxy +prefix=ag diff --git a/files/citations.bib b/files/citations.bib index c17bec016..d7bc603ab 100644 --- a/files/citations.bib +++ b/files/citations.bib @@ -33,17 +33,6 @@ @article{astropy2 Bdsk-Url-1 = {https://doi.org/10.3847/1538-3881/aabc4f} } -@article{PyLops, -abstract = {Linear operators and optimisation are at the core of many algorithms used in signal and image processing, remote sensing, and inverse problems. For small to medium-scale problems, existing software packages (e.g., MATLAB, Python numpy and scipy) allow for explicitly building dense (or sparse) matrices and performing algebraic operations (e.g., computation of matrix-vector products and manipulation of matrices) with syntax that closely represents their corresponding analytical forms. However, many real application, large-scale operators do not lend themselves to explicit matrix representations, usually forcing practitioners to forego of the convenient linear-algebra syntax available for their explicit-matrix counterparts. PyLops is an open-source Python library providing a flexible and scalable framework for the creation and combination of so-called linear operators, class-based entities that represent matrices and inherit their associated syntax convenience, but do not rely on the creation of explicit matrices. We show that PyLops operators can dramatically reduce the memory load and CPU computations compared to explicit-matrix calculations, while still allowing users to seamlessly use their existing knowledge of compact matrix-based syntax that scales to any problem size because no explicit matrices are required.}, -archivePrefix = {arXiv}, -arxivId = {1907.12349}, -author = {Ravasi, Matteo and Vasconcelos, Ivan}, -eprint = {1907.12349}, -file = {:home/jammy/Documents/Papers/Software/PyLops.pdf:pdf}, -title = {{PyLops -- A Linear-Operator Python Library for large scale optimization}}, -url = {http://arxiv.org/abs/1907.12349}, -year = {2019} -} @article{colossus, abstract = {This paper introduces Colossus, a public, open-source python package for calculations related to cosmology, the large-scale structure (LSS) of matter in the universe, and the properties of dark matter halos. The code is designed to be fast and easy to use, with a coherent, well-documented user interface. The cosmology module implements Friedman-Lemaitre-Robertson-Walker cosmologies including curvature, relativistic species, and different dark energy equations of state, and provides fast computations of the linear matter power spectrum, variance, and correlation function. The LSS module is concerned with the properties of peaks in Gaussian random fields and halos in a statistical sense, including their peak height, peak curvature, halo bias, and mass function. The halo module deals with spherical overdensity radii and masses, density profiles, concentration, and the splashback radius. To facilitate the rapid exploration of these quantities, Colossus implements more than 40 different fitting functions from the literature. I discuss the core routines in detail, with particular emphasis on their accuracy. Colossus is available at bitbucket.org/bdiemer/colossus.}, diff --git a/files/citations.md b/files/citations.md index 3e6588046..68c78b7e9 100644 --- a/files/citations.md +++ b/files/citations.md @@ -18,7 +18,6 @@ This work uses the following software packages: - `NumPy` https://github.com/numpy/numpy [@numpy] - `PyAutoFit` https://github.com/rhayes777/PyAutoFit [@pyautofit] - `PyAutoGalaxy` https://github.com/Jammy2211/PyAutoGalaxy [@Nightingale2018] [@pyautogalaxy] -- `PyLops` https://github.com/equinor/pylops [@pylops] - `PyNUFFT` https://github.com/jyhmiinlin/pynufft [@pynufft] - `PySwarms` https://github.com/ljvmiranda921/pyswarms [@pyswarms] - `Python` https://www.python.org/ [@python] diff --git a/files/citations.tex b/files/citations.tex index cce7006df..b3c11ab2c 100644 --- a/files/citations.tex +++ b/files/citations.tex @@ -50,9 +50,6 @@ \section*{Software Citations} \href{https://github.com/Jammy2211/PyAutoGalaxy}{\textt{PyAutoGalaxy}} \citep{Nightingale2018, pyautogalaxy} -\item -\href{https://github.com/equinor/pylops}{\textt{PyLops}} -\citep{pylops} \item \href{https://github.com/jyhmiinlin/pynufft}{\textt{PyNUFFT}} diff --git a/optional_requirements.txt b/optional_requirements.txt index 8f0a11171..418b74e2f 100644 --- a/optional_requirements.txt +++ b/optional_requirements.txt @@ -1,8 +1,7 @@ -numba -pylops>=1.10.0,<=2.3.1 -pynufft -ultranest==3.6.2 -zeus-mcmc==2.5.4 -getdist==1.4 -#jax>=0.4.13 +numba +pynufft +ultranest==3.6.2 +zeus-mcmc==2.5.4 +getdist==1.4 +#jax>=0.4.13 #jaxlib>=0.4.13 \ No newline at end of file diff --git a/paper/paper.bib b/paper/paper.bib index 7748bc669..5df87d1aa 100644 --- a/paper/paper.bib +++ b/paper/paper.bib @@ -30,16 +30,7 @@ @article{astropy2 Volume = {156}, Year = 2018, Bdsk-Url-1 = {https://doi.org/10.3847/1538-3881/aabc4f}} -@article{PyLops, -archivePrefix = {arXiv}, -arxivId = {1907.12349}, -author = {Ravasi, Matteo and Vasconcelos, Ivan}, -eprint = {1907.12349}, -file = {:home/jammy/Documents/Papers/Software/PyLops.pdf:pdf}, -title = {{PyLops -- A Linear-Operator Python Library for large scale optimization}}, -url = {http://arxiv.org/abs/1907.12349}, -year = {2019} -} + @article{colossus, archivePrefix = {arXiv}, arxivId = {1712.04512}, diff --git a/paper/paper.md b/paper/paper.md index d790aba5b..011da2511 100644 --- a/paper/paper.md +++ b/paper/paper.md @@ -127,7 +127,7 @@ reconstruct the source galaxies of strong gravitational lenses in `PyAutoGalaxy` `PyAutoGalaxy` includes a comprehensive visualization library for the analysis of both direct imaging and interferometer datasets and tools for preprocessing data to formats suitable for galaxy model-fitting. The `astropy` cosmology module handles unit conversions and calculations are optimized using the packages `NumPy` [@numpy], `numba` [@numba], - `PyNUFFT` [@pynufft] and `PyLops` [@PyLops]. +and `PyNUFFT` [@pynufft]. To perform model-fitting, `PyAutoGalaxy` adopts the probabilistic programming language `PyAutoFit` (https://github.com/rhayes777/PyAutoFit). `PyAutoFit` allows users to compose a @@ -172,7 +172,6 @@ taken without a local `PyAutoGalaxy` installation. - `numba` [@numba] - `NumPy` [@numpy] - `PyAutoFit` [@pyautofit] -- `PyLops` [@PyLops] - `PyNUFFT` [@pynufft] - `pyprojroot` (https://github.com/chendaniely/pyprojroot) - `PySwarms` [@pyswarms] diff --git a/test_autogalaxy/analysis/test_preloads.py b/test_autogalaxy/analysis/test_preloads.py deleted file mode 100644 index 284962428..000000000 --- a/test_autogalaxy/analysis/test_preloads.py +++ /dev/null @@ -1,130 +0,0 @@ -import numpy as np -from os import path - -import autofit as af - -import autogalaxy as ag - - -def test__set_blurred_image(): - # Blurred image is all zeros so preloads as zeros - - fit_0 = ag.m.MockFitImaging(blurred_image=np.zeros(2)) - fit_1 = ag.m.MockFitImaging(blurred_image=np.zeros(2)) - - preloads = ag.Preloads(blurred_image=1) - preloads.set_blurred_image(fit_0=fit_0, fit_1=fit_1) - - assert preloads.blurred_image is None - - # Blurred image are different, indicating the model parameters change the grid, so no preloading. - - fit_0 = ag.m.MockFitImaging(blurred_image=np.array([1.0])) - fit_1 = ag.m.MockFitImaging(blurred_image=np.array([2.0])) - - preloads = ag.Preloads(blurred_image=1) - preloads.set_blurred_image(fit_0=fit_0, fit_1=fit_1) - - assert preloads.blurred_image is None - - # Blurred images are the same meaning they are fixed in the model, so do preload. - - fit_0 = ag.m.MockFitImaging(blurred_image=np.array([1.0])) - fit_1 = ag.m.MockFitImaging(blurred_image=np.array([1.0])) - - preloads = ag.Preloads(blurred_image=1) - preloads.set_blurred_image(fit_0=fit_0, fit_1=fit_1) - - assert (preloads.blurred_image == np.array([1.0])).all() - - -def test__info(): - file_path = path.join("{}".format(path.dirname(path.realpath(__file__))), "files") - - file_preloads = path.join(file_path, "preloads.summary") - - preloads = ag.Preloads( - blurred_image=np.zeros(3), - w_tilde=None, - use_w_tilde=False, - image_plane_mesh_grid_pg_list=None, - relocated_grid=None, - mapper_list=None, - operated_mapping_matrix=None, - ) - - af.formatter.output_list_of_strings_to_file( - file=file_preloads, list_of_strings=preloads.info - ) - - results = open(file_preloads) - lines = results.readlines() - - i = 0 - - assert lines[i] == f"W Tilde = False\n" - i += 1 - assert lines[i] == f"Use W Tilde = False\n" - i += 1 - assert lines[i] == f"\n" - i += 1 - assert lines[i] == f"Blurred Image = False\n" - i += 1 - assert lines[i] == f"Mapper = False\n" - i += 1 - assert lines[i] == f"Blurred Mapping Matrix = False\n" - i += 1 - assert lines[i] == f"Inversion Linear Func (Linear Light Profile) Dicts = False\n" - i += 1 - assert lines[i] == f"Curvature Matrix = False\n" - i += 1 - assert lines[i] == f"Curvature Matrix Mapper Diag = False\n" - i += 1 - assert lines[i] == f"Regularization Matrix = False\n" - i += 1 - assert lines[i] == f"Log Det Regularization Matrix Term = False\n" - i += 1 - - preloads = ag.Preloads( - blurred_image=1, - w_tilde=1, - use_w_tilde=True, - image_plane_mesh_grid_pg_list=1, - mapper_list=1, - operated_mapping_matrix=1, - curvature_matrix=1, - regularization_matrix=1, - log_det_regularization_matrix_term=1, - ) - - af.formatter.output_list_of_strings_to_file( - file=file_preloads, list_of_strings=preloads.info - ) - - results = open(file_preloads) - lines = results.readlines() - - i = 0 - - assert lines[i] == f"W Tilde = True\n" - i += 1 - assert lines[i] == f"Use W Tilde = True\n" - i += 1 - assert lines[i] == f"\n" - i += 1 - assert lines[i] == f"Blurred Image = True\n" - i += 1 - assert lines[i] == f"Mapper = True\n" - i += 1 - assert lines[i] == f"Blurred Mapping Matrix = True\n" - i += 1 - assert lines[i] == f"Inversion Linear Func (Linear Light Profile) Dicts = False\n" - i += 1 - assert lines[i] == f"Curvature Matrix = True\n" - i += 1 - assert lines[i] == f"Curvature Matrix Mapper Diag = False\n" - i += 1 - assert lines[i] == f"Regularization Matrix = True\n" - i += 1 - assert lines[i] == f"Log Det Regularization Matrix Term = True\n" - i += 1 diff --git a/test_autogalaxy/config/general.yaml b/test_autogalaxy/config/general.yaml index 2acec5ada..184efbab5 100644 --- a/test_autogalaxy/config/general.yaml +++ b/test_autogalaxy/config/general.yaml @@ -1,44 +1,41 @@ -analysis: - n_cores: 1 - preload_attempts: 250 -fits: - flip_for_ds9: true -grid: - remove_projected_centre: false -inversion: - check_reconstruction: false # If True, the inversion's reconstruction is checked to ensure the solution of a meshs's mapper is not an invalid solution where the values are all the same. - use_positive_only_solver: false # If True, inversion's use a positive-only linear algebra solver by default, which is slower but prevents unphysical negative values in the reconstructed solutuion. - no_regularization_add_to_curvature_diag_value: 1.0e-8 # The default value added to the curvature matrix's diagonal when regularization is not applied to a linear object, which prevents inversion's failing due to the matrix being singular. - positive_only_uses_p_initial: false # If True, the positive-only solver of an inversion's uses an initial guess of the reconstructed data's values as which values should be positive, speeding up the solver. - use_border_relocator: false # If True, by default a pixelization's border is used to relocate all pixels outside its border to the border. -hpc: - hpc_mode: false - iterations_per_update: 5000 -adapt: - adapt_minimum_percent: 0.01 - adapt_noise_limit: 100000000.0 -model: - ignore_prior_limits: true -numba: - cache: true - nopython: true - parallel: false - use_numba: true -output: - force_pickle_overwrite: false - info_whitespace_length: 80 - log_file: output.log - log_level: INFO - log_to_file: false - model_results_decimal_places: 3 - remove_files: false - samples_to_csv: false -pixelization: - voronoi_nn_max_interpolation_neighbors: 300 -structures: - native_binned_only: false # If True, data structures are only stored in their native and binned format. This is used to reduce memory usage in autocti. -test: - check_likelihood_function: false # if True, when a search is resumed the likelihood of a previous sample is recalculated to ensure it is consistent with the previous run. - check_preloads: false - exception_override: true - preloads_check_threshold: 1.0 # If the figure of merit of a fit with and without preloads is greater than this threshold, the check preload test fails and an exception raised for a model-fit. +analysis: + n_cores: 1 +fits: + flip_for_ds9: true +grid: + remove_projected_centre: false +inversion: + check_reconstruction: false # If True, the inversion's reconstruction is checked to ensure the solution of a meshs's mapper is not an invalid solution where the values are all the same. + use_positive_only_solver: false # If True, inversion's use a positive-only linear algebra solver by default, which is slower but prevents unphysical negative values in the reconstructed solutuion. + no_regularization_add_to_curvature_diag_value: 1.0e-8 # The default value added to the curvature matrix's diagonal when regularization is not applied to a linear object, which prevents inversion's failing due to the matrix being singular. + positive_only_uses_p_initial: false # If True, the positive-only solver of an inversion's uses an initial guess of the reconstructed data's values as which values should be positive, speeding up the solver. + use_border_relocator: false # If True, by default a pixelization's border is used to relocate all pixels outside its border to the border. +hpc: + hpc_mode: false + iterations_per_update: 5000 +adapt: + adapt_minimum_percent: 0.01 + adapt_noise_limit: 100000000.0 +model: + ignore_prior_limits: true +numba: + cache: true + nopython: true + parallel: false + use_numba: true +output: + force_pickle_overwrite: false + info_whitespace_length: 80 + log_file: output.log + log_level: INFO + log_to_file: false + model_results_decimal_places: 3 + remove_files: false + samples_to_csv: false +pixelization: + voronoi_nn_max_interpolation_neighbors: 300 +structures: + native_binned_only: false # If True, data structures are only stored in their native and binned format. This is used to reduce memory usage in autocti. +test: + check_likelihood_function: false # if True, when a search is resumed the likelihood of a previous sample is recalculated to ensure it is consistent with the previous run. + exception_override: true \ No newline at end of file diff --git a/test_autogalaxy/config/grids.yaml b/test_autogalaxy/config/grids.yaml deleted file mode 100644 index a779246ac..000000000 --- a/test_autogalaxy/config/grids.yaml +++ /dev/null @@ -1,78 +0,0 @@ -interpolate: - convergence_2d_from: - Isothermal: false - IsothermalSph: true - deflections_yx_2d_from: - Isothermal: false - IsothermalSph: true - image_2d_from: - sersic: false - sersicSph: true - potential_2d_from: - Isothermal: false - IsothermalSph: true -# Certain light and mass profile calculations become ill defined at (0.0, 0.0) or close to this value. This can lead -# to numerical issues in the calculation of the profile, for example a np.nan may arise, crashing the code. - -# To avoid this, we set a minimum value for the radial coordinate of the profile. If the radial coordinate is below -# this value, it is rounded up to this value. This ensures that the profile cannot receive a radial coordinate of 0.0. - -# For example, if an input grid coordinate has a radial coordinate of 1e-12, for most profiles this will be rounded up -# to radial_minimum=1e-08. This is a small enough value that it should not impact the results of the profile calculation. - -radial_minimum: - radial_minimum: - MockGridRadialMinimum: 2.5 - MockIsothermal: 0.0001 - MockIsothermalSph: 0.03 - Chameleon: 0.0001 - ChameleonSph: 0.0001 - DevVaucouleurs: 0.0001 - DevVaucouleursSph: 0.0001 - ExponentialGradient: 0.0001 - ElsonFreeFall: 0.0001 - ElsonFreeFallSph: 0.0001 - Exponential: 0.0001 - ExponentialCore: 0.0001 - ExponentialCoreSph: 0.0001 - ExponentialSph: 0.0001 - ExternalShear: 0.0001 - Gaussian: 0.0001 - GaussianSph: 0.0001 - gNFW: 0.0001 - gNFWMCRLudlow: 0.0001 - gNFWSph: 0.0001 - Isothermal: 0.0001 - IsothermalCore: 0.0001 - IsothermalCoreSph: 0.0001 - IsothermalSph: 0.0001 - MassSheet: 0.0001 - Moffat: 0.0001 - MoffatSph: 0.0001 - NFW: 0.0001 - NFWMCRDuffySph: 0.0001 - NFWMCRLudlow: 0.0001 - NFWMCRLudlowSph: 0.0001 - NFWMCRScatterLudlow: 0.0001 - NFWMCRScatterLudlowSph: 0.0001 - NFWSph: 0.0001 - NFWTruncatedMCRDuffySph: 0.0001 - NFWTruncatedMCRLudlowSph: 0.0001 - NFWTruncatedMCRScatterLudlowSph: 0.0001 - NFWTruncatedSph: 0.0001 - PointMass: 0.0001 - PowerLaw: 0.0001 - PowerLawBroken: 0.0001 - PowerLawBrokenSph: 0.0001 - PowerLawCore: 0.0001 - PowerLawCoreSph: 0.0001 - PowerLawSph: 0.0001 - Sersic: 0.0001 - SersicCore: 0.0001 - SersicCoreSph: 0.0001 - SersicGradient: 0.0001 - SersicSph: 0.0001 - ExponentialGradientSph: 0.0001 - SersicGradientSph: 0.0001 - EllProfile: 0.0001 - SersicAdaptTest: 0.0001 diff --git a/test_autogalaxy/config/lensing.yaml b/test_autogalaxy/config/lensing.yaml index 9d68e82f6..319dc389d 100644 --- a/test_autogalaxy/config/lensing.yaml +++ b/test_autogalaxy/config/lensing.yaml @@ -1,11 +1,4 @@ -general: - calculation_grid: - convergence_threshold: 0.1 - pixels: 81 -grids: - radial_minimum: - radial_minimum: - isothermal: 0.01 - isothermalsph: 0.01 - mockisothermal: 0.01 - mockisothermalsph: 0.01 +general: + calculation_grid: + convergence_threshold: 0.1 + pixels: 81 diff --git a/test_autogalaxy/config/non_linear.yaml b/test_autogalaxy/config/non_linear.yaml index a805c821e..4a6364720 100644 --- a/test_autogalaxy/config/non_linear.yaml +++ b/test_autogalaxy/config/non_linear.yaml @@ -105,3 +105,4 @@ nest: updates: iterations_per_update: 2500 remove_state_files_at_end: true +>>>>>>> cb2f01c19d3b3421c74df3425ffa32cdff82aebc diff --git a/test_autogalaxy/config/notation.yaml b/test_autogalaxy/config/notation.yaml index eaf0f0594..a17a55800 100644 --- a/test_autogalaxy/config/notation.yaml +++ b/test_autogalaxy/config/notation.yaml @@ -1,83 +1,83 @@ -label: - label: - alpha: \alpha - angle_binary: \theta - beta: \beta - break_radius: \theta_{\rm B} - centre_0: y - centre_1: x - coefficient: \lambda - core_radius: C_{\rm r} - core_radius_0: C_{rm r0} - core_radius_1: C_{\rm r1} - effective_radius: R_{\rm eff} - einstein_radius: \theta_{\rm Ein} - ell_comps_0: \epsilon_{\rm 1} - ell_comps_1: \epsilon_{\rm 2} - multipole_comps_0: M_{\rm 1} - multipole_comps_1: M_{\rm 2} - flux: F - gamma: \gamma - gamma_1: \gamma - gamma_2: \gamma - inner_coefficient: \lambda_{\rm 1} - inner_slope: t_{\rm 1} - intensity: I_{\rm b} - kappa: \kappa - kappa_s: \kappa_{\rm s} - log10m_vir: log_{\rm 10}(m_{vir}) - m: m - mass: M - mass_at_200: M_{\rm 200} - mass_ratio: M_{\rm ratio} - mass_to_light_gradient: \Gamma - mass_to_light_ratio: \Psi - mass_to_light_ratio_base: \Psi_{\rm base} - mass_to_light_radius: R_{\rm ref} - noise_factor: \omega_{\rm 1} - noise_power: \omega{\rm 2} - noise_scale: \sigma_{\rm 1} - normalization_scale: n - outer_coefficient: \lambda_{\rm 2} - outer_slope: t_{\rm 2} - overdens: \Delta_{\rm vir} - pixels: N_{\rm pix} - radius_break: R_{\rm b} - redshift: z - redshift_object: z_{\rm obj} - redshift_source: z_{\rm src} - scale_radius: R_{\rm s} - scatter: \sigma - separation: s - sersic_index: n - shape_0: y_{\rm pix} - shape_1: x_{\rm pix} - sigma: \sigma - signal_scale: V - sky_scale: \sigma_{\rm 0} - slope: \gamma - truncation_radius: R_{\rm t} - weight_floor: W_{\rm f} - weight_power: W_{\rm p} - superscript: - externalshear: ext - inputdeflections: defl - pixelization: pix - point: point - redshift: '' - regularization: reg -label_format: - format: - angular_diameter_distance_to_earth: '{:.2f}' - concentration: '{:.2f}' - einstein_mass: '{:.4e}' - einstein_radius: '{:.2f}' - kpc_per_arcsec: '{:.2f}' - luminosity: '{:.4e}' - m: '{:.1f}' - mass: '{:.4e}' - mass_at_truncation_radius: '{:.4e}' - radius: '{:.2f}' - redshift: '{:.2f}' - rho: '{:.2f}' - sersic_luminosity: '{:.4e}' +label: + label: + alpha: \alpha + angle_binary: \theta + beta: \beta + break_radius: \theta_{\rm B} + centre_0: y + centre_1: x + coefficient: \lambda + core_radius: C_{\rm r} + core_radius_0: C_{rm r0} + core_radius_1: C_{\rm r1} + effective_radius: R_{\rm eff} + einstein_radius: \theta_{\rm Ein} + ell_comps_0: \epsilon_{\rm 1} + ell_comps_1: \epsilon_{\rm 2} + multipole_comps_0: M_{\rm 1} + multipole_comps_1: M_{\rm 2} + flux: F + gamma: \gamma + gamma_1: \gamma + gamma_2: \gamma + inner_coefficient: \lambda_{\rm 1} + inner_slope: t_{\rm 1} + intensity: I_{\rm b} + kappa: \kappa + kappa_s: \kappa_{\rm s} + log10m_vir: log_{\rm 10}(m_{vir}) + m: m + mass: M + mass_at_200: M_{\rm 200} + mass_ratio: M_{\rm ratio} + mass_to_light_gradient: \Gamma + mass_to_light_ratio: \Psi + mass_to_light_ratio_base: \Psi_{\rm base} + mass_to_light_radius: R_{\rm ref} + noise_factor: \omega_{\rm 1} + noise_power: \omega{\rm 2} + noise_scale: \sigma_{\rm 1} + normalization_scale: n + outer_coefficient: \lambda_{\rm 2} + outer_slope: t_{\rm 2} + overdens: \Delta_{\rm vir} + pixels: N_{\rm pix} + radius_break: R_{\rm b} + redshift: z + redshift_object: z_{\rm obj} + redshift_source: z_{\rm src} + scale_radius: R_{\rm s} + scatter: \sigma + separation: s + sersic_index: n + shape_0: y_{\rm pix} + shape_1: x_{\rm pix} + sigma: \sigma + signal_scale: V + sky_scale: \sigma_{\rm 0} + slope: \gamma + truncation_radius: R_{\rm t} + weight_floor: W_{\rm f} + weight_power: W_{\rm p} + superscript: + externalshear: ext + inputdeflections: defl + pixelization: pix + point: point + redshift: '' + regularization: reg +label_format: + format: + angular_diameter_distance_to_earth: '{:.2f}' + concentration: '{:.2f}' + einstein_mass: '{:.4e}' + einstein_radius: '{:.2f}' + kpc_per_arcsec: '{:.2f}' + luminosity: '{:.4e}' + m: '{:.1f}' + mass: '{:.4e}' + mass_at_truncation_radius: '{:.4e}' + radius: '{:.2f}' + redshift: '{:.2f}' + rho: '{:.2f}' + sersic_luminosity: '{:.4e}' diff --git a/test_autogalaxy/config/output.yaml b/test_autogalaxy/config/output.yaml index 5cb8812dc..4a44b384b 100644 --- a/test_autogalaxy/config/output.yaml +++ b/test_autogalaxy/config/output.yaml @@ -1,63 +1,63 @@ -# Determines whether files saved by the search are output to the hard-disk. This is true both when saving to the -# directory structure and when saving to database. - -# Files can be listed name: bool where the name is the name of the file without a suffix (e.g. model not model.json) -# and bool is true or false. - -# If a given file is not listed then the default value is used. - -default: true # If true then files which are not explicitly listed here are output anyway. If false then they are not. - -### Samples ### - -# The `samples.csv`file contains every sampled value of every free parameter with its log likelihood and weight. - -# This file is often large, therefore disabling it can significantly reduce hard-disk space use. - -# `samples.csv` is used to perform marginalization, infer model parameter errors and do other analysis of the search -# chains. Even if output of `samples.csv` is disabled, these tasks are still performed by the fit and output to -# the `samples_summary.json` file. However, without a `samples.csv` file these types of tasks cannot be performed -# after the fit is complete, for example via the database. - -samples: true - -# The `samples.csv` file contains every accepted sampled value of every free parameter with its log likelihood and -# weight. For certain searches, the majority of samples have a very low weight, which has no numerical impact on the -# results of the model-fit. However, these samples are still output to the `samples.csv` file, taking up hard-disk space -# and slowing down analysis of the samples (e.g. via the database). - -# The `samples_weight_threshold` below specifies the threshold value of the weight such that samples with a weight -# below this value are not output to the `samples.csv` file. This can be used to reduce the size of the `samples.csv` -# file and speed up analysis of the samples. - -# Note that for many searches (e.g. MCMC) all samples have equal weight, and thus this threshold has no impact and -# there is no simple way to save hard-disk space. However, for nested sampling, the majority of samples have a very -# low weight and this threshold can be used to save hard-disk space. - -# Set value to empty (e.g. delete 1.0e-10 below) to disable this feature. - -samples_weight_threshold: 1.0e-10 - -### Search Internal ### - -# The search internal folder which contains a saved state of the non-linear search, as a .pickle or .dill file. - -# If the entry below is false, the folder is still output during the model-fit, as it is required to resume the fit -# from where it left off. Therefore, settings `false` below does not impact model-fitting checkpointing and resumption. -# Instead, the search internal folder is deleted once the fit is completed. - -# The search internal folder file is often large, therefore deleting it after a fit is complete can significantly -# reduce hard-disk space use. - -# The search internal representation (e.g. what you can load from the output .pickle file) may have additional -# quantities specific to the non-linear search that you are interested in inspecting. Deleting the folder means this -# information is list. - -search_internal: false - -# Other Files: - -covariance: false # `covariance.csv`: The [free parameters x free parameters] covariance matrix. -data: true # `data.json`: The value of every data point in the data. -noise_map: true # `noise_map.json`: The value of every RMS noise map value. - +# Determines whether files saved by the search are output to the hard-disk. This is true both when saving to the +# directory structure and when saving to database. + +# Files can be listed name: bool where the name is the name of the file without a suffix (e.g. model not model.json) +# and bool is true or false. + +# If a given file is not listed then the default value is used. + +default: true # If true then files which are not explicitly listed here are output anyway. If false then they are not. + +### Samples ### + +# The `samples.csv`file contains every sampled value of every free parameter with its log likelihood and weight. + +# This file is often large, therefore disabling it can significantly reduce hard-disk space use. + +# `samples.csv` is used to perform marginalization, infer model parameter errors and do other analysis of the search +# chains. Even if output of `samples.csv` is disabled, these tasks are still performed by the fit and output to +# the `samples_summary.json` file. However, without a `samples.csv` file these types of tasks cannot be performed +# after the fit is complete, for example via the database. + +samples: true + +# The `samples.csv` file contains every accepted sampled value of every free parameter with its log likelihood and +# weight. For certain searches, the majority of samples have a very low weight, which has no numerical impact on the +# results of the model-fit. However, these samples are still output to the `samples.csv` file, taking up hard-disk space +# and slowing down analysis of the samples (e.g. via the database). + +# The `samples_weight_threshold` below specifies the threshold value of the weight such that samples with a weight +# below this value are not output to the `samples.csv` file. This can be used to reduce the size of the `samples.csv` +# file and speed up analysis of the samples. + +# Note that for many searches (e.g. MCMC) all samples have equal weight, and thus this threshold has no impact and +# there is no simple way to save hard-disk space. However, for nested sampling, the majority of samples have a very +# low weight and this threshold can be used to save hard-disk space. + +# Set value to empty (e.g. delete 1.0e-10 below) to disable this feature. + +samples_weight_threshold: 1.0e-10 + +### Search Internal ### + +# The search internal folder which contains a saved state of the non-linear search, as a .pickle or .dill file. + +# If the entry below is false, the folder is still output during the model-fit, as it is required to resume the fit +# from where it left off. Therefore, settings `false` below does not impact model-fitting checkpointing and resumption. +# Instead, the search internal folder is deleted once the fit is completed. + +# The search internal folder file is often large, therefore deleting it after a fit is complete can significantly +# reduce hard-disk space use. + +# The search internal representation (e.g. what you can load from the output .pickle file) may have additional +# quantities specific to the non-linear search that you are interested in inspecting. Deleting the folder means this +# information is list. + +search_internal: false + +# Other Files: + +covariance: false # `covariance.csv`: The [free parameters x free parameters] covariance matrix. +data: true # `data.json`: The value of every data point in the data. +noise_map: true # `noise_map.json`: The value of every RMS noise map value. + diff --git a/test_autogalaxy/config/text.yaml b/test_autogalaxy/config/text.yaml index e5f604ce1..9803defba 100644 --- a/test_autogalaxy/config/text.yaml +++ b/test_autogalaxy/config/text.yaml @@ -1,11 +1,11 @@ -label_format: - format: - mass: '{:.4e}' - mass_value: mass_value - param0: '{:.2f}' - param00: '{:.2f}' - param000: '{:.2f}' - param11: '{:.4f}' - param12: '{:.2e}' - radius: '{:.2f}' - radius_value: radius_value +label_format: + format: + mass: '{:.4e}' + mass_value: mass_value + param0: '{:.2f}' + param00: '{:.2f}' + param000: '{:.2f}' + param11: '{:.4f}' + param12: '{:.2e}' + radius: '{:.2f}' + radius_value: radius_value diff --git a/test_autogalaxy/config/visualize.yaml b/test_autogalaxy/config/visualize.yaml index 53a1f0700..93f4ab426 100644 --- a/test_autogalaxy/config/visualize.yaml +++ b/test_autogalaxy/config/visualize.yaml @@ -8,7 +8,7 @@ include: einstein_radius: true half_light_radius: true include_2d: - border: true + border: false tangential_caustics: false radial_caustics: false tangential_critical_curves: false diff --git a/test_autogalaxy/conftest.py b/test_autogalaxy/conftest.py index 5fb97e1c1..08653cb85 100644 --- a/test_autogalaxy/conftest.py +++ b/test_autogalaxy/conftest.py @@ -135,11 +135,6 @@ def make_mask_2d_7x7(): return fixtures.make_mask_2d_7x7() -@pytest.fixture(name="convolver_7x7") -def make_convolver_7x7(): - return fixtures.make_convolver_7x7() - - @pytest.fixture(name="mask_2d_7x7_1_pix") def make_mask_2d_7x7_1_pix(): return fixtures.make_mask_2d_7x7_1_pix() diff --git a/test_autogalaxy/imaging/test_fit_imaging.py b/test_autogalaxy/imaging/test_fit_imaging.py index 3b3103fc2..f66d300b0 100644 --- a/test_autogalaxy/imaging/test_fit_imaging.py +++ b/test_autogalaxy/imaging/test_fit_imaging.py @@ -239,13 +239,13 @@ def test__galaxy_model_image_dict(masked_imaging_7x7): g0_blurred_image_2d = g0.blurred_image_2d_from( grid=masked_imaging_7x7.grids.lp, blurring_grid=masked_imaging_7x7.grids.blurring, - convolver=masked_imaging_7x7.convolver, + psf=masked_imaging_7x7.psf, ) g1_blurred_image_2d = g1.blurred_image_2d_from( grid=masked_imaging_7x7.grids.lp, blurring_grid=masked_imaging_7x7.grids.blurring, - convolver=masked_imaging_7x7.convolver, + psf=masked_imaging_7x7.psf, ) assert fit.galaxy_model_image_dict[g0] == pytest.approx(g0_blurred_image_2d, 1.0e-4) diff --git a/test_autogalaxy/imaging/test_simulate_and_fit_imaging.py b/test_autogalaxy/imaging/test_simulate_and_fit_imaging.py index e60c00cce..bd4af6ff5 100644 --- a/test_autogalaxy/imaging/test_simulate_and_fit_imaging.py +++ b/test_autogalaxy/imaging/test_simulate_and_fit_imaging.py @@ -202,7 +202,7 @@ def test__simulate_imaging_data_and_fit__linear_light_profiles_agree_with_standa galaxy_image = galaxy.blurred_image_2d_from( grid=masked_dataset.grids.lp, - convolver=masked_dataset.convolver, + psf=masked_dataset.psf, blurring_grid=masked_dataset.grids.blurring, ) diff --git a/test_autogalaxy/operate/test_image.py b/test_autogalaxy/operate/test_image.py index d2fea8ca9..cd0917de9 100644 --- a/test_autogalaxy/operate/test_image.py +++ b/test_autogalaxy/operate/test_image.py @@ -9,14 +9,16 @@ def test__blurred_image_2d_from( - grid_2d_7x7, blurring_grid_2d_7x7, psf_3x3, convolver_7x7 + grid_2d_7x7, + blurring_grid_2d_7x7, + psf_3x3, ): lp = ag.lp.Sersic(intensity=1.0) image_2d = lp.image_2d_from(grid=grid_2d_7x7) blurring_image_2d = lp.image_2d_from(grid=blurring_grid_2d_7x7) - blurred_image_2d_manual = convolver_7x7.convolve_image( + blurred_image_2d_manual = psf_3x3.convolve_image( image=image_2d, blurring_image=blurring_image_2d ) @@ -29,9 +31,7 @@ def test__blurred_image_2d_from( ) lp_blurred_image_2d = lp.blurred_image_2d_from( - grid=grid_2d_7x7, - blurring_grid=blurring_grid_2d_7x7, - convolver=convolver_7x7, + grid=grid_2d_7x7, blurring_grid=blurring_grid_2d_7x7, psf=psf_3x3 ) assert blurred_image_2d_manual.native == pytest.approx( @@ -55,7 +55,7 @@ def test__blurred_image_2d_from( grid=grid_2d_7x7, psf=psf_3x3, blurring_grid=blurring_grid_2d_7x7 ) - blurred_image_2d_manual_not_operated = convolver_7x7.convolve_image( + blurred_image_2d_manual_not_operated = psf_3x3.convolve_image( image=image_2d_not_operated, blurring_image=blurring_image_2d_not_operated, ) @@ -167,7 +167,9 @@ def test__visibilities_from_grid_and_transformer(grid_2d_7x7, transformer_7x7_7) def test__blurred_image_2d_list_from( - grid_2d_7x7, blurring_grid_2d_7x7, psf_3x3, convolver_7x7 + grid_2d_7x7, + blurring_grid_2d_7x7, + psf_3x3, ): lp_0 = ag.lp.Gaussian(intensity=1.0) lp_1 = ag.lp.Gaussian(intensity=2.0) @@ -194,9 +196,7 @@ def test__blurred_image_2d_list_from( ) blurred_image_2d_list = gal.blurred_image_2d_list_from( - grid=grid_2d_7x7, - blurring_grid=blurring_grid_2d_7x7, - convolver=convolver_7x7, + grid=grid_2d_7x7, blurring_grid=blurring_grid_2d_7x7, psf=psf_3x3 ) assert blurred_image_2d_list[0].native == pytest.approx( @@ -224,9 +224,7 @@ def test__blurred_image_2d_list_from( ) blurred_image_2d_list = gal.blurred_image_2d_list_from( - grid=grid_2d_7x7, - blurring_grid=blurring_grid_2d_7x7, - convolver=convolver_7x7, + grid=grid_2d_7x7, blurring_grid=blurring_grid_2d_7x7, psf=psf_3x3 ) assert blurred_image_2d_list[0].native == pytest.approx( @@ -296,9 +294,7 @@ def test__visibilities_list_from(grid_2d_7x7, transformer_7x7_7): assert (lp_1_visibilities == visibilities_list[1]).all() -def test__galaxy_blurred_image_2d_dict_from( - grid_2d_7x7, blurring_grid_2d_7x7, convolver_7x7 -): +def test__galaxy_blurred_image_2d_dict_from(grid_2d_7x7, blurring_grid_2d_7x7, psf_3x3): lp_0 = ag.lp.Sersic(intensity=1.0) g0 = ag.Galaxy(redshift=0.5, light_profile=lp_0) @@ -312,13 +308,13 @@ def test__galaxy_blurred_image_2d_dict_from( blurred_image_2d_list = galaxies.blurred_image_2d_list_from( grid=grid_2d_7x7, - convolver=convolver_7x7, + psf=psf_3x3, blurring_grid=blurring_grid_2d_7x7, ) blurred_image_dict = galaxies.galaxy_blurred_image_2d_dict_from( grid=grid_2d_7x7, - convolver=convolver_7x7, + psf=psf_3x3, blurring_grid=blurring_grid_2d_7x7, ) @@ -329,7 +325,7 @@ def test__galaxy_blurred_image_2d_dict_from( image_2d = lp_0.image_2d_from(grid=grid_2d_7x7) blurring_image_2d = lp_0.image_2d_from(grid=blurring_grid_2d_7x7) - image_2d_convolved = convolver_7x7.convolve_image( + image_2d_convolved = psf_3x3.convolve_image( image=image_2d, blurring_image=blurring_image_2d ) diff --git a/test_autogalaxy/profiles/files/config/grids/radial_minimum.ini b/test_autogalaxy/profiles/files/config/grids/radial_minimum.ini deleted file mode 100644 index 589fba3d9..000000000 --- a/test_autogalaxy/profiles/files/config/grids/radial_minimum.ini +++ /dev/null @@ -1,32 +0,0 @@ -[radial_minimum] -EllProfile=1.0 -MockGridRadialMinimum=2.5 -IsothermalSph=1.0 -SersicSph=1.0 -Sersic=1.0 -ExternalShear=1.0 -Gaussian=1.0 -Isothermal=1.0 -Exponential=1.0 -SersicCore=1.0 -SersicCoreSph=1.0 -DevVaucouleurs=1.0 -DevVaucouleursSph=1.0 -ExponentialSph=1.0 -GaussianSph=1.0 -MassSheet=1.0 -SersicGradientSph=1.0 -SersicGradient=1.0 -gNFWSph=1.0 -EllMassProfile=1.0 -PowerLawCore=1.0 -PowerLawCoreSph=1.0 -PowerLaw=1.0 -PowerLawSph=1.0 -IsothermalCore=1.0 -IsothermalCoreSph=1.0 -gNFW=1.0 -NFWTruncatedSph=1.0 -NFW=1.0 -NFWSph=1.0 -PointMass=1.0 \ No newline at end of file diff --git a/test_autogalaxy/profiles/light/linear/test_abstract.py b/test_autogalaxy/profiles/light/linear/test_abstract.py index f8ca3ad0e..53ae0c6ee 100644 --- a/test_autogalaxy/profiles/light/linear/test_abstract.py +++ b/test_autogalaxy/profiles/light/linear/test_abstract.py @@ -9,14 +9,14 @@ ) -def test__mapping_matrix_from(grid_2d_7x7, blurring_grid_2d_7x7, convolver_7x7): +def test__mapping_matrix_from(grid_2d_7x7, blurring_grid_2d_7x7, psf_3x3): lp_0 = ag.lp_linear.Sersic(effective_radius=1.0) lp_1 = ag.lp_linear.Sersic(effective_radius=2.0) lp_linear_obj_func_list = LightProfileLinearObjFuncList( grid=grid_2d_7x7, blurring_grid=blurring_grid_2d_7x7, - convolver=convolver_7x7, + psf=psf_3x3, light_profile_list=[lp_0, lp_1], ) @@ -33,15 +33,11 @@ def test__mapping_matrix_from(grid_2d_7x7, blurring_grid_2d_7x7, convolver_7x7): ) lp_0_blurred_image = lp_0.blurred_image_2d_from( - grid=grid_2d_7x7, - blurring_grid=blurring_grid_2d_7x7, - convolver=convolver_7x7, + grid=grid_2d_7x7, blurring_grid=blurring_grid_2d_7x7, psf=psf_3x3 ) lp_1_blurred_image = lp_1.blurred_image_2d_from( - grid=grid_2d_7x7, - blurring_grid=blurring_grid_2d_7x7, - convolver=convolver_7x7, + grid=grid_2d_7x7, blurring_grid=blurring_grid_2d_7x7, psf=psf_3x3 ) assert lp_linear_obj_func_list.operated_mapping_matrix_override[ diff --git a/test_autogalaxy/profiles/test_dict.py b/test_autogalaxy/profiles/test_dict.py index cf55fc14d..53b4fad06 100644 --- a/test_autogalaxy/profiles/test_dict.py +++ b/test_autogalaxy/profiles/test_dict.py @@ -1,34 +1,34 @@ -import pytest -from autoconf.dictable import to_dict, from_dict - -import autogalaxy as ag -from autogalaxy.profiles.geometry_profiles import GeometryProfile - - -@pytest.fixture(name="ell_sersic") -def make_ell_sersic(): - return ag.mp.Sersic() - - -@pytest.fixture(name="ell_sersic_dict") -def make_ell_sersic_dict(): - return { - "type": "instance", - "class_path": "autogalaxy.profiles.mass.stellar.sersic.Sersic", - "arguments": { - "centre": {"type": "tuple", "values": [0.0, 0.0]}, - "ell_comps": {"type": "tuple", "values": [0.0, 0.0]}, - "intensity": 0.1, - "effective_radius": 0.6, - "sersic_index": 0.6, - "mass_to_light_ratio": 1.0, - }, - } - - -def test__to_dict(ell_sersic, ell_sersic_dict): - assert to_dict(ell_sersic) == ell_sersic_dict - - -def test__from_dict(ell_sersic, ell_sersic_dict): - assert ell_sersic == from_dict(ell_sersic_dict) +import pytest +from autoconf.dictable import to_dict, from_dict + +import autogalaxy as ag +from autogalaxy.profiles.geometry_profiles import GeometryProfile + + +@pytest.fixture(name="ell_sersic") +def make_ell_sersic(): + return ag.mp.Sersic() + + +@pytest.fixture(name="ell_sersic_dict") +def make_ell_sersic_dict(): + return { + "type": "instance", + "class_path": "autogalaxy.profiles.mass.stellar.sersic.Sersic", + "arguments": { + "centre": {"type": "tuple", "values": [0.0, 0.0]}, + "ell_comps": {"type": "tuple", "values": [0.0, 0.0]}, + "intensity": 0.1, + "effective_radius": 0.6, + "sersic_index": 0.6, + "mass_to_light_ratio": 1.0, + }, + } + + +def test__to_dict(ell_sersic, ell_sersic_dict): + assert to_dict(ell_sersic) == ell_sersic_dict + + +def test__from_dict(ell_sersic, ell_sersic_dict): + assert ell_sersic == from_dict(ell_sersic_dict) diff --git a/test_autogalaxy/test_regression.py b/test_autogalaxy/test_regression.py index 2f4bb5c54..a3466f95e 100644 --- a/test_autogalaxy/test_regression.py +++ b/test_autogalaxy/test_regression.py @@ -1,76 +1,76 @@ -import pytest - -from autogalaxy import Galaxy -from autogalaxy.abstract_fit import AbstractFitInversion -import autofit as af -import autoarray as aa -from autogalaxy.profiles.light.linear import LightProfileLinear, Sersic - - -class FitInversion(AbstractFitInversion): - def __init__( - self, model_obj, settings_inversion: aa.SettingsInversion, light_profiles - ): - super().__init__(model_obj=model_obj, settings_inversion=settings_inversion) - self.light_profiles = light_profiles - - @property - def linear_light_profile_intensity_dict(self): - return {light_profile: 1.0 for light_profile in self.light_profiles} - - -@pytest.fixture(name="light_profile") -def make_light_profile(): - return Sersic() - - -def test_no_modify_state(light_profile): - model_obj = af.ModelInstance( - { - "galaxies": af.ModelInstance( - { - "galaxy": Galaxy( - redshift=0.5, - light_profile=light_profile, - ) - } - ) - } - ) - - fit_inversion = FitInversion( - model_obj=model_obj, - settings_inversion=aa.SettingsInversion(use_linear_operators=True), - light_profiles=[light_profile], - ) - result = fit_inversion.model_obj_linear_light_profiles_to_light_profiles - - assert result.galaxies.galaxy.light_profile is not light_profile - assert model_obj.galaxies.galaxy.light_profile is light_profile - - -@pytest.fixture(name="path") -def make_path(): - return "galaxies", 0, "light_profile" - - -@pytest.fixture(name="model_obj") -def make_model_obj(light_profile): - return af.ModelInstance( - { - "galaxies": [ - Galaxy( - redshift=0.5, - light_profile=light_profile, - ) - ] - } - ) - - -def test_list_galaxies(model_obj, path): - assert model_obj.path_instance_tuples_for_class((LightProfileLinear,))[0][0] == path - - -def test_object_from_path(model_obj, path, light_profile): - assert model_obj.object_for_path(path) == light_profile +import pytest + +from autogalaxy import Galaxy +from autogalaxy.abstract_fit import AbstractFitInversion +import autofit as af +import autoarray as aa +from autogalaxy.profiles.light.linear import LightProfileLinear, Sersic + + +class FitInversion(AbstractFitInversion): + def __init__( + self, model_obj, settings_inversion: aa.SettingsInversion, light_profiles + ): + super().__init__(model_obj=model_obj, settings_inversion=settings_inversion) + self.light_profiles = light_profiles + + @property + def linear_light_profile_intensity_dict(self): + return {light_profile: 1.0 for light_profile in self.light_profiles} + + +@pytest.fixture(name="light_profile") +def make_light_profile(): + return Sersic() + + +def test_no_modify_state(light_profile): + model_obj = af.ModelInstance( + { + "galaxies": af.ModelInstance( + { + "galaxy": Galaxy( + redshift=0.5, + light_profile=light_profile, + ) + } + ) + } + ) + + fit_inversion = FitInversion( + model_obj=model_obj, + settings_inversion=aa.SettingsInversion(use_linear_operators=True), + light_profiles=[light_profile], + ) + result = fit_inversion.model_obj_linear_light_profiles_to_light_profiles + + assert result.galaxies.galaxy.light_profile is not light_profile + assert model_obj.galaxies.galaxy.light_profile is light_profile + + +@pytest.fixture(name="path") +def make_path(): + return "galaxies", 0, "light_profile" + + +@pytest.fixture(name="model_obj") +def make_model_obj(light_profile): + return af.ModelInstance( + { + "galaxies": [ + Galaxy( + redshift=0.5, + light_profile=light_profile, + ) + ] + } + ) + + +def test_list_galaxies(model_obj, path): + assert model_obj.path_instance_tuples_for_class((LightProfileLinear,))[0][0] == path + + +def test_object_from_path(model_obj, path, light_profile): + assert model_obj.object_for_path(path) == light_profile