@@ -48,23 +48,30 @@ The pipeline has three main phases:
4848
4949``` {mermaid}
5050%%{init: {"theme": "dark"} }%%
51- flowchart TB
51+ flowchart LR
5252 subgraph Setup ["Setup Phase"]
53- S1["FOV Setup\nz = 200..299"]
54- S2["Image Plane Setup\nz = 300..399"]
55- S3["Detector Setup\nz = 400..499"]
53+ direction TB
54+ S1["FOV Setup<br/>z = 200..299"]
55+ S2["Image Plane Setup<br/>z = 300..399"]
56+ S3["Detector Setup<br/>z = 400..499"]
57+ S1 --> S2 --> S3
5658 end
5759 subgraph Observe ["observe() Phase"]
58- O1["Source Effects\nz = 500..599\n<i>TER curves, filters</i>"]
59- O2["FOV Effects\nz = 600..699\n<i>PSFs, spectral traces, shifts</i>"]
60- O3["Image Plane Effects\nz = 700..799\n<i>Vibration, flat fields</i>"]
60+ direction TB
61+ O1["Source Effects<br/>z = 500..599<br/><i>TER curves, filters</i>"]
62+ O2["FOV Effects<br/>z = 600..699<br/><i>PSFs, spectral traces, shifts</i>"]
63+ O3["Image Plane Effects<br/>z = 700..799<br/><i>Vibration, flat fields</i>"]
64+ O1 --> O2 --> O3
6165 end
6266 subgraph Readout ["readout() Phase"]
63- R1["Detector Effects\nz = 800..899\n<i>Noise, dark current, QE</i>"]
64- R2["Detector Array Effects\nz = 900..999\n<i>Exposure integration</i>"]
65- R3["FITS Header Effects\nz = 1000+"]
67+ direction TB
68+ R1["Detector Effects<br/>z = 800..899<br/><i>Noise, dark current, QE</i>"]
69+ R2["Detector Array Effects<br/>z = 900..999<br/><i>Exposure integration</i>"]
70+ R3["FITS Header Effects<br/>z = 1000+"]
71+ R1 --> R2 --> R3
6672 end
67- S1 --> S2 --> S3 --> O1 --> O2 --> O3 --> R1 --> R2 --> R3
73+ S3 --> O1
74+ O3 --> R1
6875```
6976
7077### Z-Order Reference
@@ -81,6 +88,77 @@ flowchart TB
8188| 900–999 | Detector array effects | ` Detector ` | ` detector_array_effects ` |
8289| 1000+ | FITS header effects | ` HDUList ` | ` fits_header_effects ` |
8390
91+ ## YAML Configuration
92+
93+ Effects are typically defined in YAML instrument packages. Each effect entry
94+ specifies the class name and configuration parameters:
95+
96+ ``` yaml
97+ effects :
98+ - name : detector_qe_curve
99+ description : Quantum efficiency of the battery of detectors
100+ class : QuantumEfficiencyCurve
101+ kwargs :
102+ filename : QE_detector_H2RG.dat
103+
104+ - name : dark_current
105+ description : Detector dark current
106+ class : DarkCurrent
107+ kwargs :
108+ value : 0.1 # electrons/s/pixel
109+
110+ - name : filter_wheel
111+ class : FilterWheel
112+ kwargs :
113+ current_filter : " !OBS.filter_name"
114+ filter_names : [J, H, Ks]
115+ filename_format : " filters/TC_filter_{}.dat"
116+ ` ` `
117+
118+ Parameters prefixed with ` !` (called **bang strings**) are resolved dynamically
119+ from the simulation configuration at runtime. For example, `!OBS.filter_name`
120+ reads the current filter selection from the observation commands.
121+
122+ ` ` ` {note}
123+ For real-world examples of YAML effect configurations, browse the instrument
124+ packages in the [Instrument Reference Database (IRDB)](https://github.com/AstarVienna/irdb).
125+ If you have instrument packages installed locally, you can also look inside the
126+ ` inst_pkgs/` folder in your ScopeSim data directory (see `scopesim.rc.__config__["!SIM.file.local_packages_path"]`).
127+ ```
128+
129+ ## Interacting with Effects at Runtime
130+
131+ Effects can be accessed, toggled, and modified after the optical train is loaded.
132+
133+ ### Enabling and disabling effects
134+
135+ ``` {code-cell} ipython3
136+ # Turn off an effect
137+ opt["detector_linearity"].include = False
138+ print("detector_linearity included:", opt["detector_linearity"].include)
139+
140+ # Turn it back on
141+ opt["detector_linearity"].include = True
142+ ```
143+
144+ ### Inspecting effect metadata
145+
146+ ``` {code-cell} ipython3
147+ opt["dark_current"].meta
148+ ```
149+
150+ ### Modifying parameters
151+
152+ ``` {code-cell} ipython3
153+ # Change the dark current value
154+ opt["dark_current"].meta["value"] = 0.5
155+ print("New dark current:", opt["dark_current"].meta["value"])
156+ ```
157+
158+ For more tips on interacting with effects, see:
159+ - [ Turning Effects on or off] ( ../5_liners/effects_include.md )
160+ - [ Using bang strings and hash strings] ( ../5_liners/bang_strings.md )
161+
84162## Effect Categories
85163
86164### Transmission, Emission, and Reflection (TER) Curves
@@ -225,70 +303,6 @@ Exposure effects handle integration time, auto-exposure, and readout formatting.
225303| ---| ---|
226304| ` Shutter ` | Simulates a closed shutter (zeros all pixels) |
227305
228- ## YAML Configuration
229-
230- Effects are typically defined in YAML instrument packages. Each effect entry
231- specifies the class name and configuration parameters:
232-
233- ``` yaml
234- effects :
235- - name : detector_qe_curve
236- description : Quantum efficiency of the battery of detectors
237- class : QuantumEfficiencyCurve
238- kwargs :
239- filename : QE_detector_H2RG.dat
240-
241- - name : dark_current
242- description : Detector dark current
243- class : DarkCurrent
244- kwargs :
245- value : 0.1 # electrons/s/pixel
246-
247- - name : filter_wheel
248- class : FilterWheel
249- kwargs :
250- current_filter : " !OBS.filter_name"
251- filter_names : [J, H, Ks]
252- filename_format : " filters/TC_filter_{}.dat"
253- ` ` `
254-
255- Parameters prefixed with ` !` (called **bang strings**) are resolved dynamically
256- from the simulation configuration at runtime. For example, `!OBS.filter_name`
257- reads the current filter selection from the observation commands.
258-
259- # # Interacting with Effects at Runtime
260-
261- Effects can be accessed, toggled, and modified after the optical train is loaded.
262-
263- # ## Enabling and disabling effects
264-
265- ` ` ` {code-cell} ipython3
266- # Turn off an effect
267- opt["detector_linearity"].include = False
268- print("detector_linearity included:", opt["detector_linearity"].include)
269-
270- # Turn it back on
271- opt["detector_linearity"].include = True
272- ` ` `
273-
274- # ## Inspecting effect metadata
275-
276- ` ` ` {code-cell} ipython3
277- opt["dark_current"].meta
278- ` ` `
279-
280- # ## Modifying parameters
281-
282- ` ` ` {code-cell} ipython3
283- # Change the dark current value
284- opt["dark_current"].meta["value"] = 0.5
285- print("New dark current:", opt["dark_current"].meta["value"])
286- ` ` `
287-
288- For more tips on interacting with effects, see :
289- - [Turning Effects on or off](../5_liners/effects_include.md)
290- - [Using bang strings and hash strings](../5_liners/bang_strings.md)
291-
292306## See Also
293307
294308- [ Creating Custom Effects] ( custom_effects.md ) — how to write your own Effect subclasses
0 commit comments