Skip to content

Commit f3f3f4e

Browse files
Jammy2211Jammy2211
authored andcommitted
docs
1 parent b1dd33f commit f3f3f4e

2 files changed

Lines changed: 56 additions & 100 deletions

File tree

docs/overview/overview_1_start_here.rst

Lines changed: 28 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Start Here
66
**PyAutoLens** is software for analysing strong gravitational lenses, an astrophysical phenomenon where a galaxy
77
appears multiple times because its light is bent by the gravitational field of an intervening foreground lens galaxy.
88

9-
It uses JAX to accelerate lensing calculations, with the example code below all running significantly faster on GPU.
9+
It uses **JAX** to **accelerate lensing calculations**, with the example code below all running **significantly faster on GPU**.
1010

1111
Here is a schematic of a strong gravitational lens:
1212

@@ -342,93 +342,46 @@ the stellar components use a ``LightAndMassProfile`` via the ``lmp`` module.
342342
:width: 600
343343
:alt: Alternative text
344344

345-
346-
Simulator
347-
---------
348-
349-
Let’s now switch gears and simulate our own strong lens imaging. This is a great way to:
350-
351-
- Practice lens modeling before using real data.
352-
- Build large training sets (e.g. for machine learning).
353-
- Test lensing theory in a controlled environment.
354-
355-
In this example. we simulate “perfect” images without telescope effects. This means no blurring
356-
from a PSF and no noise — just the raw light from galaxies and deflections from gravity.
357-
358-
In fact, this exactly what the image above is: a perfect image of a double Einstein ring system. The only
359-
thing we need to do then, is output it to a .fits file so we can load it elsewhere.
360-
361-
.. code:: python
362-
363-
al.output_to_fits(
364-
values=image.native,
365-
file_path=Path("image.fits"),
366-
overwrite=True,
367-
)
368-
369-
Samples
370-
-------
371-
372-
Often we want to simulate *many* strong lenses — for example, to train a neural network
373-
or to explore population-level statistics.
374-
375-
This uses the model composition API to define the distribution of the light and mass profiles
376-
of the lens and source galaxies we draw from. The model composition is a little too complex for
377-
the first example, thus we use a helper function to create a simple lens and source model.
378-
379-
We then generate 3 lenses for speed, and plot their images so you can see the variety of lenses
380-
we create.
381-
382-
If you want to simulate lenses yourself (e.g. for training a neural network), checkout the
383-
`autolens_workspace/simulators` package for a full description of how to do this and customize
384-
the simulated lenses to your science.
385-
386-
The images below are perfect lenses of strong lenses, the next examples will show us how to
387-
instead output realistic observations of strong lenses (e.g. CCD imaging, interferometer data, etc).
388-
389-
.. code:: python
390-
391-
lens_model, source_model = al.model_util.simulator_start_here_model_from()
392-
393-
total_datasets = 3
394-
395-
for sample_index in range(total_datasets):
396-
397-
lens_galaxy = lens_model.random_instance()
398-
source_galaxy = source_model.random_instance()
399-
400-
tracer = al.Tracer(galaxies=[lens_galaxy, source_galaxy])
401-
402-
tracer_plotter = aplt.TracerPlotter(tracer=tracer, grid=grid)
403-
tracer_plotter.figures_2d(image=True)
404-
405345
Lens Modeling
406346
-------------
407347

408-
Lens modeling is the process where given data on a strong lens, we fit the data with a model to infer the properties
409-
of the lens and source galaxies.
348+
Lens modeling is the process of fitting a physical model to strong-lensing data in order to infer the properties of
349+
the lens and source galaxies.
410350

411-
The animation below shows a slide-show of the lens modeling procedure. Many lens models are fitted to the data over
412-
and over, gradually improving the quality of the fit to the data and looking more and more like the observed image.
351+
The primary goal of **PyAutoLens** is to make lens modeling **simple, scalable to large datasets, and fast**, with
352+
GPU acceleration provided via JAX.
413353

414-
We can see that initial models give a poor fit to the data but gradually improve (increasing the likelihood) as more
415-
iterations are performed.
354+
The animation below illustrates the lens modeling workflow. Many models are fitted to the data iteratively,
355+
progressively improving the quality of the fit until the model closely reproduces the observed image.
416356

417357
.. image:: https://github.com/Jammy2211/auto_files/blob/main/lensmodel.gif?raw=true
418358
:width: 600
419359

420-
![Lens Modeling Animation](https://github.com/Jammy2211/auto_files/blob/main/lensmodel.gif?raw=true "model")
421-
422360
**Credit: Amy Etherington**
423361

424-
**PyAutoLens**'s main goal is to make lens modeling **simple** for everyone, **scale** to large datasets
425-
and **run very fast** thanks to GPU acceleration via JAX.
362+
The next documentation page guides you through lens modeling for a variety of lensing regimes (e.g. galaxy–galaxy lenses,
363+
cluster-scale lenses) and data types (e.g. CCD imaging, interferometer data).
364+
365+
Simulations
366+
-----------
367+
368+
Simulating strong lenses is often essential, for example to:
369+
370+
- Practice lens modeling before working with real data.
371+
- Generate large training sets (e.g. for machine learning).
372+
- Test lensing theory in a fully controlled environment.
373+
374+
The next documentation page guides you through how to simulate lenses for different types of strong
375+
lenses (e.g. galaxy–galaxy lenses, cluster-scale lenses) and different types of data (e.g. CCD imaging, interferometer data).
426376

427377
Wrap Up
428378
-------
429379

430-
We have now completed the API overview of **PyAutoLens**, including a brief introduction to the core API for
431-
creating galaxies, simulating data and performing lens modeling.
380+
This completes the introduction to **PyAutoLens**, including a brief overview of the core API for lensing calculations,
381+
lens modeling, and data simulation.
382+
383+
Different users will be interested in strong lenses across different lensing regimes (e.g. galaxy-scale or
384+
cluster-scale lenses) and using different data types (e.g. CCD imaging or interferometer data).
432385

433-
The next overview describes how a new user should navigate the **PyAutoLens** workspace, which contains many examples
434-
and tutorials, in order to get up and running with the software.
386+
The autolens_workspace repository contains a wide range of examples and tutorials covering these use cases. The
387+
next documentation page helps new users identify the most appropriate starting point based on their scientific goals.

docs/overview/overview_2_new_user_guide.rst

Lines changed: 28 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,11 @@
33
New User Guide
44
==============
55

6-
**PyAutoLens** is an extensive piece of software with functionality for doing many different analysis tasks, fitting
7-
different data types and it is used for a variety of different science cases. This means the documentation is quite
8-
extensive, and it may initially be difficult to find the example script you need.
6+
**PyAutoLens** can analyse strong lens systems across a range of physical scales (e.g. galaxy, group, and cluster) and for
7+
different types of data (e.g. imaging, interferometer, and point-source observations). Depending on the scientific questions you are interested in, the analysis you perform may differ significantly.
98

10-
The ``autolens_workspace`` has five ``start_here.ipynb`` notebooks, and you need to determine which is most relevant
11-
to your scientific interests.
12-
13-
You can access the notebooks by clicking on the embedded links below:
14-
15-
- `imaging/start_here.ipynb <https://colab.research.google.com/github/Jammy2211/autolens_workspace/blob/release/notebooks/imaging/start_here.ipynb>`_: Galaxy scale strong lenses observed with CCD imaging (e.g. Hubble, James Webb).
16-
- `interferometer/start_here.ipynb <https://colab.research.google.com/github/Jammy2211/autolens_workspace/blob/release/notebooks/interferometer/start_here.ipynb>`_: Galaxy scale strong lenses observed with interferometer data (e.g. ALMA).
17-
- `point_source/start_here.ipynb <https://colab.research.google.com/github/Jammy2211/autolens_workspace/blob/release/notebooks/point_source/start_here.ipynb>`_: Galaxy scale strong lenses with a lensed point source (e.g. lensed quasars).
18-
- `group/start_here.ipynb <https://colab.research.google.com/github/Jammy2211/autolens_workspace/blob/release/notebooks/group/start_here.ipynb>`_: Group scale strong lenses where there are 2-10 lens galaxies.
19-
- `cluster/start_here.ipynb <https://colab.research.google.com/github/Jammy2211/autolens_workspace/blob/release/notebooks/cluster/start_here.ipynb>`_: Cluster scale strong lenses with 2+ lenses and 5+ source galaxies.
20-
21-
If you are unsure based on the brief descriptions above, answer the following two questions to work out where to start.
9+
The autolens_workspace contains a suite of example Jupyter Notebooks, organised by lens scale and dataset type.
10+
To help you find the most appropriate starting point, we begin by answering two simple questions.
2211

2312
What Scale Lens?
2413
----------------
@@ -31,22 +20,40 @@ There are three scales to choose from:
3120
If you're interested in galaxy scale lenses, go to the question below called "What Data Type?".
3221

3322
- **Group Scale**: Strong Lens Groups contains 2-10 lens galaxies, normally with one main large galaxy responsible for the majority of lensing.
34-
They also typically lens just one source galaxy. If you are interested in groups, go to the ``group/start_here.ipynb`` notebook.
23+
They also typically lens just one source galaxy. If you are interested in groups, go to the `group/start_here.ipynb <https://github.com/Jammy2211/autolens_workspace/blob/release/notebooks/group/start_here.ipynb>`_ notebook.
3524

3625
- **Cluster Scale**: Strong Lens Galaxy clusters often contained 20-50, or more, lens galaxies, lensing 10, or more, sources galaxies.
37-
If you are interested in clusters, go to the ``cluster/start_here.ipynb`` notebook.
26+
If you are interested in clusters, go to the `cluster/start_here.ipynb <https://github.com/Jammy2211/autolens_workspace/blob/release/notebooks/cluster/start_here.ipynb>`_ notebook.
3827

3928
What Dataset Type?
4029
------------------
4130

4231
If you are interested in galaxy-scale strong lenses, you now need to decide what type of strong lens data you are
4332
interested in:
4433

45-
- **CDD Imaging**: For image data from telescopes like Hubble and James Webb, go to ``imaging/start_here.ipynb``.
34+
- **CDD Imaging**: For image data from telescopes like Hubble and James Webb, go to `imaging/start_here.ipynb <https://github.com/Jammy2211/autolens_workspace/blob/release/notebooks/imaging/start_here.ipynb>`_.
35+
36+
- **Interferometer**: For radio / sub-mm interferometer from instruments like ALMA, go to `interferometer/start_here.ipynb <https://github.com/Jammy2211/autolens_workspace/blob/release/notebooks/interferometer/start_here.ipynb>`_.
37+
38+
- **Point Sources**: For strongly lensed point sources (e.g. lensed quasars, supernovae), go to `point_source/start_here.ipynb <hhttps://github.com/Jammy2211/autolens_workspace/blob/release/notebooks/point_source/start_here.ipynb>`_.
4639

47-
- **Interferometer**: For radio / sub-mm interferometer from instruments like ALMA, go to ``interferometer/start_here.ipynb``.
40+
Google Colab
41+
------------
4842

49-
- **Point Sources**: For strongly lensed point sources (e.g. lensed quasars, supernovae), go to ``point_source/start_here.ipynb``.
43+
The links above take you to the GitHub page of each notebook, and if you've cloned the workspace you can open them
44+
locally on your machine.
45+
46+
However, you can also open and run each notebook directly in Google Colab, which provides a free cloud computing
47+
environment with all the required dependencies already installed.
48+
49+
This is a great way to get started quickly without needing to install **PyAutoLens** on your own machine,
50+
so you can check its the right software for you before going through the installation process:
51+
52+
- `imaging/start_here.ipynb <https://colab.research.google.com/github/Jammy2211/autolens_workspace/blob/release/notebooks/imaging/start_here.ipynb>`_: Galaxy scale strong lenses observed with CCD imaging (e.g. Hubble, James Webb).
53+
- `interferometer/start_here.ipynb <https://colab.research.google.com/github/Jammy2211/autolens_workspace/blob/release/notebooks/interferometer/start_here.ipynb>`_: Galaxy scale strong lenses observed with interferometer data (e.g. ALMA).
54+
- `point_source/start_here.ipynb <https://colab.research.google.com/github/Jammy2211/autolens_workspace/blob/release/notebooks/point_source/start_here.ipynb>`_: Galaxy scale strong lenses with a lensed point source (e.g. lensed quasars).
55+
- `group/start_here.ipynb <https://colab.research.google.com/github/Jammy2211/autolens_workspace/blob/release/notebooks/group/start_here.ipynb>`_: Group scale strong lenses where there are 2-10 lens galaxies.
56+
- `cluster/start_here.ipynb <https://colab.research.google.com/github/Jammy2211/autolens_workspace/blob/release/notebooks/cluster/start_here.ipynb>`_: Cluster scale strong lenses with 2+ lenses and 5+ source galaxies.
5057

5158
Still Unsure?
5259
-------------
@@ -71,11 +78,7 @@ used in modeling and ultimately will allow you to undertake scientific research
7178
To complete thoroughly, they'll probably take 2-4 days, so you may want try moving ahead to the examples but can
7279
go back to these lectures if you find them hard to follow.
7380

74-
If this sounds like it suits you, checkout the ``autolens_workspace/notebooks/howtolens`` package now.
75-
76-
GitHub Links:
77-
78-
https://github.com/Jammy2211/autolens_workspace/tree/release/notebooks/howtolens
81+
If this sounds like it suits you, checkout the `HowToLens <https://github.com/Jammy2211/autolens_workspace/tree/release/notebooks/howtolens>`_ package now.
7982

8083
Wrap Up
8184
-------

0 commit comments

Comments
 (0)