PyAutoLens Versions Save

PyAutoLens: Open Source Strong Gravitational Lensing

2024.5.16.0

2 days ago

PyAutoFit:

PR: https://github.com/rhayes777/PyAutoFit/pull/994 Example: https://github.com/Jammy2211/autofit_workspace/blob/release/notebooks/cookbooks/analysis.ipynb

PyAutoGalaxy / PyAutoLens:

2024.1.27.4

3 months ago
  • Log10 plots implemented in 1D and 2D, which show certain quantities (e.g. galaxy convergence) more clear and include contours showing log10 values:

image

  • Improved subplots including addition of log10 panels:

image

  • Pixelization API now has separate entry for an image_mesh, defining how the source pixel centres are computed (E.g. using a KMeans clustering) and the mesh is now just the method (e.g. Delaunay):
pixelization = al.Pixelization(
    image_mesh=al.image_mesh.Overlay(shape=(25, 25)),
    mesh=al.mesh.Delaunay(),
    regularization=al.reg.Constant(coefficient=1.0),
)
  • Implemented Hilbert image-mesh which is a significant improvement on KMeans clustering for creating the distribution of source pixels for a pixelization and inversion.

  • Simplified adapt_dataset API to now only pass via an AdaptImage class, which is not passed as Galaxy attributes anymore but instead through the FitImaging object.

  • Removed SetupAdapt object and pass image_mesh_pixels as an integer through pipelines.

  • Added Exponential / Gaussian smoothing kernels for regularization documented in Vernardos 2022 (https://arxiv.org/abs/2202.09378)

2023.10.23.3

6 months ago
  • Support for Python 3.11 by updating requirement on core libraries (e.g. numpy, scipy, scikit-learn).
  • Fix issues with sqlite database following switch from .pickle outputs to .json / .fits / .csv.
  • Database use of Samples object much more efficient.
  • Methods to output classes to hard-disk (e.g. output_to_json, from_json, to_dict) are now all handled and called from autoconf.
  • Fix bug where nautilus parallel fits sometimes crashed.
  • Fix bug where nautilus single CPU fits did not work.

2023.9.18.4

8 months ago

This release implements two major changes to PyAutoLens:

Nautilus:

For the past ~3 years, lens model fitting has used the nested sampling algorithm Dynesty.

Recently, a new nested sampler, Nautilus (https://nautilus-sampler.readthedocs.io/en/stable/), was released, which uses machine-learning based techniques to improve sampling.

Extensive testing of lens modeling with Nautilus has revealed that it:

  • Speeds up the fitting of simple lens models by ~x2 - x3.
  • Speeds up the fitting of complex lens models by ~x3 - x5+.
  • Is more robust and reliable (e.g less likely to infer a local maxima, can fit more complex lens models).
  • Controlled predominantly by just one parameter n_live, so is simpler to use than dynesty.
  • Parallelization using Python multiprocessing is more efficient than dynesty and now supports proper error handling.

Nautilus is therefore now the default lens modeler, with all workspace examples updated accordingly.

NOTE: Nautilus does not currently support on-the-fly output and to get the results of a lens model mid-fit a user can instead cancel the run (e.g. via Ctrl + C) and restart it, where the maximum likelihood model will be output.

Results Output

Result metadata was previously output as .pickle files, which were not human readable and depended on project imports, hurting backwards compatibility.

All metadata is now output as human readable .json files and dataset as .fits files, making it a lot more straight forward for a user to interpret how data is stored internally within PyAutoLens:

image

Here is an example of the search.json file:

image

All internal functionality (e.g. the sqlite database) has been updated to use these files.

All workspace documentation has been updated accordingly.

Other:

  • imaging/modeling/features split to make linear light profiles and multi gaussian expansion more visible.
  • Improved HowToLens tutorial 5 on linear light profiles.
  • Power law with multipole parameterization updated, now supports multipoles of any order (https://github.com/Jammy2211/PyAutoGalaxy/pull/115).
  • Update certain requirements (e.g. PyYAML) to mitigate installation issues (https://github.com/rhayes777/PyAutoConf/pull/41).
  • Lots of quality-of-life improvements thoughout the code bases.

2023.7.5.2

10 months ago

Bug fixes for new MacOS parallelization.

No new features.

2023.6.18.3

10 months ago
  • Fixes bug so that the all_at_end_png and all_at_end_fits visualization configuration options now actually do output all images at the end of a model-fit as .png and .fits files.

  • Fixes bug so that pixelized source reconstructions are output as .fits files at the end.

  • Fixes bug so that visuals at end display correctly.

2023.6.12.5

11 months ago
  • Visualization now outputs publication quality plots by default (e.g. less whitespace, bigger tick labels, units):

https://github.com/Jammy2211/PyAutoGalaxy/pull/96 https://github.com/Jammy2211/PyAutoLens/pull/216

  • Improved visualization of FitImaging and FitInterferometer subpots:

https://github.com/Jammy2211/PyAutoGalaxy/pull/96

  • Profiling tools implemented, with documentation and examples added to workspace:

https://github.com/Jammy2211/PyAutoGalaxy/pull/110

  • PowerLawMultipole method generalized to all multipoles:

https://github.com/Jammy2211/PyAutoGalaxy/pull/103

  • Critical Curves / Caustic plotter separating if there are more than one, and options to customize tangential and radial separately:

https://github.com/Jammy2211/PyAutoGalaxy/pull/92

  • SMBH and SMBHBinary super massive black hole mass profiles implemented:

https://github.com/Jammy2211/PyAutoGalaxy/pull/98 https://github.com/Jammy2211/PyAutoGalaxy/pull/99

  • Fix issues associated with visualization of linear light profiles and Basis objects:

https://github.com/Jammy2211/PyAutoGalaxy/pull/102 https://github.com/Jammy2211/PyAutoLens/pull/217

  • PowerLaw potential_2d_from method faster:

https://github.com/Jammy2211/PyAutoGalaxy/pull/108

  • ExternalShear now has potential_2d_from method implemented:

https://github.com/Jammy2211/PyAutoGalaxy/pull/109

  • Removal of a number of unused legacy features (e.g. hyper galaxy noise scaling).

https://github.com/Jammy2211/PyAutoLens/pull/219

2023.3.21.5

1 year ago

This is the latest version, which primarily brings in stability upgrades and fixes bugs.

2023.1.15.1

1 year ago

This is a major release, which updates many aspects of the API, switches configuration files to YAML, requirements, etc.

API Changes:

  • All elliptical light profiles and mass profiles no longer prefix with the Ell tag, for conciseness / readability. For example, EllSersic is now just Sersic, and EllIsothermal is now Isothermal.
  • The Sph prefix is now a suffix, for example SphSersic is now SersicSph and SphIsothermal is now Isothermal.
  • The ``elliptical_componentsparameter has been shorted toell_comps`.
  • The ExternalShear input has been changed from elliptical_components to gamma_1 and gamma_2 (the shear is still defined the same, where in the olversion version elliptical_components[0] = gamma_2 and elliptical_components[1] = gamma_1.
  • The manual_ API for data structures (e.g. Array2D, Grid2D) has been removed.

Yaml Configs

Linear Light Profiles / Basis / Multi Gaussian Expansion

Linear light profiles are now supported, which are identical to ordinary light profiles but the intensity parameter is solved for via linear algebra. This means lower dimensionality models can be fitted, making dynesty converge more reliably:

https://github.com/Jammy2211/autolens_workspace/blob/release/scripts/imaging/modeling/light_parametric_linear__mass_total__source_parametric_linear.py

Fits use a Basis object composed of many linear light profiles are supports, for example using a Multi Gaussian Expansion of 20+ Gaussians to fit the lens's light:

https://github.com/Jammy2211/autolens_workspace/blob/release/scripts/imaging/modeling/light_parametric_linear__mass_total__source_parametric_linear.py

These features are described fully in the following HowToLens tutorial:

https://github.com/Jammy2211/autolens_workspace/blob/release/scripts/howtolens/chapter_2_lens_modeling/tutorial_5_linear_profiles.py

API Documentation

API documentation on readthedocs is now being written, which is still a work in progress but more useable than it was previously (https://pyautolens.readthedocs.io/en/latest/api/data.html).

SLaM V2

The Source, Light and Mass (SLaM) pipelines have been updated to a version 2, which simplifies the pipelines and makes the API more concise (https://github.com/Jammy2211/autolens_workspace/tree/release/slam).

Requirements

The requirements of many projects have been updated to their latest versions, most notably dynesty v2.0.2.