Tutorial on Beamline Simulation: � Scripting with shadow4
“Francis” Wei He (francisho@lbl.gov)
Dr. Antoine İşlegen-Wojdyla (awojdyla@lbl.gov)
Bay Area Light Sources Joint Users' Meeting
Sep 20th, 2026
The Need for Scripting?
The Need for Scripting?
The Need for Scripting?
The Need for Scripting?
The Need for Scripting?
Models: Simplified from COSMIC-U
7
COSMIC-U (COherent Scattering and MICroscopy, Upgraded)
Models: Simplified from COSMIC-U
8
Models: Simplified from COSMIC-U
9
BL-1: GRE (Getting Rays Exported)
Models: Simplified from COSMIC-U
10
BL-1: GRE (Getting Rays Exported)
BL-2: LSAT (Looping Source, Auto-Tuning)
Models: Simplified from COSMIC-U
11
BL-1: GRE (Getting Rays Exported)
BL-2: LSAT (Looping Source, Auto-Tuning)
BL-3: MCAT (Metrology Complicating Actual Tracing)
To Start: Export from Oasys’ Widget
12
To Start: Export from Oasys’ Widget
13
To Start: Export from Oasys’ Widget
14
To Start: Export from Oasys’ Widget
15
Script Together
16
Script Together – git clone
17
Script Together – Google Colab
18
Script Together – Google Colab
19
Script Together
20
Acknowledgements
21
This work is supported by an Early Career Award in the X-Ray Instrumentation Program, in the Science User Facility Division of the Office of Basic Energy Sciences of the U.S. Department of Energy, under Contract No. DE-AC02-05CH11231. Wei He “Francis” is an ALS Doctoral Fellow supported by the Photon Science Development Group at the Advanced Light Source.
DREAM Team @ ALS
Antoine İşlegen-Wojdyla
Ka Hung Chan (Henry)
Hugo Calderon-Delgado
Computating Group @ ALS
Seij de Leon
Dylan McReynolds
Physics @ UC San Diego
Alex Frañó
X-ray Optics Program @ ALS
Kenneth A. Goldberg
Nicolás Smith
Ian Lacey
Valeriy Yashchuk
ALS 2.0
Maxime Bergeret
�
Questions?
�
Questions?
Quantitative flux estimates
23
Positioning tolerances
24