# PyAutoLens
PyAutoLens makes it simple to model strong gravitational lenses. It is based on the following papers:
https://arxiv.org/abs/1412.7436<br/>
https://arxiv.org/abs/1708.07377
## Slack
We're building a PyAutoLens community on Slack, so you should contact us on our [Slack channel](https://pyautolens.slack.com/) 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.
Unfortunately, Slack is invitation-only, so first send me an [email](https://github.com/Jammy2211) requesting an invite.
## Installation with Docker
We recommend you install AutoLens using Docker. It makes installation easier by containerising the project.
If you don't have Docker then you can install it by following the guide [here](https://docs.docker.com/install/).
Once you have Docker installed you can download the AutoLens Docker project with the command:
```
docker pull rhayes777/autolens
```
This command can also be used to update the project.
The project can be run using:
```
docker run -it -e LOCAL_USER_ID=`id -u $USER` -h autolens -p 8888:8888 -p 6006:6006 -v $HOME/autolens_workspace:/home/user/workspace rhayes777/autolens
```
Once the project is running Docker will provide you with a URL. Copy and paste this URL into your browser, making sure you replace '(PyAutoLens or 127.0.0.1)' with '127.0.0.1'. This will bring up a Jupyter notebook including the 'howtolens' directory which is full of tutorials.
Any changes you make inside the Docker workspace will be saved in the autolens_workspace in your home directory.
## Installation with pip
Installation is also available via pip, however there are a number of dependencies that can be installation difficult, see the file [INSTALL.notes](https://github.com/Jammy2211/PyAutoLens/blob/master/INSTALL.notes)
AutoLens requires [PyMultiNest](http://johannesbuchner.github.io/pymultinest-tutorial/install.html) and [Numba](https://github.com/numba/numba).
```
$ pip install autolens
```
## Workspace
If you install AutoLens with Docker a workspace will be generated for you in the home directory the first time you run the image. This contains configuration, examples and tutorials. After the first time you run docker the workspace will persist any changes you make and won't be updated again.
If you installed AutoLens with pip or want to get access to the latest workspace then you can download it from [here](https://drive.google.com/open?id=1QOwXBy2CFmdngN35tjQ4AsoiEHKWpoHR).
## Features
PyAutoLens's advanced modeling features include:
- **Pipelines** - build automated analysis pipelines to fit complex lens models to large samples of strong lenses.
- **Inversions** - Reconstruct complex source galaxy morphologies on a variety of pixel-grids.
- **Adaption** - (November 2018) - Adapt the lensing analysis to the features of the observed strong lens imaging.
- **Multi-Plane** - (December 2018) Model multi-plane lenses, including systems with multiple lensed source galaxies.
## HowToLens
Detailed tutorials demonstrating how to use PyAutoLens can be found in the 'workspace/howtolens' folder:
- **Introduction** - An introduction to strong gravitational lensing and PyAutolens, familiarizing you with the interface and project structure.
- **Lens Modeling** - How to model strong lenses, including a primer on Bayesian non-linear analysis.
- **Pipelines** - How to build pipelines and tailor them to your own science case.
- **Inversions** - How to perform pixelized reconstructions of the source-galaxy.
## Support & Discussion
If you're having difficulty with installation, lens modeling, or just want a chat, feel free to message us on our [Slack channel](https://pyautolens.slack.com/).
## Contributing
If you have any suggestions or would like to contribute please get in touch.
## Python Example
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.
```python
from autolens.pipeline import phase as ph
from autolens.autofit import non_linear as nl
from autolens.lensing import galaxy_model as gm
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_maps.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 = gm.GalaxyModel(light=lp.AbstractEllipticalSersic, mass=mp.EllipticalIsothermal)
source_galaxy_model = gm.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)
```
没有合适的资源?快使用搜索试试~ 我知道了~
PyPI 官网下载 | autolens-0.7.0.tar.gz
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 68 浏览量
2022-01-09
06:17:12
上传
评论
收藏 324KB GZ 举报
温馨提示
共344个文件
py:339个
pkg-info:1个
txt:1个
资源来自pypi官网。 资源全名:autolens-0.7.0.tar.gz
资源推荐
资源详情
资源评论
收起资源包目录
PyPI 官网下载 | autolens-0.7.0.tar.gz (344个子文件)
setup.cfg 67B
MANIFEST.in 378B
README.md 6KB
PKG-INFO 8KB
test_ray_tracing.py 105KB
test_lensing_fitting.py 104KB
test_plane.py 79KB
test_mass_profiles.py 75KB
test_non_linear.py 74KB
test_image.py 74KB
phase.py 58KB
test_mask.py 58KB
mass_profiles.py 55KB
test_interpolation.py 49KB
test_mask_util.py 49KB
test_model_mapper.py 46KB
model_mapper.py 41KB
test_grid_util.py 39KB
test_scaled_array.py 38KB
lensing_fitting_plotters.py 37KB
mask.py 37KB
lensing_fitting.py 35KB
test_mappers.py 35KB
fitting.py 34KB
test_galaxy.py 32KB
test_convolution.py 29KB
image.py 28KB
test_fitting.py 28KB
non_linear.py 25KB
ray_tracing.py 23KB
test_pixelizations.py 22KB
test_integration.py 22KB
test_regularization.py 21KB
test_light_profiles.py 21KB
test_galaxy_fitting.py 21KB
galaxy_plotters.py 20KB
light_profiles.py 20KB
test_galaxy_model.py 19KB
jitted_1.py 19KB
original_0.py 18KB
tutorial_4_dealing_with_failure.py 18KB
jitted_0.py 18KB
test_geometry_profiles.py 18KB
original.py 17KB
test_phase.py 17KB
plane.py 17KB
mappers.py 17KB
galaxy_fitting_plotters.py 17KB
tutorial_5_borders.py 17KB
original_1.py 16KB
scaled_array.py 16KB
jitted.py 15KB
pixelizations.py 15KB
ray_tracing_plotters.py 15KB
fitting_plotters.py 14KB
original.py 14KB
galaxy.py 14KB
galaxy_model.py 14KB
convolution.py 13KB
original.py 13KB
regularization.py 13KB
tutorial_3_inversions.py 13KB
tutorial_5_linking_phases.py 13KB
interpolation.py 13KB
imaging_plotters.py 13KB
test_inversions.py 12KB
test_galaxy_data.py 12KB
original.py 12KB
geometry_profiles.py 12KB
tutorial_6_lens_modeling.py 12KB
tutorial_4_bayesian_regularization.py 11KB
test_array_util.py 11KB
mapper_plotters.py 11KB
tutorial_2_parameter_space_and_priors.py 11KB
plane_plotters.py 10KB
tutorial_7_masking_and_positions.py 10KB
galaxy_data.py 10KB
grid_util.py 10KB
tutorial_4_plane.py 10KB
original.py 10KB
tutorial_3_realism_and_complexity.py 10KB
test_mapping_util.py 9KB
tutorial_8_fitting.py 9KB
array_plotters.py 9KB
conf.py 9KB
fitting_data.py 9KB
tutorial_1_non_linear_search.py 9KB
light_and_mass_profiles.py 9KB
test_lensing_fitting_plotters.py 9KB
mask_util.py 9KB
test_sensitivity_fitting.py 9KB
jitted.py 8KB
jitted.py 8KB
jitted.py 8KB
tutorial_6_more_ray_tracing.py 8KB
tutorial_5_ray_tracing.py 8KB
profile_plotters.py 8KB
inversions.py 8KB
test_lensing_image.py 8KB
tutorial_2_mappers.py 8KB
共 344 条
- 1
- 2
- 3
- 4
资源评论
挣扎的蓝藻
- 粉丝: 13w+
- 资源: 15万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功