You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement the Keck NIRC2 AO reduction designed in #9, on the post-phase-3 consolidated layout (#10, merged 371721f). This makes PyAutoReduce's fourth instrument family — and its first ground-based one — live: raw KOA level-0 NIRC2 frames → modeling-ready al.Imaging.from_fits datasets. Run under --auto at effective level supervised (feature @ large); ship sign-off will park with a batched question per the contract.
Decisions adopted from #9's batched set (user-resolved 2026-07-09): drizzle-package combine backend, B1938+666 (SHARP I) validation anchor, and sequencing resolved by the #10 merge.
autoreduce/instruments/nirc2.py adapter (camera plate scales 9.942/39.686 mas, gain, read noise per coadd, distortion-solution selection by date: Yelda 2010 pre-2015-04-13 / Service 2016 after) + acquire-backend seam (koa | mast) with PyKOA TAP queries for science + night calibrations + PSF-star frames.
autoreduce/calibrate/ (new stage): DN→e⁻, dark subtraction, flat-field, bad-pixel mask. numpy/astropy only.
autoreduce/sky/ (new stage): running median sky from N temporally adjacent object-masked frames, iterative mask update, per-frame sky level recorded for the noise stage.
K2 in autoreduce/drizzle/ (post-refactor _common.py seams): dewarp-as-drizzle-mapping, cross-correlation registration, combine at 10 mas (narrow) / 40 mas (wide) with optional 2×2 binning dial; noise construction + Casertano R; blank-sky closure check.
Unit tests in test_autoreduce/ (numpy/astropy-only, synthetic frames). Prototype/validation script prototypes/b1938_keck_spike.py + scripts/reduce_b1938.py for the real-data leg (network; results reported on this issue, FITS never committed).
Four-leg ship gate → park at sign-off (supervised).
Overview
Implement the Keck NIRC2 AO reduction designed in #9, on the post-phase-3 consolidated layout (#10, merged 371721f). This makes PyAutoReduce's fourth instrument family — and its first ground-based one — live: raw KOA level-0 NIRC2 frames → modeling-ready
al.Imaging.from_fitsdatasets. Run under--autoat effective level supervised (feature @ large); ship sign-off will park with a batched question per the contract.Decisions adopted from #9's batched set (user-resolved 2026-07-09): drizzle-package combine backend, B1938+666 (SHARP I) validation anchor, and sequencing resolved by the #10 merge.
Plan
docs/design/keck_ao.md(the parked research: plan the Keck NIRC2 AO reduction workflow (SHARP context) #9 write leg, adopting post-refactor module names) + roadmap update.calibratestage (DN→e⁻, dark, flat, bad-pixel) andskystage (temporally adjacent object-masked running sky).drizzlepackage; cross-correlation registration; first-principles noise map (sky + dark + read/√coadds + Poisson, coverage-propagated, × Casertano R).psf_provisionalprovenance, AO-conditions block); unchanged output contract; B1938+666 validation per the four acceptance checks on research: plan the Keck NIRC2 AO reduction workflow (SHARP context) #9.Detailed implementation plan
Work Classification
Library (PyAutoReduce).
Affected Repositories
Branch Survey
Suggested branch:
feature/keck-ao-reductionWorktree root:
~/Code/PyAutoLabs-wt/keck-ao-reduction/Implementation Steps
docs/design/keck_ao.mdfrom the draft on research: plan the Keck NIRC2 AO reduction workflow (SHARP context) #9 +docs/design/roadmap.mdground-based section.autoreduce/instruments/nirc2.pyadapter (camera plate scales 9.942/39.686 mas, gain, read noise per coadd, distortion-solution selection by date: Yelda 2010 pre-2015-04-13 / Service 2016 after) + acquire-backend seam (koa|mast) with PyKOA TAP queries for science + night calibrations + PSF-star frames.autoreduce/calibrate/(new stage): DN→e⁻, dark subtraction, flat-field, bad-pixel mask. numpy/astropy only.autoreduce/sky/(new stage): running median sky from N temporally adjacent object-masked frames, iterative mask update, per-frame sky level recorded for the noise stage.autoreduce/drizzle/(post-refactor_common.pyseams): dewarp-as-drizzle-mapping, cross-correlation registration, combine at 10 mas (narrow) / 40 mas (wide) with optional 2×2 binning dial; noise construction + Casertano R; blank-sky closure check.autoreduce/psf/+package: PSF-star pipeline-identical reduction → candidate products, provenance extensions (psf_provisional, FWHM/epoch/tip-tilt distance, AO-conditions block).test_autoreduce/(numpy/astropy-only, synthetic frames). Prototype/validation scriptprototypes/b1938_keck_spike.py+scripts/reduce_b1938.pyfor the real-data leg (network; results reported on this issue, FITS never committed).Key Files
docs/design/keck_ao.md,docs/design/roadmap.mdautoreduce/instruments/,autoreduce/acquire/,autoreduce/drizzle/_common.py,autoreduce/noise/,autoreduce/psf/,autoreduce/pipeline.pyautoreduce/calibrate/,autoreduce/sky/(new)test_autoreduce/,prototypes/,pyproject.toml(new deps: pykoa, drizzle)Original Prompt
Click to expand starting prompt
Original request: "A large refactor of PyAutoReduce just merge in, so combine that with this research to get keck-ao data reduction live --auto"
(Full prompt: PyAutoMind
feature/pyautoreduce/keck_ao_reduction.md; design + research context: #9.)