Skip to content

CalibratorMSGenerator.generate_from_transit() ignores transit_time for HDF5 group selection #72

@jakobtfaber

Description

@jakobtfaber

Problem

dsa110_continuum/conversion/calibrator_ms_generator.py:456-549 accepts (calibrator_name, transit_time, window_minutes, ...) but selects the HDF5 group(s) to convert via select_groups_by_position(ra, dec, beam_radius_deg, n_groups) (line 496) — purely positional. The transit_time argument is stored in transit_info for logging (.iso, .mjd) but does not constrain group selection.

For DSA-110 drift-scan, position-based selection happens to coincide with meridian transit at the date the generator is scoped to. So the function works if and only if the generator's date scope is correct — which is implicit.

Risk

If the generator's date scope is mis-set (or undefined), generate_from_transit("3C138", Time("2026-01-25T04:57:50")) could silently return an MS from a different date that also has 3C138 near the meridian (any date — drift-scan revisits the same RA every day). The caller has no way to enforce "I want the transit on this specific date."

Discovered while

Codex read-only review of the 3C138 fundamentals-mosaic plan on 2026-05-05.

Acceptance

  • Either: pass transit_time through to select_groups_by_position (or a time-windowed selector) so the function returns a group covering the requested timestamp, not just the closest-by-RA across all indexed groups.
  • Or: rename the signature so that transit_time is documented as a "metadata-only" tag and the function's actual behavior is "pick whatever group is closest to the calibrator on the date this generator is scoped to," with the date scope made explicit in the API.
  • Add a unit test covering: generator scoped to date D1, generate_from_transit(cal, T_in_D1) returns a group from D1 even when the same calibrator transits on D2 in the index.

Out of scope

  • Changing the conversion of the selected group itself.
  • The position-based selection algorithm.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageA maintainer needs to evaluate the issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions