Fix WavefrontMap coordinates to properly span [-1, 1] for actual sampled points #178
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
OpticStudio's wavefront map analysis exhibits counterintuitive behavior that was not handled correctly by ZOSPy. For N×N sampling, OpticStudio traces an odd number of rays ((N-1)×(N-1)) through the pupil to ensure the pupil center is sampled, then adds empty rows and columns to match the requested sampling size.
The issue was that ZOSPy returned coordinates ranging from approximately [-0.984, 0.984] instead of the correct [-1.0, 1.0] range where OpticStudio actually traces rays.
Before Fix
After Fix
Changes Made
np.linspace(-1, 1, N-1)that properly spans the full normalized pupil rangeTechnical Details
Expected Impact
Existing test reference data will need to be regenerated since the coordinate values have changed from the incorrect to correct values. This is expected and necessary for the fix.
Fixes #177.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.