dispcraft.optics¶
optics ¶
Camera ¶
Camera(f)
Camera: beam direction [rad] → focal-plane position [m], in 2D. x = -f * theta
| Parameters: |
|
|---|
Source code in dispcraft/optics/elements.py
61 62 | |
forward ¶
forward(theta)
theta : (2,) or (2, N) array → position, same shape.
Source code in dispcraft/optics/elements.py
64 65 66 | |
Collimator ¶
Collimator(f)
Collimator: focal-plane position [m] → beam direction [rad], in 2D. theta = -x / f
| Parameters: |
|
|---|
Source code in dispcraft/optics/elements.py
79 80 | |
forward ¶
forward(x)
x : (2,) or (2, N) array → direction, same shape.
Source code in dispcraft/optics/elements.py
82 83 84 | |
Detector ¶
Detector(pixel_size, offset=None)
Detector: focal-plane position [m] → pixel coordinates, in 2D.
pixel = (x + offset) / pixel_size
| Parameters: |
|
|---|
Source code in dispcraft/optics/elements.py
127 128 129 | |
forward ¶
forward(x)
x : (2,) or (2, N) array → pixel coordinates, same shape.
Source code in dispcraft/optics/elements.py
131 132 133 134 135 | |
Grating ¶
Grating(m, rho)
Diffraction grating: angular deviation δ(λ) = m * λ / d.
| Parameters: |
|
|---|
Source code in dispcraft/optics/elements.py
34 35 36 37 | |
deviation ¶
deviation(wavelength)
Angular deviation [rad]. wavelength in µm.
Source code in dispcraft/optics/elements.py
39 40 41 | |
Grism ¶
Grism(prism, grating, tilt=0.0)
Grism (2D): prism + grating, with a tilt angle coupling x and y.
The grating term subtracts from the prism term: refraction and diffraction bend the beam in opposite rotational senses when both are measured relative to the optical axis.
| Parameters: |
|
|---|
Source code in dispcraft/optics/elements.py
153 154 155 156 | |
deviation ¶
deviation(wavelength)
Total angular deviation [rad] (scalar or array). wavelength in µm.
Source code in dispcraft/optics/elements.py
158 159 160 161 | |
forward ¶
forward(angle, wavelength)
angle : (2,) or (2, N) array — beam direction [rad] wavelength : float or (N,) array — wavelength [µm]
Returns : (2,) or (2, N) array — dispersed beam direction [rad]
Source code in dispcraft/optics/elements.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | |
Material ¶
Material(n0, k)
Optical glass: Cauchy dispersion model.
| Parameters: |
|
|---|
Source code in dispcraft/optics/materials.py
11 12 13 | |
refractive_index ¶
refractive_index(wavelength)
Compute n(λ). wavelength in µm.
Source code in dispcraft/optics/materials.py
15 16 17 | |
Prism ¶
Prism(material, A)
Thin prism: angular deviation δ(λ) = A * (n(λ) - 1).
| Parameters: |
|
|---|
Source code in dispcraft/optics/elements.py
14 15 16 | |
deviation ¶
deviation(wavelength)
Angular deviation [rad]. wavelength in µm.
Source code in dispcraft/optics/elements.py
18 19 20 21 | |
Telescope ¶
Telescope(f, sky0=None, angle=0.0)
Bases: Camera
2D telescope: sky position → focal-plane position.
| Parameters: |
|
|---|
Source code in dispcraft/optics/elements.py
98 99 100 101 102 | |
forward ¶
forward(sky)
sky : (2,) or (2, N) array [alpha, delta] [rad] Returns : same shape — focal-plane position [m]
Source code in dispcraft/optics/elements.py
104 105 106 107 108 109 110 111 112 | |
build_instrument_from_config ¶
build_instrument_from_config(config)
Build the (Telescope, Collimator, Grism, Camera, Detector) tuple from a
parameter dict shaped like models/stage1_instrument.toml.
| Returns: |
|
|---|
Source code in dispcraft/optics/instrument.py
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 | |
rotation_matrix ¶
rotation_matrix(angle)
2D rotation matrix for a given angle [rad].
Source code in dispcraft/optics/elements.py
44 45 46 47 48 | |
trace_instrument ¶
trace_instrument(sky, wavelength, tel, coll, grism, cam, det)
2D forward model: sky position + wavelength → detector pixel (x, y).
| Parameters: |
|
|---|
| Returns: |
|
|---|
Source code in dispcraft/optics/instrument.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |