Skip to content

Report phase input in OPD metres - #10

Merged
jacotay7 merged 1 commit into
mainfrom
fix/input-opd-metadata-units
Oct 7, 2026
Merged

jacotay7 merged 1 commit into
mainfrom
fix/input-opd-metadata-units

Conversation

@jacotay7

@jacotay7 jacotay7 commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Problem

With input.quantity = "phase", both sensors put the raw input into OpticalResult.opd_m. Its RMS was then recorded as wfs_input_opd_rms_m in every frame's metadata. A 13 nm wavefront supplied as phase was therefore recorded as 0.083 m. Downstream users of opd_m that assume metres (e.g. examples/keck_haka/simulate.py multiplies by 1e9) were off by the same factor. The detector images were always correct, because the optics go through WavefrontModel.opd, which converts. Spotted during the aocore migration (#9).

Fix

The new WavefrontModel.input_opd(value) returns OPD input unchanged and converts phase at reference_wavelength_m (aocore.phase_to_opd). The Shack-Hartmann and pyramid engines both build OpticalResult.opd_m through it, and the field now has a docstring.

Tests

  • New test_phase_input_reports_its_opd_in_metres (SH and pyramid): the same wavefront given as OPD and as phase gives the same wfs_input_opd_rms_m (rel 1e-12), the same opd_m and the same image. Both cases fail on main (0.083 vs 1.3e-8).
  • Local gate: 210 passed; GPU tests 17 passed; ruff and mypy are clean. The 2 OOPAO validation failures are the known local-environment ones and fail the same way on main.

🤖 Generated with Claude Code

OpticalResult.opd_m and the wfs_input_opd_rms_m metadata carried the raw
input, so phase input was recorded in radians under a metres name. Both
sensors now pass the input through WavefrontModel.input_opd, which converts
phase at the reference wavelength and returns OPD input unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jacotay7
jacotay7 merged commit 30a2849 into main Oct 7, 2026
12 checks passed
@jacotay7
jacotay7 deleted the fix/input-opd-metadata-units branch October 7, 2026 02:24
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