Overview
Phase 3: JWST/NIRCam support, validated on the COSMOS-Web ring (RA 150.10048, Dec +1.89301; Mercier et al. 2024) in all four COSMOS-Web bands — F115W/F150W (SW) and F277W/F444W (LW) — against the autolens_assistant demo dataset's modeling-ready products (SW 0.03″/pix 419², LW 0.06″/pix 209²), the four-band parity anchor. Autonomous run (--auto supervised): plan here, mechanical stretches proceed, judgment gates as batched questions, park at ship sign-off.
Routing note: Feature Agent heuristic suggested research re-home a third time; overridden — the JWST design skeleton is in the roadmap and two adapter phases have proven the architecture.
Plan
- Backend dispatch (the altitude work): stage 3 gains a combine-backend concept —
astrodrizzle (HST) vs jwst_image3 (calwebb_image3: tweakreg/skymatch/outlier_detection/resample) — selected by the adapter; likewise the CRDS server (hst-crds vs jwst-crds) moves from a hardcoded constant into the adapter.
- Adapters
nircam_sw / nircam_lw: level-2 _cal products (MJy/sr), crds references via jwst-crds, native scales 0.031/0.063, recommended output 0.03/0.06 matching the COSMOS-Web convention.
- Noise: resampled i2d carries ERR/VAR_POISSON/VAR_RNOISE/WHT — stage 4 reads them (+ consistency check vs the empirical sky), per the roadmap; units decision (MJy/sr vs e-/s) settled empirically against the demo products.
- PSF: tier-1 ePSF from mosaic stars where viable; STPSF as the first tier-2 back-end if mechanical under the pinned env, else parked as a question.
- Integration: reduce the ring in all four bands from MAST
_cal exposures; sub-pixel-registered parity ratios per band vs the demo dataset.
- Env:
jwst 1.14.0 installed into ~/venv/PyAuto under the astropy 6.1.2 constraints (done).
- Design doc
docs/design/jwst.md, roadmap tick, numpy/astropy-only unit tests, ACS+WFC3 regression green (62 tests).
Detailed implementation plan
Affected Repositories
- PyAutoReduce (primary, only)
Branch Survey
| Repository |
Current Branch |
Dirty? |
| ./PyAutoReduce |
feature/wfc3-reduction (pushed, PR #5 awaiting merge) |
clean |
Suggested branch: feature/jwst-nircam from main; if PR #5 merges first it rebases trivially, else the PR stacks (same pattern as phase 2).
Implementation Steps
instruments/adapter.py: add observatory ("hst"/"jwst"), crds_server_url, combine_backend ("astrodrizzle"/"jwst_image3") fields; move the HST server constant out of acquire/crds.py.
instruments/nircam_sw.py + nircam_lw.py: MAST names ("NIRCAM/IMAGE" with channel filtering by filter wavelength or detector), _cal suffix, jwst-crds, native/recommended scales, saturation levels.
drizzle/jwst_combine.py: calwebb_image3 wrapper honoring the pixel-scale/pixfrac dials (resample.pixel_scale, resample.pixfrac), emitting sci/wht(+var) paths + the same diagnostics fragment (WHT uniformity, R).
drizzle/combine.py → thin dispatcher on adapter.combine_backend.
noise/jwst_rms.py: noise map from resampled ERR (or VAR sums), consistency check vs empirical sky; loud on missing extensions.
pipeline.py: route noise construction by backend; PSF/package stages unchanged.
acquire/mast.py: _cal product filtering (calib_level 2), JWST obs_collection ("JWST").
- Tests: adapter entries, dispatch routing, jwst noise reader on synthetic HDUs, CRDS server per observatory.
scripts/reduce_cosmos_web_ring.py --band F444W|F150W|...: acquire→image3→noise→psf→package + parity vs autolens_assistant/dataset/imaging/cosmos_web_ring/wavebands/<band>/.
Key Files
docs/design/roadmap.md — JWST section being implemented
autoreduce/instruments/wfc3_ir.py — adapter pattern
autolens_assistant/dataset/imaging/cosmos_web_ring/wavebands/ — parity anchor
Original Prompt
Click to expand
See PyAutoMind/issued/jwst_nircam_cosmos_web.md.
Overview
Phase 3: JWST/NIRCam support, validated on the COSMOS-Web ring (RA 150.10048, Dec +1.89301; Mercier et al. 2024) in all four COSMOS-Web bands — F115W/F150W (SW) and F277W/F444W (LW) — against the autolens_assistant demo dataset's modeling-ready products (SW 0.03″/pix 419², LW 0.06″/pix 209²), the four-band parity anchor. Autonomous run (
--autosupervised): plan here, mechanical stretches proceed, judgment gates as batched questions, park at ship sign-off.Routing note: Feature Agent heuristic suggested research re-home a third time; overridden — the JWST design skeleton is in the roadmap and two adapter phases have proven the architecture.
Plan
astrodrizzle(HST) vsjwst_image3(calwebb_image3: tweakreg/skymatch/outlier_detection/resample) — selected by the adapter; likewise the CRDS server (hst-crds vs jwst-crds) moves from a hardcoded constant into the adapter.nircam_sw/nircam_lw: level-2_calproducts (MJy/sr),crdsreferences via jwst-crds, native scales 0.031/0.063, recommended output 0.03/0.06 matching the COSMOS-Web convention._calexposures; sub-pixel-registered parity ratios per band vs the demo dataset.jwst1.14.0 installed into~/venv/PyAutounder the astropy 6.1.2 constraints (done).docs/design/jwst.md, roadmap tick, numpy/astropy-only unit tests, ACS+WFC3 regression green (62 tests).Detailed implementation plan
Affected Repositories
Branch Survey
Suggested branch:
feature/jwst-nircamfrommain; if PR #5 merges first it rebases trivially, else the PR stacks (same pattern as phase 2).Implementation Steps
instruments/adapter.py: addobservatory("hst"/"jwst"),crds_server_url,combine_backend("astrodrizzle"/"jwst_image3") fields; move the HST server constant out ofacquire/crds.py.instruments/nircam_sw.py+nircam_lw.py: MAST names ("NIRCAM/IMAGE" with channel filtering by filter wavelength or detector),_calsuffix, jwst-crds, native/recommended scales, saturation levels.drizzle/jwst_combine.py: calwebb_image3 wrapper honoring the pixel-scale/pixfrac dials (resample.pixel_scale,resample.pixfrac), emitting sci/wht(+var) paths + the same diagnostics fragment (WHT uniformity, R).drizzle/combine.py→ thin dispatcher onadapter.combine_backend.noise/jwst_rms.py: noise map from resampled ERR (or VAR sums), consistency check vs empirical sky; loud on missing extensions.pipeline.py: route noise construction by backend; PSF/package stages unchanged.acquire/mast.py:_calproduct filtering (calib_level 2), JWST obs_collection ("JWST").scripts/reduce_cosmos_web_ring.py --band F444W|F150W|...: acquire→image3→noise→psf→package + parity vsautolens_assistant/dataset/imaging/cosmos_web_ring/wavebands/<band>/.Key Files
docs/design/roadmap.md— JWST section being implementedautoreduce/instruments/wfc3_ir.py— adapter patternautolens_assistant/dataset/imaging/cosmos_web_ring/wavebands/— parity anchorOriginal Prompt
Click to expand
See
PyAutoMind/issued/jwst_nircam_cosmos_web.md.