Skip to content

Restore visible fit diagnostics in the imaging walkthrough - #67

Merged
tpn merged 1 commit into
mainfrom
codex/imaging-fit-visualizations-20260928
Sep 28, 2026
Merged

tpn merged 1 commit into
mainfrom
codex/imaging-fit-visualizations-20260928

Conversation

@tpn

@tpn tpn commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

The imaging walkthrough's residual looked blank after the example began using the exact planted blur in its kernel solve. This weakened the visual demonstration of fit diagnostics.

Restore the original trial kernel and keep the same synthetic source images. The notebook now explains the deliberate PSF mismatch and how to rerun with KERNEL_SIGMA = SEEING_SIGMA for a well-matched comparison. The mover mask and data-based fit initialization remain in place.

All four figures have labels. The final figure returns to the original difference/model/residual layout, with a numerical residual colorbar and peak-error percentage. The stamp and model share a scale; the residual has an explicitly separate scale. Residuals retain the documented data-minus-model sign.

Validation

  • make ci-lint: passed.
  • Executed the script and all six notebook cells on an RTX PRO 6000 Blackwell for both kernel settings. All four PNGs matched between script and notebook in each case.
  • Verified that both settings use the original synthetic FITS pixel values. Peak fit error is 9.960% with the trial kernel and 0.00955% with the matched kernel.
  • Visually inspected all four default figures and the matched-kernel fit figure; labels and colorbars are readable, and the default residual structure is clear.
  • Verified notebook format, empty saved outputs, and script/notebook code equivalence. Independent scoped review found no actionable issues.

Repository hygiene

  • No credentials, private paths, local datasets, notebook outputs, or generated run artifacts were added.
  • Large binary artifacts are excluded or intentionally tracked through an approved storage plan.
  • Security-sensitive information is not included.
  • User-visible behavior changes are documented.
  • New dependencies and their licenses are documented (none added).

Use the original trial kernel as an explicit imperfect PSF match while
keeping the source scene, mover mask, and data-based fit initialization.
Explain how to rerun with the matched kernel to compare fit quality.

Label every figure and restore the three-panel dipole view with a
numeric residual colorbar and relative error. Keep the notebook and
script aligned.

Signed-off-by: Trent Nelson <trentn@nvidia.com>
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: NVIDIA/cuPhoton/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: acbb9b75-4388-4740-8933-3d6c33fa220e

📥 Commits

Reviewing files that changed from the base of the PR and between 7f9a066 and b0ab4f9.

📒 Files selected for processing (2)
  • examples/imaging-pipeline/run_imaging_pipeline.ipynb
  • examples/imaging-pipeline/run_imaging_pipeline.py

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.


📝 Walkthrough

Walkthrough

The imaging pipeline example now uses a deliberately broad trial kernel and reports fit-width and residual diagnostics. Its plots use labeled panels and show the dipole-fit residual as data minus model with a separate symmetric scale.

Changes

Imaging Pipeline Example

Layer / File(s) Summary
Trial kernel and subtraction setup
examples/imaging-pipeline/run_imaging_pipeline.py, examples/imaging-pipeline/run_imaging_pipeline.ipynb
The example sets the trial kernel to 1.6, uses it for a degree-1 Gaussian basis, and updates the subtraction guidance and output to describe the broad-kernel comparison.
Fit widths and residual diagnostics
examples/imaging-pipeline/run_imaging_pipeline.py, examples/imaging-pipeline/run_imaging_pipeline.ipynb
The example reports approximate science and matched-template widths. It reports the maximum absolute fit residual relative to the stamp peak.
Labeled panels and residual display
examples/imaging-pipeline/run_imaging_pipeline.py, examples/imaging-pipeline/run_imaging_pipeline.ipynb
Panel helpers add optional labels, and image rows retain each image’s dimensions. The dipole-fit panel shows data minus model with a separate symmetric residual scale and colorbar.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to b0ab4

The script and notebook display the documented residual sign. No issue identified here needs resolution before merging.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@tpn
tpn marked this pull request as ready for review September 28, 2026 16:44
@tpn
tpn requested a review from melo-gonzo as a code owner September 28, 2026 16:44
@tpn tpn added the ai-review Request a focused CodeRabbit review label Sep 28, 2026
@tpn

tpn commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

Please review the notebook and companion script for correctness and consistency. This walkthrough deliberately uses the original broad trial kernel so fit residuals remain visually informative, with a documented matched-kernel comparison. Check residual signs, displayed scales, and notebook/script agreement while preserving that teaching purpose.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@melo-gonzo melo-gonzo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Notebook/script code matches, and the CPU stages reproduce both documented residual levels with clear plot scales and labels. The GPU-only XDR load was not rerun locally.

@tpn
tpn merged commit 0e9f569 into main Sep 28, 2026
59 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a focused CodeRabbit review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants