Skip to content

Add FZP telescope tutorial to docs#153

Open
jacobdparker wants to merge 1 commit into
mainfrom
tutorials/fzp-telescope
Open

Add FZP telescope tutorial to docs#153
jacobdparker wants to merge 1 commit into
mainfrom
tutorials/fzp-telescope

Conversation

@jacobdparker
Copy link
Copy Markdown
Contributor

Summary

  • Adds docs/tutorials/fzp_focus.ipynb: a new Jupyter tutorial modeling a Fresnel Zone Plate (FZP) as a holographic grating with HolographicRulingSpacing, designed to focus 171 Å EUV light (MUSE science wavelength)
  • Registers the tutorial in docs/index.rst

Tutorial contents

  1. FZP constructionHolographicRulingSpacing with recording beam x1 at 1 AU so residual defocus δf = f²/|x1| ≈ 7 pm, far below the diffraction limit
  2. Solar disk source — 0.5° full angular diameter
  3. Normalization workaround — documents the known issue where SequentialSystem's backward-trace normalization re-applies the grating equation for transmissive surfaces (doubling the deflection angle); fix: override
    rayfunction_default with physical coordinates
  4. Spot diagrams — across the ±0.19° sensor-limited field of view
  5. Diffraction-limited verification — geometric RMS 0.33 pm vs Airy radius 0.149 μm (ratio ~2×10⁻⁶)
  6. Chromatic aberration — defocused disks at 169 Å (r = 0.82 mm) and 174 Å (r = 1.23 mm) vs diffraction-limited point at design wavelength

Adds docs/tutorials/fzp_focus.ipynb, a new Jupyter tutorial demonstrating
how to model a Fresnel Zone Plate (FZP) as a holographic grating using
HolographicRulingSpacing.  The tutorial covers:

- Recording geometry: x1 at 1 AU (sun distance) and x2 at the focal
  point, producing an ideal on-axis FZP for 171 Å EUV light
- Solar disk source (0.5° full diameter) as the object surface
- Known limitation with SequentialSystem backward-trace normalization
  for transmissive gratings, and the workaround (override
  rayfunction_default with physical coordinates)
- Spot diagrams across the ±0.19° field of view
- Diffraction-limited performance verification: geometric RMS spot
  0.33 pm vs Airy disk radius 0.149 μm (ratio ~2×10⁻⁶)
- Chromatic aberration demo: defocused disks at 169 Å (r=0.82 mm)
  and 174 Å (r=1.23 mm) vs diffraction-limited point at 171 Å

Also registers the new tutorial in docs/index.rst.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@jacobdparker jacobdparker requested a review from roytsmart May 21, 2026 21:29
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.27%. Comparing base (22a9629) to head (71ead9f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #153   +/-   ##
=======================================
  Coverage   99.27%   99.27%           
=======================================
  Files         108      108           
  Lines        5391     5391           
=======================================
  Hits         5352     5352           
  Misses         39       39           
Flag Coverage Δ
unittests 99.27% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": "FZP Telescope Tutorial\n======================\n\nA `Fresnel Zone Plate (FZP) <https://en.wikipedia.org/wiki/Zone_plate>`_\nis a diffractive optical element that focuses light by encoding the\ninterference pattern of two spherical waves on a flat surface.\nIn :mod:`optika`, an FZP is modeled as a transmissive surface with\n:class:`~optika.rulings.HolographicRulingSpacing` rulings, where the\ntwo recording-beam origins define the focal geometry.\n\nThis tutorial builds a single-element FZP telescope that focuses\ncollimated 171 Å EUV light onto a detector and examines the resulting\nspot diagrams."
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expand FZP in title

"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": "and the focal length"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"and" is used twice

"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": "Holographic recording geometry\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nAn FZP is equivalent to a holographic grating whose rulings were\nrecorded by interfering two coherent beams.\nTo focus incoming collimated light (a plane wave from :math:`z = -\\infty`)\nonto a focal point at :math:`z = +\\text{focal\\_length}`, we choose:\n\n- **Recording beam 1** (``x1``): originates very far away on the optical\n axis, representing a plane wave. With ``is_diverging_1=True`` and\n :math:`x_1 \\to -\\infty`, the unit vectors from :math:`x_1` to every\n point on the surface become parallel, so the ruling pattern is\n identical to that produced by a true plane wave. We place ``x1`` at\n 1 AU (the Earth–Sun distance) so that the residual defocus\n :math:`\\delta f = f^2 / |x_1| \\approx 7\\ \\mathrm{pm}` is far below\n the diffraction limit.\n- **Recording beam 2** (``x2``): converges *to* the desired focal point\n at :math:`z = +\\text{focal\\_length}`. ``is_diverging_2=False`` means\n rays are directed toward :math:`x_2`, i.e. the second recording beam\n is a converging spherical wave.\n\nThe :class:`~optika.rulings.HolographicRulingSpacing` class computes\nthe spatially-varying ruling vector :math:`\\mathbf{d}(\\mathbf{r})` from\nthese two source points."
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So is 7 pm really correct?

"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": "Holographic recording geometry\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nAn FZP is equivalent to a holographic grating whose rulings were\nrecorded by interfering two coherent beams.\nTo focus incoming collimated light (a plane wave from :math:`z = -\\infty`)\nonto a focal point at :math:`z = +\\text{focal\\_length}`, we choose:\n\n- **Recording beam 1** (``x1``): originates very far away on the optical\n axis, representing a plane wave. With ``is_diverging_1=True`` and\n :math:`x_1 \\to -\\infty`, the unit vectors from :math:`x_1` to every\n point on the surface become parallel, so the ruling pattern is\n identical to that produced by a true plane wave. We place ``x1`` at\n 1 AU (the Earth–Sun distance) so that the residual defocus\n :math:`\\delta f = f^2 / |x_1| \\approx 7\\ \\mathrm{pm}` is far below\n the diffraction limit.\n- **Recording beam 2** (``x2``): converges *to* the desired focal point\n at :math:`z = +\\text{focal\\_length}`. ``is_diverging_2=False`` means\n rays are directed toward :math:`x_2`, i.e. the second recording beam\n is a converging spherical wave.\n\nThe :class:`~optika.rulings.HolographicRulingSpacing` class computes\nthe spatially-varying ruling vector :math:`\\mathbf{d}(\\mathbf{r})` from\nthese two source points."
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

replace +\\text{focal\\_length} with :math:f and define

"outputs": [],
"execution_count": 53
},
{
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need "Source" heading and short explanation

"metadata": {
"raw_mimetype": "text/restructuredtext"
},
"source": "Because the internal normalization algorithm in\n:class:`~optika.systems.SequentialSystem` traces rays *backward* through\nthe system to establish the field-of-view scale, and because this\nbackward trace re-applies the grating equation of a transmissive FZP\n(doubling the deflection angle), we must compute the default ray function\ndirectly with physical coordinates and cache the result manually.\n\n.. note::\n\n This is a known limitation when ``object_is_at_infinity=True`` with\n a transmissive grating as the pupil stop. Reflective systems (e.g.\n the prime-focus telescope) are not affected."
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really true? Check if the normalization algorithm works here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants