Separating the pipeline from sky to map
What the two agents built, what the comparison established, and what is still needed for a stronger scientific pipeline.
11-slide technical briefingBased on objective.txt, whatAgent1did.txt, and whatAgent2did.txt.
Turn one fragile demonstration into two reusable stages
The starting point was a monolithic QUBIC example: simulate a sky, generate detector timelines, and reconstruct a map in one notebook.
The supplied notebooks mixed three concerns
Sky generation
Build a dictionary and simulate a CMB sky at the selected frequency and resolution.
Instrument response
Construct pointing and acquisition operators, then produce a TOD for every detector.
Map making
Apply the acquisition operator and solve the inverse problem with coverage and PCG.
The original notebook was written against an older flat qubic API and failed at import time in the installed environment.
Agent 1 established the first workable separation
API migration
Created a corrected monolithic notebook using the refactored qubic.lib modules and a demo-scale configuration.
Stage boundary
Kept the split at the dictionary, TOD, convolved maps and map center, so stage 2 can reload simulation products.
Real-data path
Added a TOD-to-map example and a command-line script for a QUBIC galactic-plane dataset.
First diagnosis
Compared monolithic and split maps, saved residual figures, and documented telemetry assumptions.
The first version showed that the architecture worked, but exposed uncertainty
| Finding | Meaning for the pipeline |
|---|---|
| Monolithic and split maps were very close | The proposed stage boundary did not change the simulated result at demo resolution. |
| Original FI150 settings were unavailable as written | Software API and calibration-file assumptions had to be separated from the algorithmic comparison. |
| Real data required sparse housekeeping interpolation | Stage 2 needs explicit time axes, detector ordering and telemetry handling. |
| Initial real solve was not converged | A visually plausible scan footprint is not evidence of a valid sky reconstruction. |
Agent 2 made the comparison controlled and reproducible
Fair simulation pairs
Regenerated the same sky and TOD, saved explicit pointing, and compared matched FI220, FI150 and TD150 runs.
Correct noise control
Used the acquisition noise seed where QUBIC resets the random generator, instead of seeding NumPy beforehand.
Real-data corrections
Converted qubicpack current values from microamps to amperes locally before forming electrical power; installed packages stayed untouched.
Robust stage 2
Added detector-order checks, support clipping, azimuth unwrapping, block averaging, offset projection and true normal-equation residual checks.
The split can reproduce the monolithic map exactly in controlled runs
PCG residual 9.86 × 10⁻⁵
PCG residual 9.76 × 10⁻⁵
PCG residual 9.21 × 10⁻⁵
Within each matched pair, the saved-TOD split and monolithic reconstruction were bit-for-bit equal. This validates the data handoff and execution order, not the completeness of the physical model.
Agent 2 delivered a strong diagnostic pipeline, not a finished science pipeline
- The original full-resolution and original-frequency experiment was not reproduced end to end; comparisons use explicit demo-scale settings.
- The real result is intensity-only, assumes
Q=U=0, and has no measured HWP or pitch telemetry in the selected dataset. - The real-data projected TOD fit residual is about 0.98: numerical PCG convergence does not mean the sky model explains the data.
- Electrical power is still not an optical calibration. Current offsets, detector responsivity, gain, sign, atmosphere and glitches remain unresolved.
- Block averaging and one representative pointing per block are practical reductions, not a precision treatment of native sampling.
- The requested three-round agent exchange and a final paired Agent 1/Agent 2 runner were not completed inside Agent 2’s own turn.
The handoff is useful, but still couples data format, instrument assumptions and solver behavior
dictionary.jsonpointing.npzTOD.npymaps_convolved.npyfrequency and beam files
HWP/pitch conventions
noise model and units
A better interface must carry numerical arrays together with the assumptions that make them meaningful.
A practical roadmap for the next iteration
- Define a versioned stage contract. Store schema version, units, frequency, nside, detector IDs, pointing convention, calibration provenance and hashes beside every array.
- Make stage 2 source-agnostic. Accept simulated TOD, qubicpack TOD and synthetic fixtures through one validated adapter interface.
- Preserve native time resolution where possible. Stream or chunk the pointing operator instead of relying on a large dense in-memory representation.
- Add instrument realism. Integrate HWP and pitch telemetry, detector gains, current offsets, optical calibration, glitches and a colored-noise model.
- Test scientific adequacy separately from solver convergence. Use injected skies, recovered amplitudes, cross-validation and TOD residual structure.
Keep the split, strengthen the contract
Stage 0 · Ingest and calibrate
Read raw files, convert units, identify detectors, align telemetry, flag gaps and write a provenance-rich observation package.
Stage 1 · Forward model
Generate or load a sky, construct the exact pointing and beam model, and write TOD plus a reproducible model manifest.
Stage 2 · Inverse map
Read the manifest, validate compatibility, solve I/Q/U with the appropriate noise and nuisance model, and report convergence.
Stage 3 · Validation
Compare injected truth, split versus monolithic execution, held-out TOD residuals and calibration-aware physical metrics.
The deliverables in Final_pipeline/ are a solid diagnostic baseline. The next scientific milestone is to make every assumption explicit and test whether the reconstructed map explains independent detector data.
Useful references: executed example notebook · real-data CLI · Agent 2 results · original objective