Skip to content

Feature/angle vs height #215

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Jul 8, 2025
Merged

Feature/angle vs height #215

merged 13 commits into from
Jul 8, 2025

Conversation

HarrisonKramer
Copy link
Owner

Angle vs. Height Analysis

Represents an analysis of incident angle vs. image height by varying through all pupil/field coordinates for a given image field/pupil point.

Example:

import optiland.backend as be
from optiland.analysis import FieldIncidentAngleVsHeight
from optiland.optic import Optic

lens = Optic(name = 'Simple Scan Optic') 
lens.add_wavelength(value=0.63, is_primary=True) 
lens.add_surface(index=0, thickness=be.inf, comment='telecentric beam')
lens.add_surface(index=1, thickness=153.2, is_stop=True, comment='scan mirror')
lens.add_surface(index=2, thickness=5, radius=be.inf, material='N-SF11', comment='PCX front surface')
lens.add_surface(index=3, thickness=157.8, radius=-122.3, comment='PCX back surface')
lens.add_surface(index=4, comment='image plane') 
lens.set_aperture(aperture_type="EPD", value=3)
lens.set_field_type(field_type='angle')
lens.add_field(y=0)
lens.add_field(y=7)
_ = lens.draw()

angle_vs_height = FieldIncidentAngleVsHeight(lens)
angle_vs_height.view()

image

image

- Updated _plot_angle_vs_height to support color mapping based on scan range.
- Modified plot_data_list structure to include scan_range and legend_label.
- Improved title generation to include individual trace labels.
- Added colorbar to the plot for better visualization of scan range.
- Adjusted view method to determine colorbar label based on fixed coordinates.
- Refactored coordinate handling in PupilIncidentAngleVsHeight and FieldIncidentAngleVsHeight classes for clarity.
Copy link

codecov bot commented Jul 8, 2025

Codecov Report

Attention: Patch coverage is 94.87179% with 6 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
optiland/analysis/angle_vs_height.py 94.82% 6 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #215      +/-   ##
==========================================
- Coverage   95.51%   95.51%   -0.01%     
==========================================
  Files         162      163       +1     
  Lines        9016     9133     +117     
==========================================
+ Hits         8612     8723     +111     
- Misses        404      410       +6     
Files with missing lines Coverage Δ
optiland/analysis/__init__.py 100.00% <100.00%> (ø)
optiland/analysis/angle_vs_height.py 94.82% <94.82%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@HarrisonKramer HarrisonKramer merged commit 8a24a6e into master Jul 8, 2025
12 checks passed
@HarrisonKramer HarrisonKramer deleted the feature/angle_vs_height branch July 8, 2025 09:00
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.

1 participant