Strong Gravitational Lensing for the masses
Project description
<!DOCTYPE html>
<html>
<head>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css" rel="stylesheet">
<style>
body {
font-family: sans-serif;
}
code, pre {
font-family: monospace;
}
h1 code,
h2 code,
h3 code,
h4 code,
h5 code,
h6 code {
font-size: inherit;
}
</style>
</head>
<body>
<div class="container">
<h1>PyAutoLens</h1>
<p>PyAutoLens makes it simple to model strong gravitational lenses. It is based on the following papers:</p>
<p>https://arxiv.org/abs/1412.7436<br/>
https://arxiv.org/abs/1708.07377</p>
<h2>SLACK</h2>
<p>We’re building a PyAutoLens community on SLACK, so you should contact us on our <a href="https://pyautolens.slack.com/">SLACK channel</a> before getting started with PyAutoLens. Here, I can introduce you to the community, give you the latest update on the software and discuss how best to use PyAutoLens for your science case.</p>
<p>Unfortunately, SLACK is invitation-only, so first send me an <a href="https://github.com/Jammy2211">email</a> requesting an invite.</p>
<h2>Installation</h2>
<p>AutoLens requires <a href="http://johannesbuchner.github.io/pymultinest-tutorial/install.html">PyMultiNest</a> and <a href="https://github.com/numba/numba">Numba</a>.</p>
<pre><code>$ pip install autolens
</code></pre>
<p>Known issues with the installation can be found in the file <a href="https://github.com/Jammy2211/PyAutoLens/blob/master/INSTALL.notes">INSTALL.notes</a></p>
<h2>Python Example</h2>
<p>With PyAutoLens, you can begin modeling a lens in just a couple of minutes. The example below demonstrates a simple analysis which fits a lens galaxy’s light, mass and a source galaxy.</p>
<pre><code class="python">from autolens.pipeline import phase as ph
from autolens.autofit import non_linear as nl
from autolens.lensing import galaxy_prior as gp
from autolens.imaging import image as im
from autolens.profiles import light_profiles as lp
from autolens.profiles import mass_profiles as mp
from autolens.plotting import fitting_plotters
import os
# In this example, we'll generate a phase which fits a lens + source plane system.
# First, lets setup the path to this script so we can easily load the example data.
path = "{}".format(os.path.dirname(os.path.realpath(__file__)))
# Now, load the image, noise-map and PSF from the 'data' folder.
image = im.load_imaging_from_path(image_path=path + '/data/image.fits',
noise_map_path=path + '/data/noise_map.fits',
psf_path=path + '/data/psf.fits', pixel_scale=0.1)
# We're going to model our lens galaxy using a light profile (an elliptical Sersic) and mass profile
# (a singular isothermal sphere). We load these profiles from the 'light_profile (lp)' and 'mass_profile (mp)'
# modules (check out the source code to see all the profiles that are available).
# To setup our model galaxies, we use the 'galaxy_model' module and GalaxyModel class.
# A GalaxyModel represents a galaxy where the parameters of its associated profiles are
# variable and fitted for by the analysis.
lens_galaxy_model = gp.GalaxyModel(light=lp.AbstractEllipticalSersic, mass=mp.EllipticalIsothermal)
source_galaxy_model = gp.GalaxyModel(light=lp.AbstractEllipticalSersic)
# To perform the analysis, we set up a phase using the 'phase' module (imported as 'ph').
# A phase takes our galaxy models and fits their parameters using a non-linear search (in this case, MultiNest).
phase = ph.LensSourcePlanePhase(lens_galaxies=[lens_galaxy_model], source_galaxies=[source_galaxy_model],
optimizer_class=nl.MultiNest, phase_name='phase_example')
# We run the phase on the image, print the results and plot the fit.
results = phase.run(image)
print(results)
fitting_plotters.plot_fitting_subplot(fit=results.fit)
</code></pre>
<h2>Advanced Lens Modeling</h2>
<p>The example above shows the simplest analysis one can perform in PyAutoLens. PyAutoLens’s advanced modeling features include:</p>
<ul>
<li><strong>Pipelines</strong> - build automated analysis pipelines to fit complex lens models to large samples of strong lenses.</li>
<li><strong>Inversions</strong> - Reconstruct complex source galaxy morphologies on a variety of pixel-grids.</li>
<li><strong>Adaption</strong> - (October 2018) - Adapt the lensing analysis to the features of the observed strong lens imaging.</li>
<li><strong>Multi-Plane</strong> - (November 2018) Model multi-plane lenses, including systems with multiple lensed source galaxies.</li>
</ul>
<h2>HowToLens</h2>
<p>Detailed tutorials demonstrating how to use PyAutoLens can be found in the ‘howtolens’ folder:</p>
<ul>
<li><strong>Introduction</strong> - How to use PyAutolens, familiarizing you with the interface and project structure.</li>
<li><strong>Lens Modeling</strong> - How to model strong lenses, including a primer on Bayesian non-linear analysis.</li>
<li><strong>Pipelines</strong> - How to build pipelines and tailor them to your own science case.</li>
<li><strong>Inversions</strong> - How to perform pixelized reconstructions of the source-galaxy.</li>
</ul>
<h2>Support & Discussion</h2>
<p>If you’re having difficulty with installation, lens modeling, or just want a chat, feel free to message us on our <a href="https://pyautolens.slack.com/">SLACK channel</a>.</p>
<h2>Contributing</h2>
<p>If you have any suggestions or would like to contribute please get in touch.</p>
</div>
</body>
</html>
<html>
<head>
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.0/css/bootstrap-combined.min.css" rel="stylesheet">
<style>
body {
font-family: sans-serif;
}
code, pre {
font-family: monospace;
}
h1 code,
h2 code,
h3 code,
h4 code,
h5 code,
h6 code {
font-size: inherit;
}
</style>
</head>
<body>
<div class="container">
<h1>PyAutoLens</h1>
<p>PyAutoLens makes it simple to model strong gravitational lenses. It is based on the following papers:</p>
<p>https://arxiv.org/abs/1412.7436<br/>
https://arxiv.org/abs/1708.07377</p>
<h2>SLACK</h2>
<p>We’re building a PyAutoLens community on SLACK, so you should contact us on our <a href="https://pyautolens.slack.com/">SLACK channel</a> before getting started with PyAutoLens. Here, I can introduce you to the community, give you the latest update on the software and discuss how best to use PyAutoLens for your science case.</p>
<p>Unfortunately, SLACK is invitation-only, so first send me an <a href="https://github.com/Jammy2211">email</a> requesting an invite.</p>
<h2>Installation</h2>
<p>AutoLens requires <a href="http://johannesbuchner.github.io/pymultinest-tutorial/install.html">PyMultiNest</a> and <a href="https://github.com/numba/numba">Numba</a>.</p>
<pre><code>$ pip install autolens
</code></pre>
<p>Known issues with the installation can be found in the file <a href="https://github.com/Jammy2211/PyAutoLens/blob/master/INSTALL.notes">INSTALL.notes</a></p>
<h2>Python Example</h2>
<p>With PyAutoLens, you can begin modeling a lens in just a couple of minutes. The example below demonstrates a simple analysis which fits a lens galaxy’s light, mass and a source galaxy.</p>
<pre><code class="python">from autolens.pipeline import phase as ph
from autolens.autofit import non_linear as nl
from autolens.lensing import galaxy_prior as gp
from autolens.imaging import image as im
from autolens.profiles import light_profiles as lp
from autolens.profiles import mass_profiles as mp
from autolens.plotting import fitting_plotters
import os
# In this example, we'll generate a phase which fits a lens + source plane system.
# First, lets setup the path to this script so we can easily load the example data.
path = "{}".format(os.path.dirname(os.path.realpath(__file__)))
# Now, load the image, noise-map and PSF from the 'data' folder.
image = im.load_imaging_from_path(image_path=path + '/data/image.fits',
noise_map_path=path + '/data/noise_map.fits',
psf_path=path + '/data/psf.fits', pixel_scale=0.1)
# We're going to model our lens galaxy using a light profile (an elliptical Sersic) and mass profile
# (a singular isothermal sphere). We load these profiles from the 'light_profile (lp)' and 'mass_profile (mp)'
# modules (check out the source code to see all the profiles that are available).
# To setup our model galaxies, we use the 'galaxy_model' module and GalaxyModel class.
# A GalaxyModel represents a galaxy where the parameters of its associated profiles are
# variable and fitted for by the analysis.
lens_galaxy_model = gp.GalaxyModel(light=lp.AbstractEllipticalSersic, mass=mp.EllipticalIsothermal)
source_galaxy_model = gp.GalaxyModel(light=lp.AbstractEllipticalSersic)
# To perform the analysis, we set up a phase using the 'phase' module (imported as 'ph').
# A phase takes our galaxy models and fits their parameters using a non-linear search (in this case, MultiNest).
phase = ph.LensSourcePlanePhase(lens_galaxies=[lens_galaxy_model], source_galaxies=[source_galaxy_model],
optimizer_class=nl.MultiNest, phase_name='phase_example')
# We run the phase on the image, print the results and plot the fit.
results = phase.run(image)
print(results)
fitting_plotters.plot_fitting_subplot(fit=results.fit)
</code></pre>
<h2>Advanced Lens Modeling</h2>
<p>The example above shows the simplest analysis one can perform in PyAutoLens. PyAutoLens’s advanced modeling features include:</p>
<ul>
<li><strong>Pipelines</strong> - build automated analysis pipelines to fit complex lens models to large samples of strong lenses.</li>
<li><strong>Inversions</strong> - Reconstruct complex source galaxy morphologies on a variety of pixel-grids.</li>
<li><strong>Adaption</strong> - (October 2018) - Adapt the lensing analysis to the features of the observed strong lens imaging.</li>
<li><strong>Multi-Plane</strong> - (November 2018) Model multi-plane lenses, including systems with multiple lensed source galaxies.</li>
</ul>
<h2>HowToLens</h2>
<p>Detailed tutorials demonstrating how to use PyAutoLens can be found in the ‘howtolens’ folder:</p>
<ul>
<li><strong>Introduction</strong> - How to use PyAutolens, familiarizing you with the interface and project structure.</li>
<li><strong>Lens Modeling</strong> - How to model strong lenses, including a primer on Bayesian non-linear analysis.</li>
<li><strong>Pipelines</strong> - How to build pipelines and tailor them to your own science case.</li>
<li><strong>Inversions</strong> - How to perform pixelized reconstructions of the source-galaxy.</li>
</ul>
<h2>Support & Discussion</h2>
<p>If you’re having difficulty with installation, lens modeling, or just want a chat, feel free to message us on our <a href="https://pyautolens.slack.com/">SLACK channel</a>.</p>
<h2>Contributing</h2>
<p>If you have any suggestions or would like to contribute please get in touch.</p>
</div>
</body>
</html>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
autolens-0.5.0.tar.gz
(282.6 kB
view hashes)
Built Distribution
autolens-0.5.0-py2.py3-none-any.whl
(460.8 kB
view hashes)
Close
Hashes for autolens-0.5.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58249a5f9a378cca424131d06955e02f4cd2b1f609e8fa920c9d552048ee4372 |
|
MD5 | f1974916ef61d240d055fce7b749f20f |
|
BLAKE2b-256 | e18ebb232929fb63632fd92c1623732632e8be1b4ef2f31e84bba3957420c89c |