diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index eb33428c5..ccdd8205f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,99 +1,99 @@ -name: Tests - -on: [push, pull_request] - -jobs: - unittest: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.9, '3.10', '3.11', '3.12'] - steps: - - name: Checkout PyAutoConf - uses: actions/checkout@v2 - with: - repository: rhayes777/PyAutoConf - path: PyAutoConf - - name: Checkout PyAutoFit - uses: actions/checkout@v2 - with: - repository: rhayes777/PyAutoFit - path: PyAutoFit - - name: Checkout PyAutoArray - uses: actions/checkout@v2 - with: - repository: Jammy2211/PyAutoArray - path: PyAutoArray - - name: Checkout PyAutoGalaxy - uses: actions/checkout@v2 - with: - repository: Jammy2211/PyAutoGalaxy - path: PyAutoGalaxy - - name: Checkout PyAutoLens - uses: actions/checkout@v2 - with: - path: PyAutoLens - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Extract branch name - shell: bash - run: | - cd PyAutoLens - echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - id: extract_branch - - name: Change to same branch if exists in deps - shell: bash - run: | - export PACKAGES=("PyAutoConf" "PyAutoArray" "PyAutoFit" "PyAutoGalaxy") - export BRANCH="${{ steps.extract_branch.outputs.branch }}" - for PACKAGE in ${PACKAGES[@]}; do - pushd $PACKAGE - export existed_in_remote=$(git ls-remote --heads origin ${BRANCH}) - - if [[ -z ${existed_in_remote} ]]; then - echo "Branch $BRANCH did not exist in $PACKAGE" - else - echo "Branch $BRANCH did exist in $PACKAGE" - git fetch - git checkout $BRANCH - fi - popd - done - - name: Install dependencies - run: | - pip3 install --upgrade pip - pip3 install setuptools - pip3 install wheel - pip3 install pytest coverage pytest-cov - pip3 install -r PyAutoConf/requirements.txt - pip3 install -r PyAutoFit/requirements.txt - pip3 install -r PyAutoArray/requirements.txt - pip3 install -r PyAutoArray/optional_requirements.txt - pip3 install -r PyAutoGalaxy/requirements.txt - pip3 install -r PyAutoGalaxy/optional_requirements.txt - pip3 install -r PyAutoLens/requirements.txt - pip3 install -r PyAutoLens/optional_requirements.txt - - name: Run tests - run: | - export ROOT_DIR=`pwd` - export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoConf - export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoFit - export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoArray - export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoGalaxy - export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoLens - pushd PyAutoLens - pytest --cov autolens --cov-report xml:coverage.xml - - name: Slack send - if: ${{ failure() }} - id: slack - uses: slackapi/slack-github-action@v1.21.0 - env: - SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} - with: - channel-id: C03S98FEDK2 - payload: | - { - "text": "${{ github.repository }}/${{ github.ref_name }} (Python ${{ matrix.python-version }}) build result: ${{ job.status }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" - } +name: Tests + +on: [push, pull_request] + +jobs: + unittest: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.9, '3.10', '3.11', '3.12'] + steps: + - name: Checkout PyAutoConf + uses: actions/checkout@v2 + with: + repository: rhayes777/PyAutoConf + path: PyAutoConf + - name: Checkout PyAutoFit + uses: actions/checkout@v2 + with: + repository: rhayes777/PyAutoFit + path: PyAutoFit + - name: Checkout PyAutoArray + uses: actions/checkout@v2 + with: + repository: Jammy2211/PyAutoArray + path: PyAutoArray + - name: Checkout PyAutoGalaxy + uses: actions/checkout@v2 + with: + repository: Jammy2211/PyAutoGalaxy + path: PyAutoGalaxy + - name: Checkout PyAutoLens + uses: actions/checkout@v2 + with: + path: PyAutoLens + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Extract branch name + shell: bash + run: | + cd PyAutoLens + echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" + id: extract_branch + - name: Change to same branch if exists in deps + shell: bash + run: | + export PACKAGES=("PyAutoConf" "PyAutoArray" "PyAutoFit" "PyAutoGalaxy") + export BRANCH="${{ steps.extract_branch.outputs.branch }}" + for PACKAGE in ${PACKAGES[@]}; do + pushd $PACKAGE + export existed_in_remote=$(git ls-remote --heads origin ${BRANCH}) + + if [[ -z ${existed_in_remote} ]]; then + echo "Branch $BRANCH did not exist in $PACKAGE" + else + echo "Branch $BRANCH did exist in $PACKAGE" + git fetch + git checkout $BRANCH + fi + popd + done + - name: Install dependencies + run: | + pip3 install --upgrade pip + pip3 install setuptools + pip3 install wheel + pip3 install pytest coverage pytest-cov + pip3 install -r PyAutoConf/requirements.txt + pip3 install -r PyAutoFit/requirements.txt + pip3 install -r PyAutoArray/requirements.txt + pip3 install -r PyAutoArray/optional_requirements.txt + pip3 install -r PyAutoGalaxy/requirements.txt + pip3 install -r PyAutoGalaxy/optional_requirements.txt + pip3 install -r PyAutoLens/requirements.txt + pip3 install -r PyAutoLens/optional_requirements.txt + - name: Run tests + run: | + export ROOT_DIR=`pwd` + export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoConf + export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoFit + export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoArray + export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoGalaxy + export PYTHONPATH=$PYTHONPATH:$ROOT_DIR/PyAutoLens + pushd PyAutoLens + pytest --cov autolens --cov-report xml:coverage.xml + - name: Slack send + if: ${{ failure() }} + id: slack + uses: slackapi/slack-github-action@v1.21.0 + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} + with: + channel-id: C03S98FEDK2 + payload: | + { + "text": "${{ github.repository }}/${{ github.ref_name }} (Python ${{ matrix.python-version }}) build result: ${{ job.status }}\n${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + } diff --git a/autolens/__init__.py b/autolens/__init__.py index f39805f9b..004171990 100644 --- a/autolens/__init__.py +++ b/autolens/__init__.py @@ -88,7 +88,6 @@ from .lens.to_inversion import TracerToInversion from .analysis.positions import PositionsLHResample from .analysis.positions import PositionsLHPenalty -from .analysis.preloads import Preloads from .imaging.simulator import SimulatorImaging from .imaging.fit_imaging import FitImaging from .imaging.model.analysis import AnalysisImaging diff --git a/autolens/aggregator/fit_imaging.py b/autolens/aggregator/fit_imaging.py index f37c6208b..b750b12ef 100644 --- a/autolens/aggregator/fit_imaging.py +++ b/autolens/aggregator/fit_imaging.py @@ -4,7 +4,6 @@ import autoarray as aa from autolens.imaging.fit_imaging import FitImaging -from autolens.analysis.preloads import Preloads from autogalaxy.aggregator.imaging.imaging import _imaging_from from autogalaxy.aggregator.dataset_model import _dataset_model_from @@ -17,7 +16,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` object from a `PyAutoFit` sqlite database `Fit` object. @@ -49,10 +47,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. """ dataset_list = _imaging_from(fit=fit) @@ -65,25 +59,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, tracer, dataset_model, adapt_images, mesh_grids_of_planes in zip( + for dataset, tracer, dataset_model, adapt_images in zip( dataset_list, tracer_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( @@ -92,7 +75,6 @@ def _fit_imaging_from( dataset_model=dataset_model, adapt_images=adapt_images, settings_inversion=settings_inversion, - preloads=preloads, ) ) @@ -104,7 +86,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 @@ -146,7 +127,6 @@ def __init__( 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 @@ -168,5 +148,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/autolens/aggregator/fit_interferometer.py b/autolens/aggregator/fit_interferometer.py index a9aa77615..50c953c42 100644 --- a/autolens/aggregator/fit_interferometer.py +++ b/autolens/aggregator/fit_interferometer.py @@ -7,7 +7,6 @@ from autogalaxy.aggregator.dataset_model import _dataset_model_from from autolens.interferometer.fit_interferometer import FitInterferometer -from autolens.analysis.preloads import Preloads from autogalaxy.aggregator import agg_util from autolens.aggregator.tracer import _tracer_from @@ -18,7 +17,6 @@ def _fit_interferometer_from( instance: Optional[af.ModelInstance] = None, real_space_mask: Optional[aa.Mask2D] = None, settings_inversion: aa.SettingsInversion = None, - use_preloaded_grid: bool = True, ) -> List[FitInterferometer]: """ Returns a list of `FitInterferometer` objects from a `PyAutoFit` sqlite database `Fit` object. @@ -51,10 +49,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. """ dataset_list = _interferometer_from( fit=fit, @@ -67,25 +61,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, tracer, dataset_model, adapt_images, mesh_grids_of_planes in zip( + for dataset, tracer, dataset_model, adapt_images in zip( dataset_list, tracer_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( @@ -94,7 +77,6 @@ def _fit_interferometer_from( dataset_model=dataset_model, adapt_images=adapt_images, settings_inversion=settings_inversion, - preloads=preloads, ) ) @@ -106,7 +88,6 @@ def __init__( self, aggregator: af.Aggregator, settings_inversion: Optional[aa.SettingsInversion] = None, - use_preloaded_grid: bool = True, real_space_mask: Optional[aa.Mask2D] = None, ): """ @@ -145,7 +126,6 @@ def __init__( super().__init__(aggregator=aggregator) self.settings_inversion = settings_inversion - self.use_preloaded_grid = use_preloaded_grid self.real_space_mask = real_space_mask def object_via_gen_from( @@ -168,5 +148,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/autolens/aggregator/subhalo.py b/autolens/aggregator/subhalo.py index 62ebe03f2..a8bd5518f 100644 --- a/autolens/aggregator/subhalo.py +++ b/autolens/aggregator/subhalo.py @@ -11,7 +11,6 @@ def __init__( self, aggregator_grid_search: af.GridSearchAggregator, settings_inversion: Optional[aa.SettingsInversion] = None, - use_preloaded_grid: bool = True, ): """ Wraps a PyAutoFit aggregator in order to create generators of fits to imaging data, corresponding to the @@ -20,7 +19,6 @@ def __init__( self.aggregator_grid_search = aggregator_grid_search self.settings_inversion = settings_inversion - self.use_preloaded_grid = use_preloaded_grid if len(aggregator_grid_search) == 0: raise exc.AggregatorException( diff --git a/autolens/analysis/analysis/dataset.py b/autolens/analysis/analysis/dataset.py index afcccd8b4..68e4b9535 100644 --- a/autolens/analysis/analysis/dataset.py +++ b/autolens/analysis/analysis/dataset.py @@ -13,8 +13,6 @@ from autolens.analysis.analysis.lens import AnalysisLens from autolens.analysis.result import ResultDataset -from autolens.analysis.maker import FitMaker -from autolens.analysis.preloads import Preloads from autolens.analysis.positions import PositionsLHResample from autolens.analysis.positions import PositionsLHPenalty @@ -84,8 +82,6 @@ def __init__( cosmology=cosmology, ) - self.preloads = self.preloads_cls() - self.raise_inversion_positions_likelihood_exception = ( raise_inversion_positions_likelihood_exception ) @@ -147,14 +143,6 @@ def raise_exceptions(self, model): """ ) - @property - def preloads_cls(self): - return Preloads - - @property - def fit_maker_cls(self): - return FitMaker - def save_results(self, paths: af.DirectoryPaths, result: ResultDataset): """ At the end of a model-fit, this routine saves attributes of the `Analysis` object to the `files` @@ -179,20 +167,3 @@ def save_results(self, paths: af.DirectoryPaths, result: ResultDataset): ) except AttributeError: pass - - image_mesh_list = [] - - for galaxy in result.instance.galaxies: - pixelization_list = galaxy.cls_list_from(cls=aa.Pixelization) - - for pixelization in pixelization_list: - if pixelization is not None: - image_mesh_list.append(pixelization.image_mesh) - - if len(image_mesh_list) > 0: - paths.save_json( - name="preload_mesh_grids_of_planes", - object_dict=to_dict( - result.max_log_likelihood_fit.tracer_to_inversion.image_plane_mesh_grid_pg_list - ), - ) diff --git a/autolens/analysis/maker.py b/autolens/analysis/maker.py deleted file mode 100644 index 737e504b6..000000000 --- a/autolens/analysis/maker.py +++ /dev/null @@ -1,9 +0,0 @@ -import autogalaxy as ag - -from autolens.analysis.preloads import Preloads - - -class FitMaker(ag.FitMaker): - @property - def preloads_cls(self): - return Preloads diff --git a/autolens/analysis/preloads.py b/autolens/analysis/preloads.py index 09a4fd295..e69de29bb 100644 --- a/autolens/analysis/preloads.py +++ b/autolens/analysis/preloads.py @@ -1,274 +0,0 @@ -import logging -import numpy as np -from typing import Dict, Optional, List - -import autoarray as aa -import autogalaxy as ag - -logger = logging.getLogger(__name__) - -logger.setLevel(level="INFO") - - -class Preloads(ag.Preloads): - def __init__( - self, - w_tilde: Optional[aa.WTildeImaging] = None, - use_w_tilde: Optional[bool] = None, - blurred_image: Optional[aa.Array2D] = None, - traced_grids_of_planes_for_inversion: Optional[aa.Grid2D] = 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, ag.Galaxy]] = None, - operated_mapping_matrix: Optional[np.ndarray] = None, - linear_func_operated_mapping_matrix_dict=None, - data_linear_func_matrix_dict=None, - mapper_operated_mapping_matrix_dict=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 throughout 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 - ------- - Preloads - 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, - blurred_image=blurred_image, - relocated_grid=relocated_grid, - image_plane_mesh_grid_pg_list=image_plane_mesh_grid_pg_list, - mapper_list=mapper_list, - mapper_galaxy_dict=mapper_galaxy_dict, - operated_mapping_matrix=operated_mapping_matrix, - 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, - 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.traced_grids_of_planes_for_inversion = traced_grids_of_planes_for_inversion - 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_traced_grids_of_planes_for_inversion(fit_0=fit_0, fit_1=fit_1) - preloads.set_image_plane_mesh_grid_pg_list(fit_0=fit_0, fit_1=fit_1) - preloads.set_relocated_grid(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.tracer_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_traced_grids_of_planes_for_inversion(self, fit_0, fit_1): - """ - If the `MassProfiles`'s in a model are fixed their deflection angles and therefore corresponding traced grids - do not change during the model-fit and can therefore be preloaded. - - This function compares the traced grids of two fit's corresponding to two model instances, and preloads the - traced grids if the grids of both fits are the same. This preloaded grid is only used when constructing an - inversion, because the `blurred_image` preload accounts for light profiles. - - The preload is typically used in adapt searches, where the mass model is fixed and the adapt-parameters are - varied. - - 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.traced_grids_of_planes_for_inversion = None - - traced_grids_of_planes_0 = fit_0.tracer.traced_grid_2d_list_from( - grid=fit_0.grids.pixelization - ) - - traced_grids_of_planes_1 = fit_1.tracer.traced_grid_2d_list_from( - grid=fit_0.grids.pixelization - ) - - if traced_grids_of_planes_0[-1] is not None: - if ( - traced_grids_of_planes_0[-1].shape[0] - == traced_grids_of_planes_1[-1].shape[0] - ): - if ( - np.max( - abs(traced_grids_of_planes_0[-1] - traced_grids_of_planes_1[-1]) - ) - < 1e-8 - ): - self.traced_grids_of_planes_for_inversion = traced_grids_of_planes_0 - - logger.info( - "PRELOADS - Traced grid of planes (for inversion) preloaded for this model-fit." - ) - - def set_image_plane_mesh_grid_pg_list(self, fit_0, fit_1): - """ - If the `Pixelization`'s in a model are fixed their image-plane sparse grid (which defines the set of pixels - that are ray-traced to construct the source-plane pixelization) do not change during the model=fit and - can therefore be preloaded. - - This function compares the image plane sparse grid of two fit's corresponding to two model instances, and p - reloads the grid if the grids of both fits are the same. - - The preload is typically used throughout search chaining pipelines which use inversions, as it is common to - for the pixelization's parameters to only vary in the adapt-searches. - - 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.image_plane_mesh_grid_pg_list = None - - image_plane_mesh_grid_pg_list_0 = ( - fit_0.tracer_to_inversion.image_plane_mesh_grid_pg_list - ) - - image_plane_mesh_grid_pg_list_1 = ( - fit_1.tracer_to_inversion.image_plane_mesh_grid_pg_list - ) - - if image_plane_mesh_grid_pg_list_0[-1] is not None: - if image_plane_mesh_grid_pg_list_0[-1][0] is not None: - if ( - image_plane_mesh_grid_pg_list_0[-1][0].shape[0] - == image_plane_mesh_grid_pg_list_1[-1][0].shape[0] - ): - if ( - np.max( - abs( - image_plane_mesh_grid_pg_list_0[-1][0] - - image_plane_mesh_grid_pg_list_1[-1][0] - ) - ) - < 1e-8 - ): - self.image_plane_mesh_grid_pg_list = ( - image_plane_mesh_grid_pg_list_0 - ) - - logger.info( - "PRELOADS - Sparse image-plane grids of planes is preloaded for this model-fit." - ) - - @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"Traced Grids of Planes (For LEq) = {self.traced_grids_of_planes_for_inversion is not None}\n" - ] - line += [ - f"Sparse Image-Plane Grids of Planes = {self.image_plane_mesh_grid_pg_list is not None}\n" - ] - line += [f"Relocated Grid = {self.relocated_grid is not None}\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/autolens/config/general.yaml b/autolens/config/general.yaml index 32229bf70..75e85a7dd 100644 --- a/autolens/config/general.yaml +++ b/autolens/config/general.yaml @@ -1,4 +1,4 @@ -output: - fit_dill: false -test: - disable_positions_lh_inversion_check: false +output: + fit_dill: false +test: + disable_positions_lh_inversion_check: false diff --git a/autolens/config/non_linear.yaml b/autolens/config/non_linear.yaml index 334c3448e..2ed0f9508 100644 --- a/autolens/config/non_linear.yaml +++ b/autolens/config/non_linear.yaml @@ -1,66 +1,66 @@ -nest: - DynestyDynamic: - initialize: - method: prior - parallel: - force_x1_cpu: false - number_of_cores: 1 - printing: - silence: false - run: - dlogz_init: 0.01 - logl_max_init: .inf - maxcall: null - maxcall_init: null - maxiter: null - maxiter_init: null - n_effective: .inf - n_effective_init: .inf - nlive_init: 500 - search: - bootstrap: null - bound: multi - enlarge: null - facc: 0.2 - first_update: null - fmove: 0.9 - max_move: 100 - sample: rwalk - slices: 5 - update_interval: null - walks: 5 - updates: - iterations_per_update: 2500 - remove_state_files_at_end: true - DynestyStatic: - initialize: - method: prior - parallel: - number_of_cores: 1 - printing: - silence: false - run: - dlogz: null - logl_max: .inf - maxcall: null - maxiter: null - n_effective: null - search: - bootstrap: null - bound: multi - enlarge: null - facc: 0.2 - first_update: null - fmove: 0.9 - max_move: 100 - nlive: 50 - sample: rwalk - slices: 5 - update_interval: null - walks: 5 - updates: - iterations_per_update: 5000 - log_every_update: 1 - model_results_every_update: 1 - remove_state_files_at_end: true - visualize_every_update: 1 +nest: + DynestyDynamic: + initialize: + method: prior + parallel: + force_x1_cpu: false + number_of_cores: 1 + printing: + silence: false + run: + dlogz_init: 0.01 + logl_max_init: .inf + maxcall: null + maxcall_init: null + maxiter: null + maxiter_init: null + n_effective: .inf + n_effective_init: .inf + nlive_init: 500 + search: + bootstrap: null + bound: multi + enlarge: null + facc: 0.2 + first_update: null + fmove: 0.9 + max_move: 100 + sample: rwalk + slices: 5 + update_interval: null + walks: 5 + updates: + iterations_per_update: 2500 + remove_state_files_at_end: true + DynestyStatic: + initialize: + method: prior + parallel: + number_of_cores: 1 + printing: + silence: false + run: + dlogz: null + logl_max: .inf + maxcall: null + maxiter: null + n_effective: null + search: + bootstrap: null + bound: multi + enlarge: null + facc: 0.2 + first_update: null + fmove: 0.9 + max_move: 100 + nlive: 50 + sample: rwalk + slices: 5 + update_interval: null + walks: 5 + updates: + iterations_per_update: 5000 + log_every_update: 1 + model_results_every_update: 1 + remove_state_files_at_end: true + visualize_every_update: 1 diff --git a/autolens/imaging/fit_imaging.py b/autolens/imaging/fit_imaging.py index 416622e37..775367fac 100644 --- a/autolens/imaging/fit_imaging.py +++ b/autolens/imaging/fit_imaging.py @@ -9,7 +9,6 @@ from autogalaxy.abstract_fit import AbstractFitInversion -from autolens.analysis.preloads import Preloads from autolens.lens.tracer import Tracer from autolens.lens.to_inversion import TracerToInversion @@ -24,7 +23,6 @@ def __init__( dataset_model : Optional[aa.DatasetModel] = None, adapt_images: Optional[ag.AdaptImages] = None, settings_inversion: aa.SettingsInversion = aa.SettingsInversion(), - preloads: Preloads = Preloads(), run_time_dict: Optional[Dict] = None, ): """ @@ -64,9 +62,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 function calls which have the `profile_func` decorator take to run. @@ -82,26 +77,16 @@ def __init__( self.adapt_images = adapt_images self.settings_inversion = settings_inversion - self.preloads = preloads - @property def blurred_image(self) -> aa.Array2D: """ Returns the image of all light profiles in the fit's tracer convolved with the imaging dataset's PSF. - - For certain lens models the blurred image does not change (for example when all light profiles in the tracer - are fixed in the lens model). For faster run-times the blurred image can be preloaded. """ - - if self.preloads.blurred_image is None: - - return self.tracer.blurred_image_2d_from( - grid=self.grids.lp, - convolver=self.dataset.convolver, - blurring_grid=self.grids.blurring, - ) - - return self.preloads.blurred_image + return self.tracer.blurred_image_2d_from( + grid=self.grids.lp, + convolver=self.dataset.convolver, + blurring_grid=self.grids.blurring, + ) @property def profile_subtracted_image(self) -> aa.Array2D: @@ -127,7 +112,6 @@ def tracer_to_inversion(self) -> TracerToInversion: tracer=self.tracer, adapt_images=self.adapt_images, settings_inversion=self.settings_inversion, - preloads=self.preloads, run_time_dict=self.run_time_dict ) @@ -334,44 +318,3 @@ def tracer_linear_light_profiles_to_light_profiles(self) -> Tracer: 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, tracer 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, tracer 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, - tracer=self.tracer, - dataset_model=self.dataset_model, - adapt_images=self.adapt_images, - settings_inversion=settings_inversion, - preloads=preloads, - run_time_dict=run_time_dict, - ) \ No newline at end of file diff --git a/autolens/imaging/model/analysis.py b/autolens/imaging/model/analysis.py index d5c897877..64288c2c5 100644 --- a/autolens/imaging/model/analysis.py +++ b/autolens/imaging/model/analysis.py @@ -10,7 +10,6 @@ from autoarray.exc import PixelizationException from autolens.analysis.analysis.dataset import AnalysisDataset -from autolens.analysis.preloads import Preloads from autolens.imaging.model.result import ResultImaging from autolens.imaging.model.visualizer import VisualizerImaging from autolens.imaging.fit_imaging import FitImaging @@ -52,10 +51,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: @@ -127,7 +122,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: """ @@ -141,8 +135,6 @@ def fit_from( instance An instance of the model that is being fitted to the data by this analysis (whose parameters have been set via a non-linear search). - preload_overwrite - If a `Preload` object is input this is used instead of the preloads stored as an attribute in the analysis. check_positions Whether the multiple image positions of the lensed source should be checked, i.e. whether they trace within the position threshold of one another in the source plane. @@ -163,15 +155,12 @@ def fit_from( adapt_images = self.adapt_images_via_instance_from(instance=instance) - preloads = preload_overwrite or self.preloads - return FitImaging( dataset=self.dataset, tracer=tracer, dataset_model=dataset_model, adapt_images=adapt_images, settings_inversion=self.settings_inversion, - preloads=preloads, run_time_dict=run_time_dict, ) @@ -195,9 +184,6 @@ def save_attributes(self, paths: af.DirectoryPaths): - Its PSF. - Its mask. - The positions of the brightest pixels in the lensed source which are used to discard mass models. - - The preloaded image-plane source plane pixelization if used by the analysis. This ensures that differences in - the scikit-learn library do not lead to different pixelizations being computed if results are transferred from - a HPC to laptop. It is common for these attributes to be loaded by many of the template aggregator functions given in the `aggregator` modules. For example, when using the database tools to perform a fit, the default behaviour is for @@ -238,7 +224,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/autolens/interferometer/fit_interferometer.py b/autolens/interferometer/fit_interferometer.py index 65b93291e..7c9713186 100644 --- a/autolens/interferometer/fit_interferometer.py +++ b/autolens/interferometer/fit_interferometer.py @@ -8,7 +8,6 @@ from autogalaxy.abstract_fit import AbstractFitInversion -from autolens.analysis.preloads import Preloads from autolens.lens.tracer import Tracer from autolens.lens.to_inversion import TracerToInversion @@ -21,7 +20,6 @@ def __init__( dataset_model: Optional[aa.DatasetModel] = None, adapt_images: Optional[ag.AdaptImages] = None, settings_inversion: aa.SettingsInversion = aa.SettingsInversion(), - preloads: 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 function calls which have the `profile_func` decorator take to run. @@ -81,8 +76,6 @@ def __init__( self.settings_inversion = settings_inversion - self.preloads = preloads - self.run_time_dict = run_time_dict super().__init__( @@ -125,7 +118,6 @@ def tracer_to_inversion(self) -> TracerToInversion: tracer=self.tracer, adapt_images=self.adapt_images, settings_inversion=self.settings_inversion, - preloads=self.preloads, ) @cached_property @@ -242,44 +234,3 @@ def tracer_linear_light_profiles_to_light_profiles(self) -> Tracer: 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, tracer 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, tracer 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, - tracer=self.tracer, - 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/autolens/interferometer/model/analysis.py b/autolens/interferometer/model/analysis.py index 46e22749b..141a941db 100644 --- a/autolens/interferometer/model/analysis.py +++ b/autolens/interferometer/model/analysis.py @@ -11,7 +11,6 @@ from autoarray.exc import PixelizationException from autolens.analysis.analysis.dataset import AnalysisDataset -from autolens.analysis.preloads import Preloads from autolens.analysis.positions import PositionsLHResample from autolens.analysis.positions import PositionsLHPenalty from autolens.interferometer.model.result import ResultInterferometer @@ -115,13 +114,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): @@ -190,7 +182,6 @@ def log_likelihood_function(self, instance): def fit_from( self, instance: af.ModelInstance, - preload_overwrite: Optional[Preloads] = None, run_time_dict: Optional[Dict] = None, ) -> FitInterferometer: """ @@ -204,8 +195,6 @@ def fit_from( instance An instance of the model that is being fitted to the data by this analysis (whose parameters have been set via a non-linear search). - preload_overwrite - If a `Preload` object is input this is used instead of the preloads stored as an attribute in the analysis. check_positions Whether the multiple image positions of the lensed source should be checked, i.e. whether they trace within the position threshold of one another in the source plane. @@ -224,14 +213,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, tracer=tracer, adapt_images=adapt_images, settings_inversion=self.settings_inversion, - preloads=preloads, run_time_dict=run_time_dict, ) @@ -255,9 +241,6 @@ def save_attributes(self, paths: af.DirectoryPaths): - Its uv-wavelengths - Its real space mask. - The positions of the brightest pixels in the lensed source which are used to discard mass models. - - The preloaded image-plane source plane pixelization if used by the analysis. This ensures that differences in - the scikit-learn library do not lead to different pixelizations being computed if results are transferred from - a HPC to laptop. It is common for these attributes to be loaded by many of the template aggregator functions given in the `aggregator` modules. For example, when using the database tools to perform a fit, the default behaviour is for @@ -297,7 +280,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/autolens/lens/to_inversion.py b/autolens/lens/to_inversion.py index 0d94c3f61..2e020775b 100644 --- a/autolens/lens/to_inversion.py +++ b/autolens/lens/to_inversion.py @@ -9,8 +9,6 @@ from autoarray.inversion.inversion.factory import inversion_from -from autolens.analysis.preloads import Preloads - class TracerToInversion(ag.AbstractToInversion): def __init__( @@ -19,7 +17,6 @@ def __init__( tracer, adapt_images: Optional[ag.AdaptImages] = None, settings_inversion: aa.SettingsInversion = aa.SettingsInversion(), - preloads=Preloads(), run_time_dict: Optional[Dict] = None, ): """ @@ -55,8 +52,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. """ @@ -66,7 +61,6 @@ def __init__( dataset=dataset, adapt_images=adapt_images, settings_inversion=settings_inversion, - preloads=preloads, run_time_dict=run_time_dict, ) @@ -352,10 +346,7 @@ def traced_mesh_grid_pg_list(self) -> List[List]: ------- The list of lists of traced mesh grids grouped by plane. """ - if self.preloads.image_plane_mesh_grid_pg_list is None: - image_plane_mesh_grid_pg_list = self.image_plane_mesh_grid_pg_list - else: - image_plane_mesh_grid_pg_list = self.preloads.image_plane_mesh_grid_pg_list + image_plane_mesh_grid_pg_list = self.image_plane_mesh_grid_pg_list traced_mesh_grid_pg_list = [] @@ -409,31 +400,16 @@ def mapper_galaxy_dict(self) -> Dict[aa.AbstractMapper, ag.Galaxy]: mapper_galaxy_dict = {} - if self.preloads.traced_grids_of_planes_for_inversion is None: - traced_grids_of_planes_list = self.traced_grid_2d_list_of_inversion - else: - traced_grids_of_planes_list = ( - self.preloads.traced_grids_of_planes_for_inversion - ) - - if self.preloads.traced_mesh_grids_list_of_planes is None: - traced_mesh_grids_list_of_planes = self.traced_mesh_grid_pg_list - else: - traced_mesh_grids_list_of_planes = ( - self.preloads.traced_mesh_grids_list_of_planes - ) + traced_grids_of_planes_list = self.traced_grid_2d_list_of_inversion - if self.preloads.image_plane_mesh_grid_pg_list is None: - image_plane_mesh_grid_list = self.image_plane_mesh_grid_pg_list - else: - image_plane_mesh_grid_list = self.preloads.image_plane_mesh_grid_pg_list + traced_mesh_grids_list_of_planes = self.traced_mesh_grid_pg_list + image_plane_mesh_grid_list = self.image_plane_mesh_grid_pg_list for plane_index, galaxies in enumerate(self.planes): if galaxies.has(cls=aa.Pixelization): to_inversion = ag.GalaxiesToInversion( dataset=self.dataset, galaxies=galaxies, - preloads=self.preloads, adapt_images=self.adapt_images, settings_inversion=self.settings_inversion, run_time_dict=self.run_time_dict, @@ -500,7 +476,6 @@ def inversion(self): dataset=self.dataset, linear_obj_list=self.linear_obj_list, settings=self.settings_inversion, - preloads=self.preloads, run_time_dict=self.tracer.run_time_dict, ) diff --git a/autolens/lens/tracer.py b/autolens/lens/tracer.py index b16dad9a5..3e19bf0bb 100644 --- a/autolens/lens/tracer.py +++ b/autolens/lens/tracer.py @@ -359,9 +359,11 @@ def upper_plane_index_with_light_profile(self) -> int: """ return max( [ - plane_index - if any([galaxy.has(cls=ag.LightProfile) for galaxy in galaxies]) - else 0 + ( + plane_index + if any([galaxy.has(cls=ag.LightProfile) for galaxy in galaxies]) + else 0 + ) for (plane_index, galaxies) in enumerate(self.planes) ] ) diff --git a/autolens/point/solver/__init__.py b/autolens/point/solver/__init__.py index 2751beef9..d9cf14301 100644 --- a/autolens/point/solver/__init__.py +++ b/autolens/point/solver/__init__.py @@ -1 +1 @@ -from .point_solver import PointSolver +from .point_solver import PointSolver diff --git a/autolens/point/solver/point_solver.py b/autolens/point/solver/point_solver.py index 0103350a1..2d160d583 100644 --- a/autolens/point/solver/point_solver.py +++ b/autolens/point/solver/point_solver.py @@ -1,78 +1,78 @@ -import logging -from typing import Tuple, Optional - -from autoarray.numpy_wrapper import np - -import autoarray as aa -from autoarray.numpy_wrapper import use_jax -from autoarray.structures.triangles.shape import Point - -from autofit.jax_wrapper import jit, register_pytree_node_class -from autogalaxy import OperateDeflections -from .shape_solver import AbstractSolver - - -logger = logging.getLogger(__name__) - - -@register_pytree_node_class -class PointSolver(AbstractSolver): - @jit - def solve( - self, - tracer: OperateDeflections, - source_plane_coordinate: Tuple[float, float], - source_plane_redshift: Optional[float] = None, - ) -> aa.Grid2DIrregular: - """ - Solve for the image plane coordinates that are traced to the source plane coordinate. - - This is done by tiling the image plane with triangles and checking if the source plane coordinate is contained - within the triangle. The triangles are sub-sampled to increase the resolution with only the triangles that - contain the source plane coordinate and their neighbours being kept. - - The means of the triangles are then filtered to keep only those with an absolute magnification above the - threshold. - - Parameters - ---------- - source_plane_coordinate - The source plane coordinate to trace to the image plane. - tracer - The tracer that traces the image plane coordinates to the source plane - source_plane_redshift - The redshift of the source plane coordinate. - - Returns - ------- - A list of image plane coordinates that are traced to the source plane coordinate. - """ - kept_triangles = super().solve_triangles( - tracer=tracer, - shape=Point(*source_plane_coordinate), - source_plane_redshift=source_plane_redshift, - ) - - filtered_means = self._filter_low_magnification( - tracer=tracer, points=kept_triangles.means - ) - if use_jax: - return aa.Grid2DIrregular([pair for pair in filtered_means]) - - filtered_means = [ - pair for pair in filtered_means if not np.any(np.isnan(pair)).all() - ] - - difference = len(kept_triangles.means) - len(filtered_means) - if difference > 0: - logger.debug( - f"Filtered one multiple-image with magnification below threshold." - ) - elif difference > 1: - logger.warning( - f"Filtered {difference} multiple-images with magnification below threshold." - ) - - return aa.Grid2DIrregular( - [pair for pair in filtered_means if not np.isnan(pair).all()] - ) +import logging +from typing import Tuple, Optional + +from autoarray.numpy_wrapper import np + +import autoarray as aa +from autoarray.numpy_wrapper import use_jax +from autoarray.structures.triangles.shape import Point + +from autofit.jax_wrapper import jit, register_pytree_node_class +from autogalaxy import OperateDeflections +from .shape_solver import AbstractSolver + + +logger = logging.getLogger(__name__) + + +@register_pytree_node_class +class PointSolver(AbstractSolver): + @jit + def solve( + self, + tracer: OperateDeflections, + source_plane_coordinate: Tuple[float, float], + source_plane_redshift: Optional[float] = None, + ) -> aa.Grid2DIrregular: + """ + Solve for the image plane coordinates that are traced to the source plane coordinate. + + This is done by tiling the image plane with triangles and checking if the source plane coordinate is contained + within the triangle. The triangles are sub-sampled to increase the resolution with only the triangles that + contain the source plane coordinate and their neighbours being kept. + + The means of the triangles are then filtered to keep only those with an absolute magnification above the + threshold. + + Parameters + ---------- + source_plane_coordinate + The source plane coordinate to trace to the image plane. + tracer + The tracer that traces the image plane coordinates to the source plane + source_plane_redshift + The redshift of the source plane coordinate. + + Returns + ------- + A list of image plane coordinates that are traced to the source plane coordinate. + """ + kept_triangles = super().solve_triangles( + tracer=tracer, + shape=Point(*source_plane_coordinate), + source_plane_redshift=source_plane_redshift, + ) + + filtered_means = self._filter_low_magnification( + tracer=tracer, points=kept_triangles.means + ) + if use_jax: + return aa.Grid2DIrregular([pair for pair in filtered_means]) + + filtered_means = [ + pair for pair in filtered_means if not np.any(np.isnan(pair)).all() + ] + + difference = len(kept_triangles.means) - len(filtered_means) + if difference > 0: + logger.debug( + f"Filtered one multiple-image with magnification below threshold." + ) + elif difference > 1: + logger.warning( + f"Filtered {difference} multiple-images with magnification below threshold." + ) + + return aa.Grid2DIrregular( + [pair for pair in filtered_means if not np.isnan(pair).all()] + ) diff --git a/docs/overview/overview_2_new_user_guide.rst b/docs/overview/overview_2_new_user_guide.rst index 9b3a8ce94..3399edb65 100644 --- a/docs/overview/overview_2_new_user_guide.rst +++ b/docs/overview/overview_2_new_user_guide.rst @@ -125,9 +125,11 @@ The ``autolens_workspace/guides`` package has many useful guides, including conc and unit conversion guides (``guides/units``). Quickly navigate to this part of the workspace and skim read the guides quickly. You do not need to understand them in detail now -so don't spend long reading them. T +so don't spend long reading them. -he purpose of looking at them now is you know they exist and can refer to them if you get stuck using **PyAutoLens**. +**If your dataset type is a point source, you should read the ``guides/point_source.ipynb`` guide now, which covers many details of point source modeling.** + +The purpose of looking at them now is you know they exist and can refer to them if you get stuck using **PyAutoLens**. GitHub Links: diff --git a/eden.ini b/eden.ini index b800028e5..cedb5becb 100644 --- a/eden.ini +++ b/eden.ini @@ -1,3 +1,3 @@ -[eden] -name=autolens -prefix=al +[eden] +name=autolens +prefix=al diff --git a/optional_requirements.txt b/optional_requirements.txt index 524e88755..7f924b895 100644 --- a/optional_requirements.txt +++ b/optional_requirements.txt @@ -1,8 +1,8 @@ -numba -pylops>=1.10.0,<=2.3.1 -pynufft -zeus-mcmc==2.5.4 -getdist==1.4 -#jax>=0.4.13 -#jaxlib>=0.4.13 +numba +pylops>=1.10.0,<=2.3.1 +pynufft +zeus-mcmc==2.5.4 +getdist==1.4 +#jax>=0.4.13 +#jaxlib>=0.4.13 ultranest==4.3.2 \ No newline at end of file diff --git a/release.sh b/release.sh index fde2f648e..d5a6646d0 100755 --- a/release.sh +++ b/release.sh @@ -1,31 +1,31 @@ -#!/usr/bin/env bash - -export PACKAGE_NAME=autolens - -rm -rf $p/dist -rm -rf $p/build - -set -e - -export VERSION=$1 - -cat $PACKAGE_NAME/__init__.py | grep -v __version__ > temp - -cat temp > $PACKAGE_NAME/__init__.py -rm temp -echo "__version__ = '"$VERSION"'" >> $PACKAGE_NAME/__init__.py - -git add $PACKAGE_NAME/__init__.py - -set +e -git commit -m "Incremented version number" -set -e - -python3 setup.py sdist bdist_wheel -twine upload dist/* --skip-existing --username $PYPI_USERNAME --password $PYPI_PASSWORD - - -git push --tags - -rm -rf $p/dist -rm -rf $p/build +#!/usr/bin/env bash + +export PACKAGE_NAME=autolens + +rm -rf $p/dist +rm -rf $p/build + +set -e + +export VERSION=$1 + +cat $PACKAGE_NAME/__init__.py | grep -v __version__ > temp + +cat temp > $PACKAGE_NAME/__init__.py +rm temp +echo "__version__ = '"$VERSION"'" >> $PACKAGE_NAME/__init__.py + +git add $PACKAGE_NAME/__init__.py + +set +e +git commit -m "Incremented version number" +set -e + +python3 setup.py sdist bdist_wheel +twine upload dist/* --skip-existing --username $PYPI_USERNAME --password $PYPI_PASSWORD + + +git push --tags + +rm -rf $p/dist +rm -rf $p/build diff --git a/test_autolens/analysis/analysis/test_analysis_dataset.py b/test_autolens/analysis/analysis/test_analysis_dataset.py index daba9832d..4f93db1c4 100644 --- a/test_autolens/analysis/analysis/test_analysis_dataset.py +++ b/test_autolens/analysis/analysis/test_analysis_dataset.py @@ -40,31 +40,6 @@ def test__modify_before_fit__inversion_no_positions_likelihood__raises_exception analysis.modify_before_fit(paths=af.DirectoryPaths(), model=model) -def test__check_preloads(masked_imaging_7x7): - conf.instance["general"]["test"]["check_preloads"] = True - - lens_galaxy = al.Galaxy(redshift=0.5, light=al.lp.Sersic(intensity=0.1)) - - model = af.Collection(galaxies=af.Collection(lens=lens_galaxy)) - - analysis = al.AnalysisImaging(dataset=masked_imaging_7x7) - - instance = model.instance_from_unit_vector([]) - tracer = analysis.tracer_via_instance_from(instance=instance) - fit = al.FitImaging(dataset=masked_imaging_7x7, tracer=tracer) - - analysis.preloads.check_via_fit(fit=fit) - - analysis.preloads.blurred_image = fit.blurred_image - - analysis.preloads.check_via_fit(fit=fit) - - analysis.preloads.blurred_image = fit.blurred_image + 1.0 - - with pytest.raises(exc.PreloadsException): - analysis.preloads.check_via_fit(fit=fit) - - def test__save_results__tracer_output_to_json(analysis_imaging_7x7): lens = al.Galaxy(redshift=0.5) source = al.Galaxy(redshift=1.0) diff --git a/test_autolens/analysis/test_analysis.py b/test_autolens/analysis/test_analysis.py index 487045bb4..93d4f1b2c 100644 --- a/test_autolens/analysis/test_analysis.py +++ b/test_autolens/analysis/test_analysis.py @@ -150,31 +150,6 @@ def test__modify_before_fit__inversion_no_positions_likelihood__raises_exception analysis.modify_before_fit(paths=af.DirectoryPaths(), model=model) -def test__check_preloads(masked_imaging_7x7): - conf.instance["general"]["test"]["check_preloads"] = True - - lens_galaxy = al.Galaxy(redshift=0.5, light=al.lp.Sersic(intensity=0.1)) - - model = af.Collection(galaxies=af.Collection(lens=lens_galaxy)) - - analysis = al.AnalysisImaging(dataset=masked_imaging_7x7) - - instance = model.instance_from_unit_vector([]) - tracer = analysis.tracer_via_instance_from(instance=instance) - fit = al.FitImaging(dataset=masked_imaging_7x7, tracer=tracer) - - analysis.preloads.check_via_fit(fit=fit) - - analysis.preloads.blurred_image = fit.blurred_image - - analysis.preloads.check_via_fit(fit=fit) - - analysis.preloads.blurred_image = fit.blurred_image + 1.0 - - with pytest.raises(exc.PreloadsException): - analysis.preloads.check_via_fit(fit=fit) - - def test__save_results__tracer_output_to_json(analysis_imaging_7x7): lens = al.Galaxy(redshift=0.5) source = al.Galaxy(redshift=1.0) diff --git a/test_autolens/analysis/test_preloads.py b/test_autolens/analysis/test_preloads.py index 5b8f268c9..e69de29bb 100644 --- a/test_autolens/analysis/test_preloads.py +++ b/test_autolens/analysis/test_preloads.py @@ -1,202 +0,0 @@ -import numpy as np -from os import path - -import autofit as af - -import autolens as al - - -def test__set_traced_grids_of_planes(): - grid = al.Grid2D.no_mask( - values=np.array([[[1.0, 1.0]]]), - pixel_scales=1.0, - over_sample_size=1, - ) - - # traced grids is None so no Preloading. - - tracer_0 = al.m.MockTracer(traced_grid_2d_list_from=[None, None]) - tracer_1 = al.m.MockTracer(traced_grid_2d_list_from=[None, None]) - - fit_0 = al.m.MockFitImaging(tracer=tracer_0, grid=grid) - fit_1 = al.m.MockFitImaging(tracer=tracer_1, grid=grid) - - preloads = al.Preloads(traced_grids_of_planes_for_inversion=1) - preloads.set_traced_grids_of_planes_for_inversion(fit_0=fit_0, fit_1=fit_1) - - assert preloads.traced_grids_of_planes_for_inversion is None - - # traced grids are different, indicating the model parameters change the grid, so no preloading. - - tracer_0 = al.m.MockTracer(traced_grid_2d_list_from=[None, np.array([[1.0]])]) - tracer_1 = al.m.MockTracer(traced_grid_2d_list_from=[None, np.array([[2.0]])]) - - fit_0 = al.m.MockFitImaging(tracer=tracer_0, grid=grid) - fit_1 = al.m.MockFitImaging(tracer=tracer_1, grid=grid) - - preloads = al.Preloads(traced_grids_of_planes_for_inversion=1) - preloads.set_traced_grids_of_planes_for_inversion(fit_0=fit_0, fit_1=fit_1) - - assert preloads.traced_grids_of_planes_for_inversion is None - - # traced grids are the same meaning they are fixed in the model, so do preload. - - tracer_0 = al.m.MockTracer(traced_grid_2d_list_from=[None, np.array([[1.0]])]) - tracer_1 = al.m.MockTracer(traced_grid_2d_list_from=[None, np.array([[1.0]])]) - - fit_0 = al.m.MockFitImaging(tracer=tracer_0, grid=grid) - fit_1 = al.m.MockFitImaging(tracer=tracer_1, grid=grid) - - preloads = al.Preloads(traced_grids_of_planes_for_inversion=1) - preloads.set_traced_grids_of_planes_for_inversion(fit_0=fit_0, fit_1=fit_1) - - assert preloads.traced_grids_of_planes_for_inversion[0] is None - assert (preloads.traced_grids_of_planes_for_inversion[1] == np.array([[1.0]])).all() - - -def test__set_mesh_grid_of_planes(): - # sparse image plane of grids is None so no Preloading. - - tracer_0 = al.m.MockTracer(image_plane_mesh_grid_pg_list=[None, None]) - tracer_1 = al.m.MockTracer(image_plane_mesh_grid_pg_list=[None, None]) - - fit_0 = al.m.MockFitImaging(tracer=tracer_0) - fit_1 = al.m.MockFitImaging(tracer=tracer_1) - - preloads = al.Preloads(image_plane_mesh_grid_pg_list=1) - preloads.set_image_plane_mesh_grid_pg_list(fit_0=fit_0, fit_1=fit_1) - - assert preloads.image_plane_mesh_grid_pg_list is None - - # sparse image plane of grids are different, indicating the model parameters change the grid, so no preloading. - - tracer_0 = al.m.MockTracer(image_plane_mesh_grid_pg_list=[None, np.array([[1.0]])]) - tracer_1 = al.m.MockTracer(image_plane_mesh_grid_pg_list=[None, np.array([[2.0]])]) - - fit_0 = al.m.MockFitImaging(tracer=tracer_0) - fit_1 = al.m.MockFitImaging(tracer=tracer_1) - - preloads = al.Preloads(image_plane_mesh_grid_pg_list=1) - preloads.set_image_plane_mesh_grid_pg_list(fit_0=fit_0, fit_1=fit_1) - - assert preloads.image_plane_mesh_grid_pg_list is None - - # sparse image plane of grids are the same meaning they are fixed in the model, so do preload. - - tracer_0 = al.m.MockTracer(image_plane_mesh_grid_pg_list=[None, np.array([[1.0]])]) - tracer_1 = al.m.MockTracer(image_plane_mesh_grid_pg_list=[None, np.array([[1.0]])]) - - fit_0 = al.m.MockFitImaging(tracer=tracer_0) - fit_1 = al.m.MockFitImaging(tracer=tracer_1) - - preloads = al.Preloads(image_plane_mesh_grid_pg_list=1) - preloads.set_image_plane_mesh_grid_pg_list(fit_0=fit_0, fit_1=fit_1) - - assert preloads.image_plane_mesh_grid_pg_list[0] is None - assert (preloads.image_plane_mesh_grid_pg_list[1] == 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 = al.Preloads( - blurred_image=np.zeros(3), - w_tilde=None, - use_w_tilde=False, - traced_grids_of_planes_for_inversion=None, - 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"Traced Grids of Planes (For LEq) = False\n" - i += 1 - assert lines[i] == f"Sparse Image-Plane Grids of Planes = False\n" - i += 1 - assert lines[i] == f"Relocated Grid = 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 = al.Preloads( - blurred_image=1, - w_tilde=1, - use_w_tilde=True, - traced_grids_of_planes_for_inversion=1, - relocated_grid=1, - image_plane_mesh_grid_pg_list=1, - mapper_list=1, - operated_mapping_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"Traced Grids of Planes (For LEq) = True\n" - i += 1 - assert lines[i] == f"Sparse Image-Plane Grids of Planes = True\n" - i += 1 - assert lines[i] == f"Relocated Grid = 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 = False\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_autolens/config/general.yaml b/test_autolens/config/general.yaml index e06e1b19d..032245c00 100644 --- a/test_autolens/config/general.yaml +++ b/test_autolens/config/general.yaml @@ -1,43 +1,40 @@ -analysis: - n_cores: 1 - preload_attempts: 250 -fits: - flip_for_ds9: true -grid: - remove_projected_centre: false -hpc: - hpc_mode: false - iterations_per_update: 5000 -adapt: - adapt_minimum_percent: 0.01 - adapt_noise_limit: 100000000.0 -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. -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 -profiling: - perform: true - repeats: 1 -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: 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. - disable_positions_lh_inversion_check: false +analysis: + n_cores: 1 +fits: + flip_for_ds9: true +grid: + remove_projected_centre: false +hpc: + hpc_mode: false + iterations_per_update: 5000 +adapt: + adapt_minimum_percent: 0.01 + adapt_noise_limit: 100000000.0 +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. +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 +profiling: + perform: true + repeats: 1 +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: false + disable_positions_lh_inversion_check: false diff --git a/test_autolens/config/grids.yaml b/test_autolens/config/grids.yaml index 3adb7a356..06d81535e 100644 --- a/test_autolens/config/grids.yaml +++ b/test_autolens/config/grids.yaml @@ -1,65 +1,65 @@ -interpolate: - convergence_2d_from: - Isothermal: false - IsothermalInitialize: false - IsothermalSph: true - deflections_yx_2d_from: - Isothermal: false - IsothermalInitialize: false - IsothermalSph: true - image_2d_from: - Sersic: false - SersicInitialize: false - SersicSph: true - potential_2d_from: - Isothermal: false - IsothermalInitialize: 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: - DevVaucouleurs: 1.0e-08 - DevVaucouleursSph: 1.0e-08 - EllMassProfile: 1.0e-08 - EllProfile: 1.0e-08 - Exponential: 1.0e-08 - ExponentialSph: 1.0e-08 - ExternalShear: 1.0e-08 - Gaussian: 1.0e-08 - GaussianGradient: 1.0e-08 - GaussianSph: 1.0e-08 - Isothermal: 1.0e-08 - IsothermalCore: 1.0e-08 - IsothermalCoreSph: 1.0e-08 - IsothermalInitialize: 1.0e-08 - IsothermalSph: 1.0e-08 - MassSheet: 1.0e-08 - MockGridRadialMinimum: 2.5 - NFW: 1.0e-08 - NFWSph: 1.0e-08 - NFWTruncatedSph: 1.0e-08 - PointMass: 0.0 - 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-08 - SersicCore: 1.0e-08 - SersicCoreSph: 1.0e-08 - SersicGradient: 1.0e-08 - SersicGradientSph: 1.0e-08 - SersicSph: 1.0e-08 - SphNFWTruncatedMCR: 1.0e-08 - gNFW: 1.0e-08 - gNFWSph: 1.0e-08 - +interpolate: + convergence_2d_from: + Isothermal: false + IsothermalInitialize: false + IsothermalSph: true + deflections_yx_2d_from: + Isothermal: false + IsothermalInitialize: false + IsothermalSph: true + image_2d_from: + Sersic: false + SersicInitialize: false + SersicSph: true + potential_2d_from: + Isothermal: false + IsothermalInitialize: 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: + DevVaucouleurs: 1.0e-08 + DevVaucouleursSph: 1.0e-08 + EllMassProfile: 1.0e-08 + EllProfile: 1.0e-08 + Exponential: 1.0e-08 + ExponentialSph: 1.0e-08 + ExternalShear: 1.0e-08 + Gaussian: 1.0e-08 + GaussianGradient: 1.0e-08 + GaussianSph: 1.0e-08 + Isothermal: 1.0e-08 + IsothermalCore: 1.0e-08 + IsothermalCoreSph: 1.0e-08 + IsothermalInitialize: 1.0e-08 + IsothermalSph: 1.0e-08 + MassSheet: 1.0e-08 + MockGridRadialMinimum: 2.5 + NFW: 1.0e-08 + NFWSph: 1.0e-08 + NFWTruncatedSph: 1.0e-08 + PointMass: 0.0 + 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-08 + SersicCore: 1.0e-08 + SersicCoreSph: 1.0e-08 + SersicGradient: 1.0e-08 + SersicGradientSph: 1.0e-08 + SersicSph: 1.0e-08 + SphNFWTruncatedMCR: 1.0e-08 + gNFW: 1.0e-08 + gNFWSph: 1.0e-08 + diff --git a/test_autolens/config/non_linear.yaml b/test_autolens/config/non_linear.yaml index 2dcf909de..3fb607c33 100644 --- a/test_autolens/config/non_linear.yaml +++ b/test_autolens/config/non_linear.yaml @@ -1,83 +1,83 @@ -mock: - MockOptimizer: - initialize: - method: prior - printing: - silence: false - updates: - iterations_per_update: 2500 - remove_state_files_at_end: true - MockSearch: - initialize: - method: prior - printing: - silence: false - search: {} - updates: - iterations_per_update: 2500 - remove_state_files_at_end: true -nest: - DynestyDynamic: - general: - acceptance_ratio_threshold: 0.1 - bootstrap: null - bound: multi - enlarge: null - first_update: null - fmove: 0.9 - max_move: 100 - sample: auto - sampling_efficiency: 0.5 - slices: 5 - terminate_at_acceptance_ratio: false - update_interval: null - walks: 25 - initialize: - method: prior - parallel: - force_x1_cpu: false - number_of_cores: 1 - printing: - silence: false - updates: - iterations_per_update: 2500 - remove_state_files_at_end: true - DynestyStatic: - parallel: - number_of_cores: 1 - initialize: - method: prior - inversion: - acceptance_ratio_threshold: 0.05 - const_efficiency_mode: true - evidence_tolerance: 100.0 - multimodal: false - n_live_points: 50 - sampling_efficiency: 0.3 - terminate_at_acceptance_ratio: false - printing: - silence: false - search: - const_efficiency_mode: false - evidence_tolerance: 0.5 - importance_nested_sampling: false - max_iter: 0 - max_modes: 100 - mode_tolerance: -1.0e+90 - multimodal: false - n_live_points: 50 - sampling_efficiency: 0.5 - settings: - context: 0 - init_MPI: false - log_zero: -1.0e+100 - n_iter_before_update: 5 - null_log_evidence: -1.0e+90 - resume: true - seed: -1.0 - stagger_resampling_likelihood: true - verbose: false - write_output: true - updates: - iterations_per_update: 2500 - remove_state_files_at_end: true +mock: + MockOptimizer: + initialize: + method: prior + printing: + silence: false + updates: + iterations_per_update: 2500 + remove_state_files_at_end: true + MockSearch: + initialize: + method: prior + printing: + silence: false + search: {} + updates: + iterations_per_update: 2500 + remove_state_files_at_end: true +nest: + DynestyDynamic: + general: + acceptance_ratio_threshold: 0.1 + bootstrap: null + bound: multi + enlarge: null + first_update: null + fmove: 0.9 + max_move: 100 + sample: auto + sampling_efficiency: 0.5 + slices: 5 + terminate_at_acceptance_ratio: false + update_interval: null + walks: 25 + initialize: + method: prior + parallel: + force_x1_cpu: false + number_of_cores: 1 + printing: + silence: false + updates: + iterations_per_update: 2500 + remove_state_files_at_end: true + DynestyStatic: + parallel: + number_of_cores: 1 + initialize: + method: prior + inversion: + acceptance_ratio_threshold: 0.05 + const_efficiency_mode: true + evidence_tolerance: 100.0 + multimodal: false + n_live_points: 50 + sampling_efficiency: 0.3 + terminate_at_acceptance_ratio: false + printing: + silence: false + search: + const_efficiency_mode: false + evidence_tolerance: 0.5 + importance_nested_sampling: false + max_iter: 0 + max_modes: 100 + mode_tolerance: -1.0e+90 + multimodal: false + n_live_points: 50 + sampling_efficiency: 0.5 + settings: + context: 0 + init_MPI: false + log_zero: -1.0e+100 + n_iter_before_update: 5 + null_log_evidence: -1.0e+90 + resume: true + seed: -1.0 + stagger_resampling_likelihood: true + verbose: false + write_output: true + updates: + iterations_per_update: 2500 + remove_state_files_at_end: true diff --git a/test_autolens/config/notation.yaml b/test_autolens/config/notation.yaml index 8cc3102ef..2d19ca16d 100644 --- a/test_autolens/config/notation.yaml +++ b/test_autolens/config/notation.yaml @@ -1,84 +1,84 @@ -label: - label: - alpha: \alpha - angle_binary: \theta - beta: \beta - break_radius: \theta_{\rm B} - centre_0: y - centre_1: x - coefficient: \lambda - contribution_factor: \omega_{\rm 0} - 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 + contribution_factor: \omega_{\rm 0} + 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_autolens/config/output.yaml b/test_autolens/config/output.yaml index 5cb8812dc..4a44b384b 100644 --- a/test_autolens/config/output.yaml +++ b/test_autolens/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_autolens/config/priors/dark_mass_profiles.yaml b/test_autolens/config/priors/dark_mass_profiles.yaml index 713a4856d..61480a243 100644 --- a/test_autolens/config/priors/dark_mass_profiles.yaml +++ b/test_autolens/config/priors/dark_mass_profiles.yaml @@ -1,338 +1,338 @@ -NFW: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - ell_comps_0: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - ell_comps_1: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - kappa_s: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.2 - scale_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 30.0 - width_modifier: - type: Relative - value: 0.2 -NFWSph: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - kappa_s: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.2 - scale_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 30.0 - width_modifier: - type: Relative - value: 0.2 -NFWTruncatedSph: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - kappa_s: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.2 - scale_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 30.0 - width_modifier: - type: Relative - value: 0.2 - truncation_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 30.0 - width_modifier: - type: Relative - value: 0.2 -SphNFWTruncatedMCR: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - mass_at_200: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 100000000.0 - type: LogUniform - upper_limit: 1000000000000000.0 - width_modifier: - type: Relative - value: 0.5 -gNFW: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - ell_comps_0: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - ell_comps_1: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - inner_slope: - gaussian_limits: - lower: -1.0 - upper: 3.0 - lower_limit: 0.0 - type: Uniform - upper_limit: 2.0 - width_modifier: - type: Absolute - value: 0.3 - kappa_s: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.2 - scale_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 30.0 - width_modifier: - type: Relative - value: 0.2 -gNFWSph: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - inner_slope: - gaussian_limits: - lower: -1.0 - upper: 3.0 - lower_limit: 0.0 - type: Uniform - upper_limit: 2.0 - width_modifier: - type: Absolute - value: 0.3 - kappa_s: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 1.0 - width_modifier: - type: Relative - value: 0.2 - scale_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 30.0 - width_modifier: - type: Relative - value: 0.2 +NFW: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + ell_comps_0: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + ell_comps_1: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + kappa_s: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.2 + scale_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 30.0 + width_modifier: + type: Relative + value: 0.2 +NFWSph: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + kappa_s: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.2 + scale_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 30.0 + width_modifier: + type: Relative + value: 0.2 +NFWTruncatedSph: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + kappa_s: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.2 + scale_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 30.0 + width_modifier: + type: Relative + value: 0.2 + truncation_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 30.0 + width_modifier: + type: Relative + value: 0.2 +SphNFWTruncatedMCR: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + mass_at_200: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 100000000.0 + type: LogUniform + upper_limit: 1000000000000000.0 + width_modifier: + type: Relative + value: 0.5 +gNFW: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + ell_comps_0: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + ell_comps_1: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + inner_slope: + gaussian_limits: + lower: -1.0 + upper: 3.0 + lower_limit: 0.0 + type: Uniform + upper_limit: 2.0 + width_modifier: + type: Absolute + value: 0.3 + kappa_s: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.2 + scale_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 30.0 + width_modifier: + type: Relative + value: 0.2 +gNFWSph: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + inner_slope: + gaussian_limits: + lower: -1.0 + upper: 3.0 + lower_limit: 0.0 + type: Uniform + upper_limit: 2.0 + width_modifier: + type: Absolute + value: 0.3 + kappa_s: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 1.0 + width_modifier: + type: Relative + value: 0.2 + scale_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 30.0 + width_modifier: + type: Relative + value: 0.2 diff --git a/test_autolens/config/priors/galaxy.yaml b/test_autolens/config/priors/galaxy.yaml index a0af83928..37d54b710 100644 --- a/test_autolens/config/priors/galaxy.yaml +++ b/test_autolens/config/priors/galaxy.yaml @@ -1,17 +1,17 @@ -Galaxy: - redshift: - lower_limit: 0.0 - type: Uniform - upper_limit: 3.0 - -Redshift: - redshift: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 3.0 - width_modifier: - type: Absolute - value: 1.0 +Galaxy: + redshift: + lower_limit: 0.0 + type: Uniform + upper_limit: 3.0 + +Redshift: + redshift: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 3.0 + width_modifier: + type: Absolute + value: 1.0 diff --git a/test_autolens/config/priors/geometry_profiles.yaml b/test_autolens/config/priors/geometry_profiles.yaml index b55820bc4..2cc1e251b 100644 --- a/test_autolens/config/priors/geometry_profiles.yaml +++ b/test_autolens/config/priors/geometry_profiles.yaml @@ -1,48 +1,48 @@ -AbstractSersic: - angle: - lower_limit: 0.0 - type: Uniform - upper_limit: 180.0 - axis_ratio: - lower_limit: 0.0 - type: Uniform - upper_limit: 1.0 - centre_0: - lower_limit: -1.0 - type: Uniform - upper_limit: 1.0 - centre_1: - lower_limit: -1.0 - type: Uniform - upper_limit: 1.0 - effective_radius: - lower_limit: 0.0 - type: Uniform - upper_limit: 3.0 - intensity: - lower_limit: 0.0 - type: Uniform - upper_limit: 1.0 - sersic_index: - lower_limit: 0.6 - type: Uniform - upper_limit: 8.0 -EllProfile: - angle: - lower_limit: 0.0 - type: Uniform - upper_limit: 2.0 - axis_ratio: - lower_limit: 0.0 - type: Uniform - upper_limit: 2.0 -GeometryProfile: - centre_0: - lower_limit: 0.0 - type: Uniform - upper_limit: 1.0 - centre_1: - lower_limit: 0.0 - type: Uniform - upper_limit: 1.0 -SphlProfile: {} +AbstractSersic: + angle: + lower_limit: 0.0 + type: Uniform + upper_limit: 180.0 + axis_ratio: + lower_limit: 0.0 + type: Uniform + upper_limit: 1.0 + centre_0: + lower_limit: -1.0 + type: Uniform + upper_limit: 1.0 + centre_1: + lower_limit: -1.0 + type: Uniform + upper_limit: 1.0 + effective_radius: + lower_limit: 0.0 + type: Uniform + upper_limit: 3.0 + intensity: + lower_limit: 0.0 + type: Uniform + upper_limit: 1.0 + sersic_index: + lower_limit: 0.6 + type: Uniform + upper_limit: 8.0 +EllProfile: + angle: + lower_limit: 0.0 + type: Uniform + upper_limit: 2.0 + axis_ratio: + lower_limit: 0.0 + type: Uniform + upper_limit: 2.0 +GeometryProfile: + centre_0: + lower_limit: 0.0 + type: Uniform + upper_limit: 1.0 + centre_1: + lower_limit: 0.0 + type: Uniform + upper_limit: 1.0 +SphlProfile: {} diff --git a/test_autolens/config/priors/light_profiles.yaml b/test_autolens/config/priors/light_profiles.yaml index ee1f07831..830e1fc8f 100644 --- a/test_autolens/config/priors/light_profiles.yaml +++ b/test_autolens/config/priors/light_profiles.yaml @@ -1,266 +1,266 @@ -EllLightProfile: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 0.5 - width_modifier: - type: Absolute - value: 0.05 - ell_comps_0: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - ell_comps_1: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - intensity: - lower_limit: 0.0 - mean: 0.0 - sigma: 0.5 - type: Gaussian - upper_limit: inf - width_modifier: - type: Relative - value: 0.5 -Exponential: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 0.5 - width_modifier: - type: Absolute - value: 0.05 - effective_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 2.0 - width_modifier: - type: Absolute - value: 2.0 - ell_comps_0: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - ell_comps_1: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - intensity: - lower_limit: 0.0 - mean: 0.0 - sigma: 0.5 - type: Gaussian - upper_limit: inf - width_modifier: - type: Relative - value: 0.5 -Gaussian: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - ell_comps_0: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - ell_comps_1: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - intensity: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - sigma: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 25.0 - width_modifier: - type: Relative - value: 0.5 -Sersic: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - effective_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - ell_comps_0: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - ell_comps_1: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - intensity: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - sersic_index: - gaussian_limits: - lower: 0.5 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 8.0 - width_modifier: - type: Absolute - value: 1.5 +EllLightProfile: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 0.5 + width_modifier: + type: Absolute + value: 0.05 + ell_comps_0: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + ell_comps_1: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + intensity: + lower_limit: 0.0 + mean: 0.0 + sigma: 0.5 + type: Gaussian + upper_limit: inf + width_modifier: + type: Relative + value: 0.5 +Exponential: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 0.5 + width_modifier: + type: Absolute + value: 0.05 + effective_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 2.0 + width_modifier: + type: Absolute + value: 2.0 + ell_comps_0: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + ell_comps_1: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + intensity: + lower_limit: 0.0 + mean: 0.0 + sigma: 0.5 + type: Gaussian + upper_limit: inf + width_modifier: + type: Relative + value: 0.5 +Gaussian: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + ell_comps_0: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + ell_comps_1: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + intensity: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + sigma: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 25.0 + width_modifier: + type: Relative + value: 0.5 +Sersic: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + effective_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + ell_comps_0: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + ell_comps_1: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + intensity: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + sersic_index: + gaussian_limits: + lower: 0.5 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 8.0 + width_modifier: + type: Absolute + value: 1.5 diff --git a/test_autolens/config/priors/mass_sheets.yaml b/test_autolens/config/priors/mass_sheets.yaml index 82551b7cb..6efda8397 100644 --- a/test_autolens/config/priors/mass_sheets.yaml +++ b/test_autolens/config/priors/mass_sheets.yaml @@ -1,21 +1,21 @@ -ExternalShear: - gamma_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -0.2 - type: Uniform - upper_limit: 0.2 - width_modifier: - type: Absolute - value: 0.05 - gamma_2: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -0.2 - type: Uniform - upper_limit: 0.2 - width_modifier: - type: Absolute - value: 0.05 +ExternalShear: + gamma_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -0.2 + type: Uniform + upper_limit: 0.2 + width_modifier: + type: Absolute + value: 0.05 + gamma_2: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -0.2 + type: Uniform + upper_limit: 0.2 + width_modifier: + type: Absolute + value: 0.05 diff --git a/test_autolens/config/priors/pixelizations.yaml b/test_autolens/config/priors/pixelizations.yaml index dde440f40..7d8084ed8 100644 --- a/test_autolens/config/priors/pixelizations.yaml +++ b/test_autolens/config/priors/pixelizations.yaml @@ -1,125 +1,125 @@ -delaunay.DelaunayBrightnessImage: - pixels: - gaussian_limits: - lower: 50.0 - upper: inf - lower_limit: 50.0 - type: Uniform - upper_limit: 2500.0 - width_modifier: - type: Absolute - value: 100.0 - weight_floor: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.1 - weight_power: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 20.0 - width_modifier: - type: Absolute - value: 5.0 -delaunay.DelaunayMagnification: - shape_0: - gaussian_limits: - lower: 3.0 - upper: inf - lower_limit: 20.0 - type: Uniform - upper_limit: 45.0 - width_modifier: - type: Absolute - value: 8.0 - shape_1: - gaussian_limits: - lower: 3.0 - upper: inf - lower_limit: 20.0 - type: Uniform - upper_limit: 45.0 - width_modifier: - type: Absolute - value: 8.0 -rectangular.Rectangular: - shape_0: - gaussian_limits: - lower: 3.0 - upper: inf - lower_limit: 20.0 - type: Uniform - upper_limit: 45.0 - width_modifier: - type: Absolute - value: 8.0 - shape_1: - gaussian_limits: - lower: 3.0 - upper: inf - lower_limit: 20.0 - type: Uniform - upper_limit: 45.0 - width_modifier: - type: Absolute - value: 8.0 -voronoi.VoronoiBrightnessImage: - pixels: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 50.0 - type: Uniform - upper_limit: 1500.0 - width_modifier: - type: Absolute - value: 400.0 - weight_floor: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.1 - weight_power: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 20.0 - width_modifier: - type: Absolute - value: 5.0 -voronoi.VoronoiMagnification: - shape_0: - gaussian_limits: - lower: 3.0 - upper: inf - lower_limit: 20.0 - type: Uniform - upper_limit: 45.0 - width_modifier: - type: Absolute - value: 8.0 - shape_1: - gaussian_limits: - lower: 3.0 - upper: inf - lower_limit: 20.0 - type: Uniform - upper_limit: 45.0 - width_modifier: - type: Absolute - value: 8.0 +delaunay.DelaunayBrightnessImage: + pixels: + gaussian_limits: + lower: 50.0 + upper: inf + lower_limit: 50.0 + type: Uniform + upper_limit: 2500.0 + width_modifier: + type: Absolute + value: 100.0 + weight_floor: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.1 + weight_power: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 20.0 + width_modifier: + type: Absolute + value: 5.0 +delaunay.DelaunayMagnification: + shape_0: + gaussian_limits: + lower: 3.0 + upper: inf + lower_limit: 20.0 + type: Uniform + upper_limit: 45.0 + width_modifier: + type: Absolute + value: 8.0 + shape_1: + gaussian_limits: + lower: 3.0 + upper: inf + lower_limit: 20.0 + type: Uniform + upper_limit: 45.0 + width_modifier: + type: Absolute + value: 8.0 +rectangular.Rectangular: + shape_0: + gaussian_limits: + lower: 3.0 + upper: inf + lower_limit: 20.0 + type: Uniform + upper_limit: 45.0 + width_modifier: + type: Absolute + value: 8.0 + shape_1: + gaussian_limits: + lower: 3.0 + upper: inf + lower_limit: 20.0 + type: Uniform + upper_limit: 45.0 + width_modifier: + type: Absolute + value: 8.0 +voronoi.VoronoiBrightnessImage: + pixels: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 50.0 + type: Uniform + upper_limit: 1500.0 + width_modifier: + type: Absolute + value: 400.0 + weight_floor: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.1 + weight_power: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 20.0 + width_modifier: + type: Absolute + value: 5.0 +voronoi.VoronoiMagnification: + shape_0: + gaussian_limits: + lower: 3.0 + upper: inf + lower_limit: 20.0 + type: Uniform + upper_limit: 45.0 + width_modifier: + type: Absolute + value: 8.0 + shape_1: + gaussian_limits: + lower: 3.0 + upper: inf + lower_limit: 20.0 + type: Uniform + upper_limit: 45.0 + width_modifier: + type: Absolute + value: 8.0 diff --git a/test_autolens/config/priors/regularization.yaml b/test_autolens/config/priors/regularization.yaml index c51693dc8..195ba9b2f 100644 --- a/test_autolens/config/priors/regularization.yaml +++ b/test_autolens/config/priors/regularization.yaml @@ -1,39 +1,39 @@ -adaptive_brightness.AdaptiveBrightness: - inner_coefficient: - lower_limit: 0.0 - type: Uniform - upper_limit: 1.0 - outer_coefficient: - lower_limit: 0.0 - type: Uniform - upper_limit: 1.0 - signal_scale: - lower_limit: 0.0 - type: Uniform - upper_limit: 1.0 -constant.Constant: - coefficient: - lower_limit: 0.0 - type: Uniform - upper_limit: 1.0 -constant_zeorth.ConstantZeroth: - coefficient_neighbor: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 - coefficient_zeroth: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 1000000.0 - width_modifier: - type: Relative - value: 0.5 +adaptive_brightness.AdaptiveBrightness: + inner_coefficient: + lower_limit: 0.0 + type: Uniform + upper_limit: 1.0 + outer_coefficient: + lower_limit: 0.0 + type: Uniform + upper_limit: 1.0 + signal_scale: + lower_limit: 0.0 + type: Uniform + upper_limit: 1.0 +constant.Constant: + coefficient: + lower_limit: 0.0 + type: Uniform + upper_limit: 1.0 +constant_zeorth.ConstantZeroth: + coefficient_neighbor: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 + coefficient_zeroth: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 1000000.0 + width_modifier: + type: Relative + value: 0.5 diff --git a/test_autolens/config/priors/stellar_mass_profiles.yaml b/test_autolens/config/priors/stellar_mass_profiles.yaml index ce1f7d9ed..cb68d765e 100644 --- a/test_autolens/config/priors/stellar_mass_profiles.yaml +++ b/test_autolens/config/priors/stellar_mass_profiles.yaml @@ -1,596 +1,596 @@ -DevVaucouleurs: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - effective_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - ell_comps_0: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - ell_comps_1: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - intensity: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 10.0 - width_modifier: - type: Relative - value: 0.5 - mass_to_light_ratio: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 1000.0 - width_modifier: - type: Relative - value: 0.3 -DevVaucouleursSph: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - effective_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - intensity: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 10.0 - width_modifier: - type: Relative - value: 0.5 - mass_to_light_ratio: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 1000.0 - width_modifier: - type: Relative - value: 0.3 -Exponential: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - effective_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - ell_comps_0: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - ell_comps_1: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - intensity: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 10.0 - width_modifier: - type: Relative - value: 0.5 - mass_to_light_ratio: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 1000.0 - width_modifier: - type: Relative - value: 0.3 -ExponentialSph: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - effective_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - intensity: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 10.0 - width_modifier: - type: Relative - value: 0.5 - mass_to_light_ratio: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 1000.0 - width_modifier: - type: Relative - value: 0.3 -Sersic: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - effective_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - ell_comps_0: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - ell_comps_1: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - intensity: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 10.0 - width_modifier: - type: Relative - value: 0.5 - mass_to_light_ratio: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 1000.0 - width_modifier: - type: Relative - value: 0.3 - sersic_index: - gaussian_limits: - lower: 0.8 - upper: 5.0 - lower_limit: 0.8 - type: Uniform - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 -SersicGradient: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - effective_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - ell_comps_0: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - ell_comps_1: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - intensity: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 10.0 - width_modifier: - type: Relative - value: 0.5 - mass_to_light_gradient: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: -1.0 - type: Uniform - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - mass_to_light_ratio: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 1000.0 - width_modifier: - type: Relative - value: 0.3 - sersic_index: - gaussian_limits: - lower: 0.8 - upper: 5.0 - lower_limit: 0.8 - type: Uniform - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 -SersicGradientSph: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - effective_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - intensity: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 10.0 - width_modifier: - type: Relative - value: 0.5 - mass_to_light_gradient: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: -1.0 - type: Uniform - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - mass_to_light_ratio: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 1000.0 - width_modifier: - type: Relative - value: 0.3 - sersic_index: - gaussian_limits: - lower: 0.8 - upper: 5.0 - lower_limit: 0.8 - type: Uniform - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 -SersicSph: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - effective_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 30.0 - width_modifier: - type: Relative - value: 1.0 - intensity: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 10.0 - width_modifier: - type: Relative - value: 0.5 - mass_to_light_ratio: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 1.0e-06 - type: LogUniform - upper_limit: 1000.0 - width_modifier: - type: Relative - value: 0.3 - sersic_index: - gaussian_limits: - lower: 0.8 - upper: 5.0 - lower_limit: 0.8 - type: Uniform - upper_limit: 5.0 - width_modifier: - type: Absolute - value: 1.5 +DevVaucouleurs: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + effective_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + ell_comps_0: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + ell_comps_1: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + intensity: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 10.0 + width_modifier: + type: Relative + value: 0.5 + mass_to_light_ratio: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 1000.0 + width_modifier: + type: Relative + value: 0.3 +DevVaucouleursSph: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + effective_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + intensity: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 10.0 + width_modifier: + type: Relative + value: 0.5 + mass_to_light_ratio: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 1000.0 + width_modifier: + type: Relative + value: 0.3 +Exponential: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + effective_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + ell_comps_0: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + ell_comps_1: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + intensity: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 10.0 + width_modifier: + type: Relative + value: 0.5 + mass_to_light_ratio: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 1000.0 + width_modifier: + type: Relative + value: 0.3 +ExponentialSph: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + effective_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + intensity: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 10.0 + width_modifier: + type: Relative + value: 0.5 + mass_to_light_ratio: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 1000.0 + width_modifier: + type: Relative + value: 0.3 +Sersic: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + effective_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + ell_comps_0: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + ell_comps_1: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + intensity: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 10.0 + width_modifier: + type: Relative + value: 0.5 + mass_to_light_ratio: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 1000.0 + width_modifier: + type: Relative + value: 0.3 + sersic_index: + gaussian_limits: + lower: 0.8 + upper: 5.0 + lower_limit: 0.8 + type: Uniform + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 +SersicGradient: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + effective_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + ell_comps_0: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + ell_comps_1: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + intensity: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 10.0 + width_modifier: + type: Relative + value: 0.5 + mass_to_light_gradient: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: -1.0 + type: Uniform + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + mass_to_light_ratio: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 1000.0 + width_modifier: + type: Relative + value: 0.3 + sersic_index: + gaussian_limits: + lower: 0.8 + upper: 5.0 + lower_limit: 0.8 + type: Uniform + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 +SersicGradientSph: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + effective_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + intensity: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 10.0 + width_modifier: + type: Relative + value: 0.5 + mass_to_light_gradient: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: -1.0 + type: Uniform + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + mass_to_light_ratio: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 1000.0 + width_modifier: + type: Relative + value: 0.3 + sersic_index: + gaussian_limits: + lower: 0.8 + upper: 5.0 + lower_limit: 0.8 + type: Uniform + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 +SersicSph: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + effective_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 30.0 + width_modifier: + type: Relative + value: 1.0 + intensity: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 10.0 + width_modifier: + type: Relative + value: 0.5 + mass_to_light_ratio: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 1.0e-06 + type: LogUniform + upper_limit: 1000.0 + width_modifier: + type: Relative + value: 0.3 + sersic_index: + gaussian_limits: + lower: 0.8 + upper: 5.0 + lower_limit: 0.8 + type: Uniform + upper_limit: 5.0 + width_modifier: + type: Absolute + value: 1.5 diff --git a/test_autolens/config/priors/total_mass_profiles.yaml b/test_autolens/config/priors/total_mass_profiles.yaml index 9fad7a6ee..c657bf654 100644 --- a/test_autolens/config/priors/total_mass_profiles.yaml +++ b/test_autolens/config/priors/total_mass_profiles.yaml @@ -1,491 +1,491 @@ -Isothermal: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - einstein_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 4.0 - width_modifier: - type: Relative - value: 0.05 - ell_comps_0: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - ell_comps_1: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 -IsothermalCore: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - core_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 0.2 - width_modifier: - type: Absolute - value: 0.1 - einstein_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 4.0 - width_modifier: - type: Relative - value: 0.05 - ell_comps_0: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - ell_comps_1: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 -IsothermalCoreSph: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - core_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 0.2 - width_modifier: - type: Absolute - value: 0.1 - einstein_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 4.0 - width_modifier: - type: Relative - value: 0.05 -IsothermalSph: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - einstein_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 4.0 - width_modifier: - type: Relative - value: 0.05 -PointMass: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - einstein_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 8.0 - width_modifier: - type: Relative - value: 0.25 -PowerLaw: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - einstein_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 4.0 - width_modifier: - type: Relative - value: 0.05 - ell_comps_0: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - ell_comps_1: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - slope: - gaussian_limits: - lower: 1.0 - upper: 3.0 - lower_limit: 1.5 - type: Uniform - upper_limit: 3.0 - width_modifier: - type: Absolute - value: 0.2 -PowerLawCore: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - core_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 0.2 - width_modifier: - type: Absolute - value: 0.1 - einstein_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 4.0 - width_modifier: - type: Relative - value: 0.05 - ell_comps_0: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - ell_comps_1: - gaussian_limits: - lower: -1.0 - upper: 1.0 - lower_limit: -1.0 - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: 1.0 - width_modifier: - type: Absolute - value: 0.2 - slope: - gaussian_limits: - lower: 1.0 - upper: 3.0 - lower_limit: 1.5 - type: Uniform - upper_limit: 3.0 - width_modifier: - type: Absolute - value: 0.2 -PowerLawCoreSph: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - core_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 0.2 - width_modifier: - type: Absolute - value: 0.1 - einstein_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 4.0 - width_modifier: - type: Relative - value: 0.05 - slope: - gaussian_limits: - lower: 1.0 - upper: 3.0 - lower_limit: 1.5 - type: Uniform - upper_limit: 3.0 - width_modifier: - type: Absolute - value: 0.2 -PowerLawSph: - centre_0: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - centre_1: - gaussian_limits: - lower: -inf - upper: inf - lower_limit: -inf - mean: 0.0 - sigma: 0.3 - type: Gaussian - upper_limit: inf - width_modifier: - type: Absolute - value: 0.05 - einstein_radius: - gaussian_limits: - lower: 0.0 - upper: inf - lower_limit: 0.0 - type: Uniform - upper_limit: 4.0 - width_modifier: - type: Relative - value: 0.05 - slope: - gaussian_limits: - lower: 1.0 - upper: 3.0 - lower_limit: 1.5 - type: Uniform - upper_limit: 3.0 - width_modifier: - type: Absolute - value: 0.2 +Isothermal: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + einstein_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 4.0 + width_modifier: + type: Relative + value: 0.05 + ell_comps_0: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + ell_comps_1: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 +IsothermalCore: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + core_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 0.2 + width_modifier: + type: Absolute + value: 0.1 + einstein_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 4.0 + width_modifier: + type: Relative + value: 0.05 + ell_comps_0: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + ell_comps_1: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 +IsothermalCoreSph: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + core_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 0.2 + width_modifier: + type: Absolute + value: 0.1 + einstein_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 4.0 + width_modifier: + type: Relative + value: 0.05 +IsothermalSph: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + einstein_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 4.0 + width_modifier: + type: Relative + value: 0.05 +PointMass: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + einstein_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 8.0 + width_modifier: + type: Relative + value: 0.25 +PowerLaw: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + einstein_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 4.0 + width_modifier: + type: Relative + value: 0.05 + ell_comps_0: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + ell_comps_1: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + slope: + gaussian_limits: + lower: 1.0 + upper: 3.0 + lower_limit: 1.5 + type: Uniform + upper_limit: 3.0 + width_modifier: + type: Absolute + value: 0.2 +PowerLawCore: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + core_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 0.2 + width_modifier: + type: Absolute + value: 0.1 + einstein_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 4.0 + width_modifier: + type: Relative + value: 0.05 + ell_comps_0: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + ell_comps_1: + gaussian_limits: + lower: -1.0 + upper: 1.0 + lower_limit: -1.0 + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: 1.0 + width_modifier: + type: Absolute + value: 0.2 + slope: + gaussian_limits: + lower: 1.0 + upper: 3.0 + lower_limit: 1.5 + type: Uniform + upper_limit: 3.0 + width_modifier: + type: Absolute + value: 0.2 +PowerLawCoreSph: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + core_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 0.2 + width_modifier: + type: Absolute + value: 0.1 + einstein_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 4.0 + width_modifier: + type: Relative + value: 0.05 + slope: + gaussian_limits: + lower: 1.0 + upper: 3.0 + lower_limit: 1.5 + type: Uniform + upper_limit: 3.0 + width_modifier: + type: Absolute + value: 0.2 +PowerLawSph: + centre_0: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + centre_1: + gaussian_limits: + lower: -inf + upper: inf + lower_limit: -inf + mean: 0.0 + sigma: 0.3 + type: Gaussian + upper_limit: inf + width_modifier: + type: Absolute + value: 0.05 + einstein_radius: + gaussian_limits: + lower: 0.0 + upper: inf + lower_limit: 0.0 + type: Uniform + upper_limit: 4.0 + width_modifier: + type: Relative + value: 0.05 + slope: + gaussian_limits: + lower: 1.0 + upper: 3.0 + lower_limit: 1.5 + type: Uniform + upper_limit: 3.0 + width_modifier: + type: Absolute + value: 0.2 diff --git a/test_autolens/config/visualize.yaml b/test_autolens/config/visualize.yaml index 389d4ca5e..8e30ff854 100644 --- a/test_autolens/config/visualize.yaml +++ b/test_autolens/config/visualize.yaml @@ -5,7 +5,7 @@ general: zoom_around_mask: true include: include_2d: - border: true + border: false tangential_caustics: false radial_caustics: false tangential_critical_curves: false diff --git a/test_autolens/imaging/test_fit_imaging.py b/test_autolens/imaging/test_fit_imaging.py index c17b82d49..d2ada81de 100644 --- a/test_autolens/imaging/test_fit_imaging.py +++ b/test_autolens/imaging/test_fit_imaging.py @@ -790,50 +790,6 @@ def test__tracer_linear_light_profiles_to_light_profiles(masked_imaging_7x7): assert tracer.galaxies[2].bulge.intensity == pytest.approx(0.08393533428, 1.0e-4) -def test__preloads__refit_with_new_preloads(masked_imaging_7x7): - - g0 = al.Galaxy( - redshift=0.5, - bulge=al.lp.Sersic(intensity=1.0), - mass_profile=al.mp.IsothermalSph(einstein_radius=1.0), - ) - - g1 = al.Galaxy(redshift=1.0, bulge=al.lp.Sersic(intensity=1.0)) - - tracer = al.Tracer(galaxies=[g0, g1]) - - fit = al.FitImaging(dataset=masked_imaging_7x7, tracer=tracer) - - refit = fit.refit_with_new_preloads(preloads=al.Preloads()) - - assert fit.figure_of_merit == refit.figure_of_merit - - refit = fit.refit_with_new_preloads( - preloads=al.Preloads(blurred_image=fit.blurred_image + 1.0) - ) - - assert fit.figure_of_merit != refit.figure_of_merit - - -def test__preloads__blurred_image_uses_preload_when_passed(masked_imaging_7x7_no_blur): - - g0 = al.Galaxy(redshift=0.5, bulge=al.lp.Sersic(intensity=1.0)) - - tracer = al.Tracer(galaxies=[g0]) - - fit = al.FitImaging(dataset=masked_imaging_7x7_no_blur, tracer=tracer) - - assert fit.blurred_image[0] == pytest.approx(0.15987, 1.0e-4) - - blurred_image = np.array([2.0]) - preloads = al.Preloads(blurred_image=blurred_image) - - fit = al.FitImaging( - dataset=masked_imaging_7x7_no_blur, tracer=tracer, preloads=preloads - ) - - assert (fit.blurred_image == np.array([2.0])).all() - def test__total_mappers(masked_imaging_7x7): diff --git a/test_autolens/imaging/test_simulate_and_fit_imaging.py b/test_autolens/imaging/test_simulate_and_fit_imaging.py index bd118dace..f1dc8c990 100644 --- a/test_autolens/imaging/test_simulate_and_fit_imaging.py +++ b/test_autolens/imaging/test_simulate_and_fit_imaging.py @@ -618,49 +618,6 @@ def test__simulate_imaging_data_and_fit__complex_fit_compare_mapping_matrix_w_ti 1.0e-4, ) - preloads = al.Preloads( - linear_func_operated_mapping_matrix_dict=fit_mapping.inversion.linear_func_operated_mapping_matrix_dict, - data_linear_func_matrix_dict=fit_mapping.inversion.data_linear_func_matrix_dict - ) - - fit_w_tilde = al.FitImaging( - dataset=masked_dataset, - tracer=tracer, - preloads=preloads, - settings_inversion=al.SettingsInversion(use_w_tilde=True), - ) - - assert fit_mapping.inversion.curvature_matrix == pytest.approx( - fit_w_tilde.inversion.curvature_matrix, - 1.0e-4, - ) - - assert fit_mapping.inversion.regularization_matrix == pytest.approx( - fit_w_tilde.inversion.regularization_matrix, - 1.0e-4, - ) - - preloads = al.Preloads( - mapper_operated_mapping_matrix_dict=fit_mapping.inversion.mapper_operated_mapping_matrix_dict, - ) - - fit_w_tilde = al.FitImaging( - dataset=masked_dataset, - tracer=tracer, - preloads=preloads, - settings_inversion=al.SettingsInversion(use_w_tilde=True), - ) - - assert fit_mapping.inversion.curvature_matrix == pytest.approx( - fit_w_tilde.inversion.curvature_matrix, - 1.0e-4, - ) - - assert fit_mapping.inversion.regularization_matrix == pytest.approx( - fit_w_tilde.inversion.regularization_matrix, - 1.0e-4, - ) - def test__fit_figure_of_merit__mge_mass_model(masked_imaging_7x7, masked_imaging_covariance_7x7): diff --git a/test_autolens/point/files/point_dict.json b/test_autolens/point/files/point_dict.json index ab232721d..6f3bd0e8e 100644 --- a/test_autolens/point/files/point_dict.json +++ b/test_autolens/point/files/point_dict.json @@ -1,36 +1,36 @@ -[ - { - "name": "source_1", - "positions": [ - [ - 1.0, - 1.0 - ] - ], - "positions_noise_map": [ - 1.0 - ], - "fluxes": null, - "fluxes_noise_map": null - }, - { - "name": "source_2", - "positions": [ - [ - 1.0, - 1.0 - ] - ], - "positions_noise_map": [ - 1.0 - ], - "fluxes": [ - 2.0, - 3.0 - ], - "fluxes_noise_map": [ - 4.0, - 5.0 - ] - } +[ + { + "name": "source_1", + "positions": [ + [ + 1.0, + 1.0 + ] + ], + "positions_noise_map": [ + 1.0 + ], + "fluxes": null, + "fluxes_noise_map": null + }, + { + "name": "source_2", + "positions": [ + [ + 1.0, + 1.0 + ] + ], + "positions_noise_map": [ + 1.0 + ], + "fluxes": [ + 2.0, + 3.0 + ], + "fluxes_noise_map": [ + 4.0, + 5.0 + ] + } ] \ No newline at end of file diff --git a/test_autolens/point/test_point_source_dataset.py b/test_autolens/point/test_point_source_dataset.py index d0a53325c..2e10fd722 100644 --- a/test_autolens/point/test_point_source_dataset.py +++ b/test_autolens/point/test_point_source_dataset.py @@ -1,14 +1,14 @@ -import autolens as al - - -def test__info(): - dataset = al.PointDataset( - "name", - positions=al.Grid2DIrregular([(1, 2)]), - positions_noise_map=al.ArrayIrregular([1]), - fluxes=al.ArrayIrregular([2]), - fluxes_noise_map=al.ArrayIrregular([3]), - ) - - assert "name" in dataset.info - assert "positions : Grid2DIrregular" in dataset.info +import autolens as al + + +def test__info(): + dataset = al.PointDataset( + "name", + positions=al.Grid2DIrregular([(1, 2)]), + positions_noise_map=al.ArrayIrregular([1]), + fluxes=al.ArrayIrregular([2]), + fluxes_noise_map=al.ArrayIrregular([3]), + ) + + assert "name" in dataset.info + assert "positions : Grid2DIrregular" in dataset.info diff --git a/test_autolens/point/triangles/conftest.py b/test_autolens/point/triangles/conftest.py index 3c3620630..1aec734ea 100644 --- a/test_autolens/point/triangles/conftest.py +++ b/test_autolens/point/triangles/conftest.py @@ -1,30 +1,30 @@ -import pytest -import autolens as al - - -@pytest.fixture -def grid(): - return al.Grid2D.uniform( - shape_native=(10, 10), - pixel_scales=1.0, - ) - - -@pytest.fixture -def tracer(): - isothermal_mass_profile = al.mp.Isothermal( - centre=(0.0, 0.0), - einstein_radius=1.6, - ell_comps=al.convert.ell_comps_from(axis_ratio=0.9, angle=45.0), - ) - - lens_galaxy = al.Galaxy( - redshift=0.5, - mass=isothermal_mass_profile, - ) - - point_source = al.ps.Point(centre=(0.07, 0.07)) - - source_galaxy = al.Galaxy(redshift=1.0, point_0=point_source) - - return al.Tracer(galaxies=[lens_galaxy, source_galaxy]) +import pytest +import autolens as al + + +@pytest.fixture +def grid(): + return al.Grid2D.uniform( + shape_native=(10, 10), + pixel_scales=1.0, + ) + + +@pytest.fixture +def tracer(): + isothermal_mass_profile = al.mp.Isothermal( + centre=(0.0, 0.0), + einstein_radius=1.6, + ell_comps=al.convert.ell_comps_from(axis_ratio=0.9, angle=45.0), + ) + + lens_galaxy = al.Galaxy( + redshift=0.5, + mass=isothermal_mass_profile, + ) + + point_source = al.ps.Point(centre=(0.07, 0.07)) + + source_galaxy = al.Galaxy(redshift=1.0, point_0=point_source) + + return al.Tracer(galaxies=[lens_galaxy, source_galaxy]) diff --git a/test_autolens/point/triangles/test_jax.py b/test_autolens/point/triangles/test_jax.py index aac41330b..6f3b30e31 100644 --- a/test_autolens/point/triangles/test_jax.py +++ b/test_autolens/point/triangles/test_jax.py @@ -1,12 +1,12 @@ -import autofit as af -from autogalaxy.profiles.mass import Isothermal - - -def test_isothermal_pytree(): - model = af.Model(Isothermal) - - children, aux = model.instance_flatten(Isothermal()) - instance = model.instance_unflatten(aux, children) - - assert isinstance(instance, Isothermal) - assert instance.centre == (0.0, 0.0) +import autofit as af +from autogalaxy.profiles.mass import Isothermal + + +def test_isothermal_pytree(): + model = af.Model(Isothermal) + + children, aux = model.instance_flatten(Isothermal()) + instance = model.instance_unflatten(aux, children) + + assert isinstance(instance, Isothermal) + assert instance.centre == (0.0, 0.0) diff --git a/test_autolens/point/triangles/test_regressions.py b/test_autolens/point/triangles/test_regressions.py index f4aa1dbab..c1fc9d5db 100644 --- a/test_autolens/point/triangles/test_regressions.py +++ b/test_autolens/point/triangles/test_regressions.py @@ -1,76 +1,76 @@ -from autoconf.dictable import from_dict -import autolens as al -from autolens.point.solver import PointSolver - - -instance_dict = { - "type": "instance", - "class_path": "autofit.mapper.model.ModelInstance", - "arguments": { - "child_items": { - "type": "dict", - "arguments": { - "source_galaxy": { - "type": "instance", - "class_path": "autogalaxy.galaxy.galaxy.Galaxy", - "arguments": { - "redshift": 1.0, - "label": "cls6", - "light": { - "type": "instance", - "class_path": "autogalaxy.profiles.light.standard.exponential.Exponential", - "arguments": { - "effective_radius": 0.1, - "ell_comps": [0.4731722153284571, -0.27306667016189645], - "centre": [-0.04829335038475, 0.02350935356045], - "intensity": 0.1, - }, - }, - "point_0": { - "type": "instance", - "class_path": "autogalaxy.profiles.point_source.Point", - "arguments": { - "centre": [-0.04829335038475, 0.02350935356045] - }, - }, - }, - }, - "lens_galaxy": { - "type": "instance", - "class_path": "autogalaxy.galaxy.galaxy.Galaxy", - "arguments": { - "redshift": 0.5, - "label": "cls6", - "mass": { - "type": "instance", - "class_path": "autogalaxy.profiles.mass.total.isothermal.Isothermal", - "arguments": { - "ell_comps": [ - 0.05263157894736841, - 3.2227547345982974e-18, - ], - "einstein_radius": 1.6, - "centre": [0.0, 0.0], - }, - }, - }, - }, - }, - } - }, -} - - -def test_missing_multiple_image(grid): - instance = from_dict(instance_dict) - - tracer = al.Tracer(galaxies=[instance.lens_galaxy, instance.source_galaxy]) - - solver = PointSolver.for_grid( - grid=grid, - pixel_scale_precision=0.001, - ) - - triangle_positions = solver.solve( - tracer=tracer, source_plane_coordinate=instance.source_galaxy.point_0.centre - ) +from autoconf.dictable import from_dict +import autolens as al +from autolens.point.solver import PointSolver + + +instance_dict = { + "type": "instance", + "class_path": "autofit.mapper.model.ModelInstance", + "arguments": { + "child_items": { + "type": "dict", + "arguments": { + "source_galaxy": { + "type": "instance", + "class_path": "autogalaxy.galaxy.galaxy.Galaxy", + "arguments": { + "redshift": 1.0, + "label": "cls6", + "light": { + "type": "instance", + "class_path": "autogalaxy.profiles.light.standard.exponential.Exponential", + "arguments": { + "effective_radius": 0.1, + "ell_comps": [0.4731722153284571, -0.27306667016189645], + "centre": [-0.04829335038475, 0.02350935356045], + "intensity": 0.1, + }, + }, + "point_0": { + "type": "instance", + "class_path": "autogalaxy.profiles.point_source.Point", + "arguments": { + "centre": [-0.04829335038475, 0.02350935356045] + }, + }, + }, + }, + "lens_galaxy": { + "type": "instance", + "class_path": "autogalaxy.galaxy.galaxy.Galaxy", + "arguments": { + "redshift": 0.5, + "label": "cls6", + "mass": { + "type": "instance", + "class_path": "autogalaxy.profiles.mass.total.isothermal.Isothermal", + "arguments": { + "ell_comps": [ + 0.05263157894736841, + 3.2227547345982974e-18, + ], + "einstein_radius": 1.6, + "centre": [0.0, 0.0], + }, + }, + }, + }, + }, + } + }, +} + + +def test_missing_multiple_image(grid): + instance = from_dict(instance_dict) + + tracer = al.Tracer(galaxies=[instance.lens_galaxy, instance.source_galaxy]) + + solver = PointSolver.for_grid( + grid=grid, + pixel_scale_precision=0.001, + ) + + triangle_positions = solver.solve( + tracer=tracer, source_plane_coordinate=instance.source_galaxy.point_0.centre + )