Repository navigation
Expand file tree
/
Copy pathstart_here.py
More file actions
78 lines (57 loc) · 3.92 KB
/
Copy pathstart_here.py
File metadata and controls
78 lines (57 loc) · 3.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
"""
Start Here: HowToLens
=====================
Welcome to **HowToLens** — the `PyAutoLens` tutorial lecture series on strong gravitational lensing.
This script gives you a one-page overview of the series and points you to the first tutorial.
__HowToLens and Natural Language__
**PyAutoLens** can be used by describing an analysis in natural language to an AI coding agent, which writes and runs
the **PyAutoLens** code for you. Natural language does not remove the need for expertise: to direct an analysis well,
and to recognise when a result is wrong, you still need to understand the science, the modeling assumptions and
how uncertainty is quantified.
That is what **HowToLens** is for. It teaches strong lensing from first principles, with real **PyAutoLens** Python that you
run and explore yourself, so that you can then describe a lens model in natural language with expertise, or write it
in Python directly. Python is not going anywhere: every lecture is ordinary **PyAutoLens** code.
You can also study with the [PyAutoLens AI Assistant](https://github.com/PyAutoLabs/autolens_assistant) in teacher
mode, which explains concepts, equations, code and results as you go. Open Claude Code, Codex or another AI coding
agent and paste:
> I want to work through the HowToLens lectures (https://github.com/PyAutoLabs/HowToLens) with the
> PyAutoLens Assistant: https://github.com/PyAutoLabs/autolens_assistant
> First clone that repository, cd into it and follow its AGENTS.md.
>
> Enter teacher mode. Show me where to find the lectures and how to use Jupyter Notebook or
> Markdown, then help me with questions as I go.
__HowToLens__
**HowToLens** is a four-chapter guide which takes you, step by step, from knowing nothing about strong lensing
to being able to model real strong lens data with **PyAutoLens** for scientific research.
- Chapter 1: Introduction to strong lensing — grids, light profiles, mass profiles, galaxies, ray-tracing,
simulated data, and how fitting works.
- Chapter 2: Bayesian inference and non-linear searches — how to fit a lens model to CCD imaging data, ending
with search chaining and automated pipelines.
- Chapter 3: Pixelized source reconstruction — reconstructing sources with irregular morphology using
inversions and regularization.
- Chapter 4: Scaling up lensing — extra galaxies, multi-galaxy lenses, scaling relations, group and cluster
scales, and weak lensing.
Each chapter is organised into numbered tutorial files: `chapter_<N>_<name>/tutorial_<M>_<topic>.py` (Python script)
or the matching `.ipynb` in `notebooks/`. Tutorials build on each other within a chapter and assume you have
completed the earlier ones.
__Recommended Path__
We recommend working through the tutorials in order:
1. First run `scripts/chapter_1_introduction/tutorial_0_visualization.py` — this checks your installation
and sets up matplotlib for the rest of the series.
2. Work through `chapter_1_introduction` tutorial-by-tutorial.
3. Work through `chapter_2_lens_modeling`.
4. At this point you can start modeling real lenses using scripts in the separate
`autolens_workspace` repository — you know enough to be productive.
5. Come back for `chapter_3_pixelizations` and `chapter_4_scaling_up_lensing` when you want to tackle more
complex systems.
__Notebooks vs Scripts__
Every tutorial exists as both a Python script (under `scripts/`) and a Jupyter notebook (under `notebooks/`).
The notebooks are ideal for reading because plots render inline between small blocks of code. The Python
scripts are more convenient for actual **PyAutoLens** use — which chapter 3 onwards starts to assume.
The notebooks are auto-generated from the Python scripts, so if you want to make changes, **edit the
Python scripts, not the notebooks.**
__Next Step__
Open `scripts/chapter_1_introduction/tutorial_0_visualization.py` (or the `.ipynb` equivalent) and start there.
"""
# from autolens import setup_notebook; setup_notebook()
print(__doc__)