Skip to content

Rework series, Tier B-02, bug fixes in atmo_dispersion (shifts) - #35

Open
Yashvi-Sharma wants to merge 4 commits into
mainfrom
rework/tb-02-atmo-dispersion-fixes
Open

Yashvi-Sharma wants to merge 4 commits into
mainfrom
rework/tb-02-atmo-dispersion-fixes

Conversation

@Yashvi-Sharma

Copy link
Copy Markdown
Collaborator

Please refer to the included .md for a summary of the changes.

Yashvi-Sharma and others added 4 commits November 9, 2026 15:46
ShiftFoV3D chose between "roll" and "map_coords" from the median shift of
whichever FOV reached it first, then cached that choice on self.meta for the
lifetime of the effect. Because one instance is shared across every FOV of an
OpticalTrain, the first FOV permanently decided the algorithm for all later
ones, including wavelength ranges where the shift is sub-pixel or very large.
The same stickiness disagreed with _padded_header, which is called from
observe() before the first apply_to and so sized its padding under the
map_coords assumption regardless of what would later be applied.

The method is a physical choice about how the shift is applied, so it is now
required. Both production configs already set it (MaunaKea.yaml, XSHOOTER_SPEC
.yaml). ADCShift builds an inner ADShift purely to obtain uncorrected shift
amounts; that one inherits the configured method rather than needing its own.

Also in this file:
- drop the duplicate SkyCoord import and the unused Any import
- name the 0.1 pixel shift quantisation, which is a floor on dispersion
  accuracy and not just a caching detail
- return the cached sparse shift operator read-only, as psfs/analytical.py
  already does for its cached Gauss-Legendre rule
- delete ADShift.apply_to, a pure pass-through to super()
- annotate ADCShift.z_order as a ClassVar, consistent with the other two

refractive_index and compressibility had no direct test; they now check against
published Ciddor 1996 values, including n = 1.00027653 at the reference
condition and Z_a = 0.9995922115 for dry air.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
AGENTS.md asks for ASCII-only source. refractive_index used literal Unicode
Greek letters as variable names (sigma, alpha, beta, gamma and four rho
variants), and the unit comments carried middle dot, micro and degree signs.

Renames only. Verified the physics is untouched: n at Ciddor's reference
condition is bit-identical at 1.0002765302104355, as is Z_a at
0.9995922115359966.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@Yashvi-Sharma Yashvi-Sharma changed the title Rework series, Tier B, bug fixes in atmo_dispersion (shifts) Rework series, Tier B-02, bug fixes in atmo_dispersion (shifts) Nov 11, 2026
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