Skip to content

Abcd Matrices¤

abcd_surface_power

camino.abcdlux_patch.abcd_surface_power(power) ¤

Source code in src/camino/abcdlux_patch.py
18
19
20
21
22
def abcd_surface_power(power: float | Array) -> Array:
    p = np.asarray(power).reshape(())
    M = np.eye(2, dtype=p.dtype)
    M = M.at[1, 0].set(-p)
    return M
abcd_lens

camino.abcdlux_patch.abcd_lens(focal_length) ¤

Source code in src/camino/abcdlux_patch.py
25
26
27
def abcd_lens(focal_length: float | Array) -> Array:
    f = np.asarray(focal_length).reshape(())
    return abcd_surface_power(1.0 / f)
abcd_mirror

camino.abcdlux_patch.abcd_mirror(radius) ¤

Source code in src/camino/abcdlux_patch.py
30
31
def abcd_mirror(radius: float) -> Array:
    return abcd_surface_power(2.0 / radius)
abcd_free_space

camino.abcdlux_patch.abcd_free_space(z) ¤

Source code in src/camino/abcdlux_patch.py
34
35
36
37
38
def abcd_free_space(z: float | Array) -> Array:
    z = np.asarray(z).reshape(())  # force scalar (0-d)
    M = np.eye(2, dtype=z.dtype)
    M = M.at[0, 1].set(z)
    return M
abcd_fraunhofer

camino.abcdlux_patch.abcd_fraunhofer(focal_length) ¤

Source code in src/camino/abcdlux_patch.py
41
42
def abcd_fraunhofer(focal_length: float) -> Array:
    return np.array([[0.0, focal_length], [-1.0 / focal_length, 0.0]])
compose_abcd

camino.abcdlux_patch.compose_abcd(matrices) ¤

Source code in src/camino/abcdlux_patch.py
45
46
47
48
49
def compose_abcd(matrices: list | tuple) -> Array:
    M = np.eye(2)
    for Mi in matrices:
        M = Mi @ M
    return M