Repository navigation
Rework series, Tier B-05, integrate spectral bins as an opt-in while keeping upstream version as default - #37
Open
Yashvi-Sharma wants to merge 3 commits into
Open
Yashvi-Sharma wants to merge 3 commits into
Yashvi-Sharma wants to merge 3 commits into
Conversation
The fork replaced upstream's point sampling of spectra with bin integration, and deleted the upstream code paths rather than branching around them. That cannot go upstream as-is: it moves the flux of every existing instrument. !SIM.spectral.integrate_spectral_bins restores the upstream behaviour by default and selects the fork's behaviour when set. One flag covers the whole set, because the parts are not independently selectable: - prepare_source resampling vs cube rebinning: resampling first and then integrating destroys narrow lines and is worse than either alone. - edge-plane f0/f1 scaling vs rebinning: pre-scaling makes a partial-bin count, which rebinning then integrates again over the plane's own width. - cube_waveset padding vs extract_from padding: a padded grid over an unpadded extraction leaves a zero cliff at both band edges. Gating the single spectral_padding assignment in observe() reduces five other sites to upstream by construction, since the padding stays 0 um. The off path returns upstream's literal np.arange grid including its off-by-one truncation. The two forms are not interchangeable: they differ by 4e-16 um over 1.9-2.1 at 0.01 and 2.2e-12 um over 0.3-2.5 at 1e-5, and the truncation drops a whole bin, so a test asserts exact equality. Left unconditional, since they are correct on both paths: the .copy() that stops extraction mutating the caller's cube, abs(wdel) in the mask, float64 for cube data, and the CDELT3/CRVAL3 header written by _make_cubefields. Deletes test_reuses_cached_spectrum_waveset, which referenced a module attribute removed when the waveset cache was dropped, and so errored rather than failed. The cache is deliberately gone: a SourceSpectrum can re-sample itself in place through z, which another test asserts. Note the two test_basic_instrument flux regressions are unaffected by this flag; they come from the unflagged spatial projection rework, which is a separate piece of work. 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.