Skip to content

feat: JWST/NIRCam via the COSMOS-Web ring, four bands (phase 3) #6

Description

@Jammy2211

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

  1. 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.
  2. 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.
  3. 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).
  4. drizzle/combine.py → thin dispatcher on adapter.combine_backend.
  5. noise/jwst_rms.py: noise map from resampled ERR (or VAR sums), consistency check vs empirical sky; loud on missing extensions.
  6. pipeline.py: route noise construction by backend; PSF/package stages unchanged.
  7. acquire/mast.py: _cal product filtering (calib_level 2), JWST obs_collection ("JWST").
  8. Tests: adapter entries, dispatch routing, jwst noise reader on synthetic HDUs, CRDS server per observatory.
  9. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions