Skip to content

Add HeightProfile with wavelength-dependent material support#475

Merged
HarrisonKramer merged 3 commits intoHarrisonKramer:masterfrom
gustavu92:height-profile-phase
Feb 16, 2026
Merged

Add HeightProfile with wavelength-dependent material support#475
HarrisonKramer merged 3 commits intoHarrisonKramer:masterfrom
gustavu92:height-profile-phase

Conversation

@gustavu92
Copy link
Contributor

Title:
Add HeightProfile with wavelength-dependent material support

Description:
This PR adds a new HeightProfile phase profile that supports wavelength-dependent materials. It allows PhaseInteractionModel to compute phase maps derived from a height map and a dispersive material for each wavelength.

Changes included:

  • Added HeightProfile class (optiland/phase/height_profile.py)
  • Updated BasePhaseProfile and all existing phase profiles to include optional wavelength argument in get_phase, get_gradient, and get_paraxial_gradient
  • Updated PhaseInteractionModel.interact_real_rays to pass ray wavelengths to phase profiles
  • Added tests in tests/test_height_profile_phase.py
  • Minor updates to __init__.py and other phase modules to include the new profile

Related issue:
Closes #474

@gustavu92 gustavu92 marked this pull request as ready for review February 15, 2026 01:00
@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 95.08197% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
optiland/phase/height_profile.py 93.87% 3 Missing ⚠️

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #475   +/-   ##
=======================================
  Coverage   93.16%   93.16%           
=======================================
  Files         303      304    +1     
  Lines       17901    17951   +50     
=======================================
+ Hits        16677    16724   +47     
- Misses       1224     1227    +3     
Files with missing lines Coverage Δ
optiland/interactions/phase_interaction_model.py 93.40% <100.00%> (ø)
optiland/phase/__init__.py 100.00% <100.00%> (ø)
optiland/phase/base.py 86.20% <100.00%> (ø)
optiland/phase/constant.py 100.00% <100.00%> (ø)
optiland/phase/grid.py 92.10% <100.00%> (ø)
optiland/phase/linear_grating.py 91.66% <100.00%> (ø)
optiland/phase/radial.py 100.00% <100.00%> (ø)
optiland/phase/height_profile.py 93.87% <93.87%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@HarrisonKramer
Copy link
Owner

Hi @gustavu92,

Thank you for submitting this! A really great addition. Very glad you were able to contribute.

Added you as an author in the docs. If you prefer not to be there, just let me know.

Regards,
Kramer

@HarrisonKramer HarrisonKramer merged commit fd572a2 into HarrisonKramer:master Feb 16, 2026
11 checks passed
@gustavu92 gustavu92 deleted the height-profile-phase branch February 19, 2026 16:34
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.

Add HeightProfile with wavelength-dependent material

2 participants