Skip to content

feat: polynomial vignetting, saturation, and chromatic vignetting corrections#871

Open
alextudorica wants to merge 6 commits into
CroatianMeteorNetwork:prereleasefrom
alextudorica:feat-spectral-response-calibration
Open

feat: polynomial vignetting, saturation, and chromatic vignetting corrections#871
alextudorica wants to merge 6 commits into
CroatianMeteorNetwork:prereleasefrom
alextudorica:feat-spectral-response-calibration

Conversation

@alextudorica

@alextudorica alextudorica commented May 30, 2026

Copy link
Copy Markdown

Summary

  • Add three optional photometric corrections to the calibration pipeline: polynomial vignetting residual (r^2 + r^4 on top of cos^4), saturation correction for bright stars, and chromatic vignetting (position-dependent color term)
  • All corrections default to zero -- existing platepars and pipeline behavior are completely unchanged
  • Wire corrections through all pipeline callers: xyToRaDecPP, ApplyRecalibrate, SkyFit2, CalibrationReport, EventMonitor

Motivation

Analysis of 1,455,601 matched stars across 24 cameras (287 camera-nights) shows:

Correction Scatter reduction
Polynomial vignetting alone 0.60 -> 0.44 mag (27%)
All combined 0.60 -> 0.36 mag (40%)
Cross-validated combined 0.60 -> 0.38 mag (37%)

The current cos^4 vignetting model leaves 0.30-0.60 mag of residual structure. A simple r^2 + r^4 polynomial captures this. Bright stars (mag < 5) show 0.1-0.3 mag saturation bias from ADC clipping. Chromatic vignetting (color term varying with FOV position) is a smaller effect (~0.05 mag) stored in Platepar but deferred for pipeline wiring (requires star colors from catalog).

Changes

  • ApplyAstrometry.py: photomLine, photometryFit, photometryFitRobust, calculateMagnitudes accept optional correction params; sigma-rejection loop keeps per-star arrays in sync
  • Platepar.py: new fields vignetting_poly, saturation_slope, saturation_mag_break, chromatic_vignetting with backward-compatible migration in loadFromDict
  • ApplyRecalibrate.py, SkyFit2.py, CalibrationReport.py, EventMonitor.py: pass corrections from platepar into fitting/magnitude computation
  • Tests/test_photometric_corrections.py: 22 tests covering backward compat, correction math, sign conventions, edge cases, and Platepar migration

Prerelease compatibility

Verified against prerelease branch: zero merge conflicts. The prerelease SkyFit2 band-ratio grid search has additional photometryFit calls that intentionally use default (no-correction) params -- the corrections are fixed per-camera and do not affect which band ratio minimizes scatter.

dvida and others added 6 commits March 24, 2026 15:33
…rk/fix-save_frame-disabled

Fix save_frames disabled when absent from config bug
… corrections

Extend the photometric calibration pipeline with three optional corrections
that together reduce per-star scatter from 0.60 to 0.36 mag (40% improvement,
cross-validated on 1.5M stars across 24 cameras):

1. Polynomial vignetting residual (r^2 + r^4) on top of cos^4, capturing
   higher-order vignetting the current model cannot fit (27% scatter reduction)

2. Saturation correction for bright stars (mag < break), compensating for
   flux clipping at the ADC ceiling during calibration star matching

3. Chromatic vignetting (position-dependent color term), stored in Platepar
   but not yet wired into pipeline callers (requires star colors from catalog)

All corrections default to zero, preserving existing behavior for platepars
without calibrated coefficients. New Platepar fields: vignetting_poly,
saturation_slope, saturation_mag_break, chromatic_vignetting -- all with
backward-compatible migration in loadFromDict.

Pipeline callers wired: xyToRaDecPP, ApplyRecalibrate, SkyFit2, CalibrationReport,
EventMonitor. The sigma-rejection loop in photometryFitRobust keeps per-star
correction arrays in sync when outliers are removed.
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.

3 participants