Overview
The existing scripts/interferometer/casa_reduction.py is an incomplete stub with most
code commented out. Interferometer users on Slack repeatedly need guidance on turning
CASA-reduced ALMA .ms data into PyAutoLens-compatible visibilities, uv-wavelengths
and sigma arrays. This task produces a first-draft end-to-end walkthrough script that
can be iterated on with real users in Slack.
Plan
- Research CASA reduction workflows and ALMA .ms structure
- Read existing interferometer workspace scripts for convention
- Rewrite casa_reduction.py as a coherent narrative covering split → channel avg →
(optional uvcontsub) → statwt → export → build al.Interferometer
- Borrow working helpers from z_staging/interferometer_data_prep/
- Aim for "good enough to share on Slack", not final
Detailed implementation plan
Affected Repositories
- autolens_workspace (primary)
Work Classification
Workspace
Branch Survey
| Repository |
Current Branch |
Dirty? |
| autolens_workspace |
main |
dirty (unrelated dataset/config changes from prior session) |
Suggested branch: feature/interferometer-data-prep
Worktree root: ~/Code/PyAutoLabs-wt/interferometer-data-prep/
Implementation Steps
- Read
scripts/interferometer/start_here.py, data_preparation.py, simulator.py
to match tone, imports (import autolens as al), and docstring style.
- Rewrite
scripts/interferometer/casa_reduction.py:
- Intro: .ms layout
(2, n_spw, n_c, n_v, 2) vs al.Interferometer shapes
- Section: CASA
split per field/spw
- Section: channel averaging via
split(width=...)
- Section: continuum subtraction (
uvcontsub) — optional
- Section:
statwt for realistic sigmas
- Section: Python helpers for DATA/UVW/CHAN_FREQ/SIGMA export to FITS
(pulled from z_staging/interferometer_data_prep/main_uvcontsub_SPT0538_CO9-8.py)
- Section: Concatenate spws, average polarisations, build
al.Interferometer
- Section: Slack pointer for edge cases
- Regenerate notebook via
/generate_and_merge after user review.
Key Files
scripts/interferometer/casa_reduction.py — full rewrite
notebooks/interferometer/casa_reduction.ipynb — regenerated later
Original Prompt
Click to expand starting prompt
In the file @autolens_workspace/scripts/casa_reduction.py, I attempt to give a run
through of how one can prepare data via CASA.
In the file @z_staging/interferometer_data_prep/main_uvcontsub_SPT0538_CO9-8.py, I
have example reduction scripts from a an autolens user.
Can you do a bit of deep research on CASA and interferometer data reduction in
general, read a few interferometer workspace scripts for context and attempt to
produce some sort of useable and help data reduciton script for interferometer
users? It doesnt need to be perfect, I will back and forth it with interferometer
people on the autolens SLACK.
Overview
The existing
scripts/interferometer/casa_reduction.pyis an incomplete stub with mostcode commented out. Interferometer users on Slack repeatedly need guidance on turning
CASA-reduced ALMA
.msdata into PyAutoLens-compatible visibilities, uv-wavelengthsand sigma arrays. This task produces a first-draft end-to-end walkthrough script that
can be iterated on with real users in Slack.
Plan
(optional uvcontsub) → statwt → export → build al.Interferometer
Detailed implementation plan
Affected Repositories
Work Classification
Workspace
Branch Survey
Suggested branch:
feature/interferometer-data-prepWorktree root:
~/Code/PyAutoLabs-wt/interferometer-data-prep/Implementation Steps
scripts/interferometer/start_here.py,data_preparation.py,simulator.pyto match tone, imports (
import autolens as al), and docstring style.scripts/interferometer/casa_reduction.py:(2, n_spw, n_c, n_v, 2)vsal.Interferometershapessplitper field/spwsplit(width=...)uvcontsub) — optionalstatwtfor realistic sigmas(pulled from
z_staging/interferometer_data_prep/main_uvcontsub_SPT0538_CO9-8.py)al.Interferometer/generate_and_mergeafter user review.Key Files
scripts/interferometer/casa_reduction.py— full rewritenotebooks/interferometer/casa_reduction.ipynb— regenerated laterOriginal Prompt
Click to expand starting prompt
In the file @autolens_workspace/scripts/casa_reduction.py, I attempt to give a run
through of how one can prepare data via CASA.
In the file @z_staging/interferometer_data_prep/main_uvcontsub_SPT0538_CO9-8.py, I
have example reduction scripts from a an autolens user.
Can you do a bit of deep research on CASA and interferometer data reduction in
general, read a few interferometer workspace scripts for context and attempt to
produce some sort of useable and help data reduciton script for interferometer
users? It doesnt need to be perfect, I will back and forth it with interferometer
people on the autolens SLACK.