Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/_static/pyautolens.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,13 @@
.feature-more-images summary, .directory summary { cursor: pointer; padding: 8px 0; }
.directory { padding: 15px 20px; border: 1px solid #dce5ec; border-radius: 6px; }
@media (max-width: 600px) { .feature-gallery tr { display: flex; flex-wrap: wrap; } .feature-gallery td { width: 50%; } .feature-gallery img { height: 110px; } }

/* Features page: tiled cards grouped by section */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 10px 0 30px; }
.feature-grid .feature-entry { display: flex; flex-direction: column; padding: 12px; border: 1px solid var(--color-background-border, #dce5ec); border-radius: 8px; background: var(--color-background-secondary, #f8f9fb); scroll-margin-top: 4rem; }
.feature-grid .feature-entry:target { border-color: var(--color-brand-primary); box-shadow: 0 0 0 2px var(--color-brand-primary); }
.feature-grid .feature-thumb { display: block; margin: -4px -4px 10px; }
.feature-grid .feature-thumb img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: contain; border-radius: 5px; background: #071322; }
.feature-grid .feature-entry h3 { font-size: 1rem; margin: 0 0 6px; }
.feature-grid .feature-entry p { font-size: .88rem; line-height: 1.45; margin: 0 0 8px; }
.feature-grid .feature-entry p:last-child { margin-top: auto; margin-bottom: 0; }
1 change: 1 addition & 0 deletions docs/overview/images/overview_2/provenance.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ AI-generated conceptual illustrations, generated and edited with built-in image_
Dataset illustration extended with a multi-band imaging panel using built-in image_gen on 2026-11-12, following the user's request to distinguish multi_dataset examples from spectral data cubes. Separate image stamps represent the same lens in different wavebands. Edit prompt: multiband_image_edit_prompt.txt. The updated image is shared by the new user guide and workspace README; awaiting visual review.

Standalone imaging.png generated with built-in image_gen on 2026-11-12 for the workspace dataset gallery and RTD Imaging card. Conceptual pixelated telescope image, not measured data or a numerical lens model. Reference: the Imaging scene in dataset_types.png. Prompt: imaging_image_prompt.txt. Approved by the user on 2026-11-12.
weak_lensing.png rendered procedurally on 2026-11-13 by weak_lensing_render.py (not AI-generated, not measured data): a cluster with strong arcs near an illustrative Einstein radius and background galaxies whose shapes combine random intrinsic ellipticity with an exaggerated SIS-like tangential shear. Replaces overview_3/strong_weak_lensing.png on the New User Guide card and workspace README.
Binary file added docs/overview/images/overview_2/weak_lensing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions docs/overview/images/overview_2/weak_lensing_render.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import numpy as np, sys
from PIL import Image
rng=np.random.default_rng(7)
W,H=1536,1024; img=np.zeros((H,W,3))
yy,xx=np.mgrid[0:H,0:W].astype(float); cx,cy=W/2,H/2
# background: dark navy with soft vignette
r=np.hypot(xx-cx,yy-cy)/np.hypot(cx,cy)
bg=np.array([2,4,16])/255; img+=bg*(1.1-0.6*r[...,None])
def blob(x0,y0,a,b,ang,col,amp=1.0,prof='gauss'):
R=int(max(a,b)*5)+3; x1,x2=max(0,int(x0-R)),min(W,int(x0+R)); y1,y2=max(0,int(y0-R)),min(H,int(y0+R))
X=xx[y1:y2,x1:x2]-x0; Y=yy[y1:y2,x1:x2]-y0; c,s=np.cos(ang),np.sin(ang)
u=(X*c+Y*s)/a; v=(-X*s+Y*c)/b; q=u*u+v*v
f=np.exp(-0.5*q) if prof=='gauss' else np.exp(-2.0*q**0.4)
img[y1:y2,x1:x2]+=amp*f[...,None]*np.array(col)
# faint stars
for _ in range(260):
blob(rng.uniform(0,W),rng.uniform(0,H),0.7,0.7,0,np.array([0.8,0.85,1.0]),rng.uniform(0.15,0.6))
thE=150.0 # Einstein radius in px
gold=np.array([1.0,0.62,0.22]); goldw=np.array([1.0,0.85,0.55])
# background (weakly sheared) galaxies
n=0
while n<400:
x,y=rng.uniform(-20,W+20),rng.uniform(-20,H+20); dx,dy=x-cx,y-cy; rr=np.hypot(dx,dy)
if rr<thE*1.35: continue
g=min(0.55,thE/(2*rr))*1.6 # exaggerated SIS shear for visibility
e_int=rng.normal(0,0.12,2); phi=np.arctan2(dy,dx)+np.pi/2
e1=g*np.cos(2*phi)+e_int[0]; e2=g*np.sin(2*phi)+e_int[1]; e=min(np.hypot(e1,e2),0.8)
ang=0.5*np.arctan2(e2,e1); size=rng.lognormal(np.log(4.2),0.35)
a=size*np.sqrt((1+e)/(1-e)); b=size*np.sqrt((1-e)/(1+e))
hue=rng.uniform(0,1); col=np.array([0.25+0.35*hue,0.65+0.25*hue,1.0])
blob(x,y,a,b,ang,col,rng.uniform(0.3,0.85)); n+=1
# strong arcs near Einstein radius
for th0,span,w,amp in [(0.35,0.9,4.5,1.0),(2.55,0.75,4.0,0.9),(4.25,0.6,3.5,0.8),(1.6,0.25,3.0,0.6)]:
rad=thE*rng.uniform(0.97,1.05)
for t in np.linspace(th0-span/2,th0+span/2,140):
fall=max(np.cos((t-th0)/span*np.pi),0)**0.7
blob(cx+rad*np.cos(t),cy+rad*np.sin(t)*0.92,7*fall+2,w*fall*0.8+0.8,t+np.pi/2,np.array([0.15,0.6,1.0]),0.07*amp)
for t in rng.uniform(th0-span*0.4,th0+span*0.4,int(14*span)+3):
blob(cx+rad*np.cos(t),cy+rad*np.sin(t)*0.92,rng.uniform(2,3.5),rng.uniform(1.5,2.5),t+np.pi/2,np.array([0.4,0.9,1.0]),rng.uniform(0.5,1.0)*amp)
# cluster members
blob(cx,cy,70,52,0.4,gold,0.35); blob(cx,cy,22,16,0.4,goldw,1.1); blob(cx,cy,6,5,0.4,np.array([1,1,0.9]),0.9)
for _ in range(16):
t=rng.uniform(0,2*np.pi); rr=rng.uniform(40,230)
s=rng.uniform(3.5,8); blob(cx+rr*np.cos(t)*1.2,cy+rr*np.sin(t)*0.85,s*1.2,s,rng.uniform(0,3),gold,rng.uniform(0.5,0.9))
blob(cx+rr*np.cos(t)*1.2,cy+rr*np.sin(t)*0.85,s*3,s*2.5,0,gold,0.08)
out=1-np.exp(-1.6*img) # soft tone map
Image.fromarray((np.clip(out,0,1)**0.9*255).astype(np.uint8)).save(sys.argv[1])
81 changes: 81 additions & 0 deletions docs/overview/images/overview_3/feature_thumbs_render.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
"""Procedural thumbnails for feature tiles without illustrations (conceptual, not data)."""
import numpy as np, sys
from PIL import Image, ImageDraw, ImageFont
W,H=1536,1024
yy,xx=np.mgrid[0:H,0:W].astype(float)
GOLD=np.array([1.0,0.62,0.22]); GOLDW=np.array([1.0,0.85,0.55]); BLUE=np.array([0.15,0.65,1.0]); CYAN=np.array([0.4,0.9,1.0])
def canvas():
r=np.hypot(xx-W/2,yy-H/2)/np.hypot(W/2,H/2); img=np.zeros((H,W,3)); img+=np.array([2,4,16])/255*(1.1-0.6*r[...,None]); return img
def blob(img,x0,y0,a,b,ang,col,amp=1.0):
R=int(max(a,b)*5)+3; x1,x2=max(0,int(x0-R)),min(W,int(x0+R)); y1,y2=max(0,int(y0-R)),min(H,int(y0+R))
if x2<=x1 or y2<=y1: return
X=xx[y1:y2,x1:x2]-x0; Y=yy[y1:y2,x1:x2]-y0; c,s=np.cos(ang),np.sin(ang)
u=(X*c+Y*s)/a; v=(-X*s+Y*c)/b; img[y1:y2,x1:x2]+=amp*np.exp(-0.5*(u*u+v*v))[...,None]*col
def lens(img,cx,cy,sc,rng,arcs=True):
blob(img,cx,cy,60*sc,45*sc,0.4,GOLD,0.35); blob(img,cx,cy,18*sc,13*sc,0.4,GOLDW,1.0); blob(img,cx,cy,5*sc,4*sc,0.4,np.array([1,1,.9]),0.8)
if arcs:
for th0,span in [(rng.uniform(0,6.3),1.0),(rng.uniform(0,6.3),0.7)]:
for t in np.linspace(th0-span/2,th0+span/2,60):
f=max(np.cos((t-th0)/span*np.pi),0)**0.7
blob(img,cx+110*sc*np.cos(t),cy+100*sc*np.sin(t),(8*f+2)*sc,(3.5*f+1)*sc,t+np.pi/2,BLUE,0.14)
def stars(img,rng,n=200):
for _ in range(n): blob(img,rng.uniform(0,W),rng.uniform(0,H),0.7,0.7,0,np.array([.8,.85,1]),rng.uniform(.15,.5))
def finish(img): return Image.fromarray((np.clip(1-np.exp(-1.6*img),0,1)**0.9*255).astype(np.uint8))
def line(d,p,q,col,w=4,dash=None):
if dash is None: d.line([p,q],fill=col,width=w); return
p=np.array(p,float); q=np.array(q,float); L=np.linalg.norm(q-p); u=(q-p)/L; t=0
while t<L: d.line([tuple(p+u*t),tuple(p+u*min(t+dash,L))],fill=col,width=w); t+=2*dash
font=lambda s: ImageFont.truetype('/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf',s)

def mass_models(path):
rng=np.random.default_rng(3); img=canvas(); stars(img,rng); lens(img,W/2,H/2,2.0,rng); im=finish(img); d=ImageDraw.Draw(im,'RGBA')
cx,cy=W/2,H/2
for k,r0 in enumerate([90,150,215,290,375]):
t=np.linspace(0,2*np.pi,400); q=0.78; phi=0.4
r=r0*(1+0.06*np.cos(4*(t-0.2))*(k/4))
x=r*np.cos(t); y=r*q*np.sin(t); X=cx+x*np.cos(phi)-y*np.sin(phi); Y=cy+x*np.sin(phi)+y*np.cos(phi)
pts=list(zip(X,Y)); col=(255,190,110,150-20*k)
for i in range(0,len(pts)-1,8): d.line(pts[i:i+5],fill=col,width=4)
im.save(path)

def slam(path):
rng=np.random.default_rng(5); img=canvas(); stars(img,rng,120)
xs=[W*0.2,W*0.5,W*0.8]; cy=H*0.47
# Source: blurry source blob
for _ in range(9): blob(img,xs[0]+rng.normal(0,35),cy+rng.normal(0,30),rng.uniform(15,30),rng.uniform(10,22),rng.uniform(0,3),CYAN,0.35)
# Light: lens light only
blob(img,xs[1],cy,90,68,0.4,GOLD,0.4); blob(img,xs[1],cy,26,19,0.4,GOLDW,1.0)
# Mass: lens with arcs
lens(img,xs[2],cy,1.3,rng)
im=finish(img); d=ImageDraw.Draw(im,'RGBA')
for i,x in enumerate(xs):
d.rounded_rectangle([x-200,cy-210,x+200,cy+210],radius=28,outline=(120,170,255,140),width=5)
if i<2:
d.line([(x+215,cy),(xs[i+1]-225,cy)],fill=(200,220,255,220),width=8)
d.polygon([(xs[i+1]-215,cy),(xs[i+1]-245,cy-18),(xs[i+1]-245,cy+18)],fill=(200,220,255,220))
f=font(64)
for x,t in zip(xs,['Source','Light','Mass']):
w=d.textlength(t,font=f); d.text((x-w/2,cy+240),t,font=f,fill=(225,235,255,235))
# mass contours on last panel
for r0 in [70,120,170]:
d.ellipse([xs[2]-r0,cy-r0*0.8,xs[2]+r0,cy+r0*0.8],outline=(255,190,110,110),width=3)
im.save(path)

def graphical(path,kind):
rng=np.random.default_rng(11); img=canvas(); stars(img,rng,150)
cx,cy=W/2,H/2; n=8; pos=[(cx+430*np.cos(a),cy+330*np.sin(a)) for a in np.linspace(0,2*np.pi,n,endpoint=False)+0.2]
for (x,y) in pos:
if kind=='lens': lens(img,x,y,0.75,rng)
else:
ang=rng.uniform(0,3); q=rng.uniform(.4,.9)
blob(img,x,y,55,55*q,ang,BLUE,0.35); blob(img,x,y,30,30*q,ang,GOLD,0.5); blob(img,x,y,9,9*q,ang,GOLDW,0.9)
im=finish(img); d=ImageDraw.Draw(im,'RGBA')
for (x,y) in pos:
v=np.array([cx-x,cy-y]); L=np.linalg.norm(v); u=v/L
line(d,tuple(np.array([x,y])+u*120),tuple(np.array([cx,cy])-u*95),(170,200,255,170),w=5,dash=18)
d.ellipse([cx-85,cy-85,cx+85,cy+85],fill=(124,77,255,70),outline=(170,140,255,230),width=6)
for k,dx in enumerate([-38,0,38]): d.ellipse([cx+dx-12,cy-12,cx+dx+12,cy+12],fill=(225,215,255,235))
im.save(path)

out=sys.argv[1]; which=sys.argv[2]
{'mass':lambda:mass_models(out),'slam':lambda:slam(out),'graph_lens':lambda:graphical(out,'lens'),'graph_galaxy':lambda:graphical(out,'galaxy')}[which]()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/overview/images/overview_3/mass_models.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 18 additions & 26 deletions docs/overview/overview_2_new_user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,33 @@ These categories are a starting guide, rather than strict boundaries based on th


:::{grid-item-card} Galaxy
Approximate Einstein radius: ~1″
Einstein radius: ~1″

One foreground galaxy dominates the lensing.
One galaxy dominates the lensing.

[Choose your data type below](#what-dataset-type)
:::

:::{grid-item-card} Multi-galaxy
Approximate Einstein radius: ~1–3″
Einstein radius: ~1–3″

Several foreground galaxies contribute significantly to the lensing.
Several galaxies share the lensing.

[Notebook](https://github.com/PyAutoLabs/autolens_workspace/blob/main/notebooks/multi_galaxy/start_here.ipynb) · [Google Colab](https://colab.research.google.com/github/PyAutoLabs/autolens_workspace/blob/2026.11.13.1/notebooks/multi_galaxy/start_here.ipynb)
:::

:::{grid-item-card} Group
Approximate Einstein radius: ~3–10″
Einstein radius: ~3–10″

A small galaxy group lenses a background source.
A galaxy group lenses a background source.

[Notebook](https://github.com/PyAutoLabs/autolens_workspace/blob/main/notebooks/group/start_here.ipynb) · [Google Colab](https://colab.research.google.com/github/PyAutoLabs/autolens_workspace/blob/2026.11.13.1/notebooks/group/start_here.ipynb)
:::

:::{grid-item-card} Cluster
Approximate Einstein radius: ~10–50″
Einstein radius: ~10–50″

A galaxy cluster lenses multiple background sources.
A cluster lenses many background sources.

[Notebook](https://github.com/PyAutoLabs/autolens_workspace/blob/main/notebooks/cluster/start_here.ipynb) · [Google Colab](https://colab.research.google.com/github/PyAutoLabs/autolens_workspace/blob/2026.11.13.1/notebooks/cluster/start_here.ipynb)
:::
Expand All @@ -66,15 +66,11 @@ The **Einstein radius** gives a sense of the angular size of a lens, roughly the

## What dataset type?

For a galaxy-scale lens, choose the notebook that matches the observations you want to analyse. An image, a set of interferometer measurements and the positions of compact lensed sources each call for a different starting workflow.
For a galaxy-scale lens, choose the notebook that matches the observations you want to analyse. An image, a set of interferometer measurements, the positions of compact lensed sources and weak-lensing shear each call for a different starting workflow.

Each notebook begins with example data and introduces the relevant model and fitting steps. If you do not have your own dataset yet, choose the example closest to your interests. For multi-galaxy, group or cluster systems, begin with the scale-specific guide above.

![Five conceptual dataset representations: a pixelated lensed image, samples in the interferometer u–v plane, the same lens in three wavebands, stacked spectral-channel images, and four compact quasar images around a lens galaxy.](images/overview_2/dataset_types.png)

*AI-generated schematic, not measured data. The interferometer panel shows sampling locations; multi-band images show separate wavebands, while cube slices represent spectral channels.*

::::{grid} 1 2 2 2
::::{grid} 1 2 3 3
:gutter: 3


Expand Down Expand Up @@ -118,6 +114,14 @@ Multiple images of a compact source, such as a quasar or supernova.
[Notebook](https://github.com/PyAutoLabs/autolens_workspace/blob/main/notebooks/point_source/start_here.ipynb) · [Google Colab](https://colab.research.google.com/github/PyAutoLabs/autolens_workspace/blob/2026.11.13.1/notebooks/point_source/start_here.ipynb)
:::

:::{grid-item-card} Weak lensing
![Conceptual illustration of a galaxy cluster with strong-lensing arcs near its centre and background galaxies tangentially stretched across the wider field](images/overview_2/weak_lensing.png)

Subtle shape distortions of many background galaxies, alone or combined with strong lensing.

[Notebook](https://github.com/PyAutoLabs/autolens_workspace/blob/main/notebooks/weak/start_here.ipynb) · [Google Colab](https://colab.research.google.com/github/PyAutoLabs/autolens_workspace/blob/2026.11.12.1/notebooks/weak/start_here.ipynb)
:::

::::

(google-colab)=
Expand All @@ -130,18 +134,6 @@ To run an example in your browser, choose **Google Colab**. Run its setup cell f

If you already have PyAutoLens installed and a local copy of the workspace, open the same notebook in Jupyter on your machine. Start with the supplied dataset so you can follow the complete workflow, then adapt it to your own observations.

(weak-lensing)=

## Weak lensing

To model the subtle distortions of many background galaxies, start with [weak/](https://github.com/PyAutoLabs/autolens_workspace/tree/main/scripts/weak). You can also combine weak and strong lensing to study a cluster across both scales.

![Strong-lensing arcs near a cluster centre and weakly distorted background galaxies across a wider field.](images/overview_3/strong_weak_lensing.png)

*AI-generated conceptual illustration. The panels cover different angular scales; dashed contours represent a mass model, not a direct measurement from individual galaxy shapes.*

[Notebook ](https://github.com/PyAutoLabs/autolens_workspace/blob/main/notebooks/weak/start_here.ipynb)·[Google Colab ](https://colab.research.google.com/github/PyAutoLabs/autolens_workspace/blob/2026.11.13.1/notebooks/weak/start_here.ipynb)

## Still unsure?

You do not need to settle every modelling choice before getting started. Browse the introductions to a couple of notebooks and choose the one closest to your lens and observations. The starting examples establish the workflow; more specialised choices can come later.
Expand Down
Loading
Loading