Stop last-ramp science FITS from following the live CDS/Fowler combo - #56
Draft
cursor[bot] wants to merge 1 commit into
Draft
Stop last-ramp science FITS from following the live CDS/Fowler combo#56cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
The GUI is re-enabled when ZMQ acquire returns, so the operator can switch mode before the archive finishes. The last ramp reused that display frame while stamping the acquire-time DETMODE, so science FITS could be Fowler pixels labeled as CDS (or the reverse). Re-reduce from the raw cube and write every science product from disk with the snapshot. Co-authored-by: Denis Defrère <ddefrere@users.noreply.github.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.
Bug and impact
After Acquire returns, the GUI is re-enabled so the operator can inspect the last frame. The last ramp's science FITS reused that display image, which is reduced with the live CDS/Fowler combo. The header still received the acquire-time snapshot (
DETMODE=CDS, etc.).If the operator switches CDS ↔ Fowler (or changes Fowler pairs) during "finishing FITS…" — easy on a slow SMB copy of a full-frame cube — the archived
*_science.fitsfor that ramp has the wrong pixels with the wrong-looking header. Other ramps in the same sequence were already reduced from disk with the snapshot; only the last file was wrong.Root cause
_finish_acquire_archivespecial-cased the preview ramp:_load_fits_from_path→_store_raw_fits→self._selected_ramp_mode()(live combo)_save_science_fits(frame, …, reduction=params["ramp_mode"])wrote those pixels but stamped the snapshot on the headerPR #54 snapshotted mode for later ramps and for DETMODE cards; it did not stop the last ramp from reusing the live-reduced display frame.
Fix
science_image_for_archive(acquire-time params)._save_science_fits_from_rampso disk products always use the snapshot.Validation
test_last_ramp_science_uses_snapshot_not_live_combo: same cube, live Fowler vs archive CDS, images differ and archive is last-minus-first.python3 -m unittestfortest_h2rg_fits_helpers,test_ramp_plan,test_background_nseq,test_fits_science_load,test_fits_header_meta— 90 tests OK.