Overview
Implement the HST/ACS reduction pipeline designed and spike-validated under #1, turning prototypes/slacs_f814w_spike.py into production autoreduce code behind the ACS/WFC instrument adapter. docs/design/hst_acs_pipeline.md is the authoritative spec. Autonomous run (--auto, effective level supervised): plan recorded here, mechanical stretches proceed, judgment gates arrive as batched questions, the run parks at ship sign-off — merge stays human.
Routing note: the Brain Feature Agent's heuristic suggested re-homing as research; overridden in-session because the research phase (design docs + parity spike) completed under #1 with user approval — this task is implementation.
Plan
- Target spec + pipeline orchestrator: a per-target declaration (name, coords, filter, cutout size, dials) driving acquire → align → drizzle → noise → psf → package.
- Acquire: filtered MAST query (direct CAL-2 observations, HAP skycells excluded),
_flc download, CRDS best-references sync, size-capped transient cache with manifest + eviction.
- Drizzle: AstroDrizzle wrapper with user-facing
pixfrac/kernel dials, WHT-uniformity diagnostic + correlated-noise factor R reported per run; single-exposure branch (single-image drizzle, CR handling via DQ + L.A. Cosmic-style masking decision recorded).
- Noise: σ = √(N/W + σ²_sky) with R applied; loud failure on NaN/zero weights inside the cutout.
- PSF: tier-1 empirical ePSF (star selection + photutils EPSFBuilder) with quality diagnostics; tier-2 fallback interface (STScI focus-diverse ePSF grid / TinyTim) — implemented if mechanical, else parked as a batched question.
- Package: WCS-intact cutouts +
reduction.json provenance.
- Tests: numpy/astropy-only unit tests (noise math, R factor, cache manifest/eviction, cutout geometry, adapter registry, star filters on synthetic data); network/drizzlepac integration lives in
scripts/.
- Acceptance: re-reduce slacs0008-0004 through the production pipeline; parity vs legacy dataset; chase the spike's ~7% flux offset with visit-filtered exposure set + sub-pixel registration. Comparative PyAutoLens fits are expected to park as a sign-off question (long runs).
Detailed implementation plan
Affected Repositories
- PyAutoReduce (primary, only)
Branch Survey
| Repository |
Current Branch |
Dirty? |
| ./PyAutoReduce |
main |
clean |
Suggested branch: feature/hst-acs-phase1 (in-place — single-repo task, new repo, no parallel claims; precedent: clone-mitosis-agent)
Implementation Steps
autoreduce/target.py — TargetSpec (name, ra, dec, instrument, filter, cutout_shape, pixfrac, kernel, final_scale, proposal filter) loadable from YAML; autoreduce/pipeline.py — stage orchestrator with per-stage provenance accumulation.
autoreduce/instruments/acs_wfc.py — adapter: native scale, product suffix (_flc), jref env key, default drizzle params, zero-point/units helpers; instruments/__init__.py registry; nothing outside the adapter names a detector.
autoreduce/acquire/mast.py — query (direct calib-level-2 obs only, proposal/visit grouping), FLC product filter, download; acquire/crds.py — bestrefs sync into cache; acquire/cache.py — manifest, size cap, per-target eviction sparing references.
autoreduce/align/diagnostics.py — a-priori WCS acceptance check; TweakReg call behind a trigger flag.
autoreduce/drizzle/combine.py — AstroDrizzle wrapper (dials, cps, IVM, north-up 0.05″), single-exposure branch, WHT RMS/median diagnostic, R computation (Casertano) recorded.
autoreduce/noise/rms.py — sigma map from SCI+WHT+EXPTIME with R applied; NaN/zero-weight loud failure; blank-sky empirical check helper.
autoreduce/psf/stars.py + psf/epsf.py — star selection (unsaturated, uncrowded, DQ-clean, point-like) + EPSFBuilder wrapper emitting 21×21 + 61×61 kernels, odd/centred/normalised, diagnostics to provenance; psf/fallback.py — tier-2 interface.
autoreduce/package/cutout.py + package/provenance.py — WCS-correct cutouts, reduction.json.
test_autoreduce/ — unit tests per module (numpy/astropy only; drizzlepac/astroquery imports guarded so the suite runs without them).
scripts/reduce_slacs0008.py — integration: production pipeline end-to-end on slacs0008-0004 + parity report vs legacy dataset.
Key Files
docs/design/hst_acs_pipeline.md — the spec, incl. deviation table + parity appendix
prototypes/slacs_f814w_spike.py — validated reference implementation
Original Prompt
Click to expand starting prompt
See PyAutoMind/issued/hst_acs_phase1.md (filed from feature/pyautoreduce/hst_acs_phase1.md) — scope: production implementation of the design-doc pipeline, user-facing pixfrac/kernel dials, SLACS-V single-exposure branch, parity acceptance on 2–3 SLACS lenses including PyAutoLens fits agreeing on both reductions, numpy-only unit tests, ~/venv/PyAuto extension under constraints.
Overview
Implement the HST/ACS reduction pipeline designed and spike-validated under #1, turning
prototypes/slacs_f814w_spike.pyinto productionautoreducecode behind the ACS/WFC instrument adapter.docs/design/hst_acs_pipeline.mdis the authoritative spec. Autonomous run (--auto, effective level supervised): plan recorded here, mechanical stretches proceed, judgment gates arrive as batched questions, the run parks at ship sign-off — merge stays human.Routing note: the Brain Feature Agent's heuristic suggested re-homing as research; overridden in-session because the research phase (design docs + parity spike) completed under #1 with user approval — this task is implementation.
Plan
_flcdownload, CRDS best-references sync, size-capped transient cache with manifest + eviction.pixfrac/kerneldials, WHT-uniformity diagnostic + correlated-noise factor R reported per run; single-exposure branch (single-image drizzle, CR handling via DQ + L.A. Cosmic-style masking decision recorded).reduction.jsonprovenance.scripts/.Detailed implementation plan
Affected Repositories
Branch Survey
Suggested branch:
feature/hst-acs-phase1(in-place — single-repo task, new repo, no parallel claims; precedent: clone-mitosis-agent)Implementation Steps
autoreduce/target.py—TargetSpec(name, ra, dec, instrument, filter, cutout_shape, pixfrac, kernel, final_scale, proposal filter) loadable from YAML;autoreduce/pipeline.py— stage orchestrator with per-stage provenance accumulation.autoreduce/instruments/acs_wfc.py— adapter: native scale, product suffix (_flc),jrefenv key, default drizzle params, zero-point/units helpers;instruments/__init__.pyregistry; nothing outside the adapter names a detector.autoreduce/acquire/mast.py— query (direct calib-level-2 obs only, proposal/visit grouping), FLC product filter, download;acquire/crds.py— bestrefs sync into cache;acquire/cache.py— manifest, size cap, per-target eviction sparing references.autoreduce/align/diagnostics.py— a-priori WCS acceptance check; TweakReg call behind a trigger flag.autoreduce/drizzle/combine.py— AstroDrizzle wrapper (dials, cps, IVM, north-up 0.05″), single-exposure branch, WHT RMS/median diagnostic, R computation (Casertano) recorded.autoreduce/noise/rms.py— sigma map from SCI+WHT+EXPTIME with R applied; NaN/zero-weight loud failure; blank-sky empirical check helper.autoreduce/psf/stars.py+psf/epsf.py— star selection (unsaturated, uncrowded, DQ-clean, point-like) + EPSFBuilder wrapper emitting 21×21 + 61×61 kernels, odd/centred/normalised, diagnostics to provenance;psf/fallback.py— tier-2 interface.autoreduce/package/cutout.py+package/provenance.py— WCS-correct cutouts,reduction.json.test_autoreduce/— unit tests per module (numpy/astropy only; drizzlepac/astroquery imports guarded so the suite runs without them).scripts/reduce_slacs0008.py— integration: production pipeline end-to-end on slacs0008-0004 + parity report vs legacy dataset.Key Files
docs/design/hst_acs_pipeline.md— the spec, incl. deviation table + parity appendixprototypes/slacs_f814w_spike.py— validated reference implementationOriginal Prompt
Click to expand starting prompt
See
PyAutoMind/issued/hst_acs_phase1.md(filed fromfeature/pyautoreduce/hst_acs_phase1.md) — scope: production implementation of the design-doc pipeline, user-facing pixfrac/kernel dials, SLACS-V single-exposure branch, parity acceptance on 2–3 SLACS lenses including PyAutoLens fits agreeing on both reductions, numpy-only unit tests,~/venv/PyAutoextension under constraints.