Pull request #1876: PIPE-3088 speedup ms zenith compute
Merge in PIPE/pipeline from PIPE-3088-speedup-ms-zenith-compute to main
* commit 'e65f1dbba5eea0d2a8b5f6c20a45e12d046cb186': PIPE-3088: relax test tolerance for zenith distance regression test PIPE-3088: remove redundant me.doframe(obs_pos) from inner loop PIPE-3088: add approx regression test for compute_zd_telmjd_for_ms PIPE-3088: speed up compute_zd_telmjd_for_ms by 1.8x PIPE-3088: speed up compute_zd_telmjd_for_ms while preserving exact output PIPE-3088: add regression test for compute_zd_telmjd_for_ms
PIPE-3088: remove redundant me.doframe(obs_pos) from inner loop
The observatory position frame is already set once before all loops.
Calls to me.doframe() for the epoch type do not affect the
observatory frame, so re-doing doframe(obs_pos) on every timestamp
is unnecessary.
Timing (compute_zd_telmjd_for_ms, 50 runs, 74 timestamps):
before (d851488da): 12.629 ms per call
after (this commit): 9.204 ms per call
speedup: 1.37x (27% reduction)
Cumulative vs main (22.901 ms): 2.49x speedup
Exact output preserved (verified by test_telmjd_exact).
PIPE-3088: add approx regression test for compute_zd_telmjd_for_ms
Also we remove the exact ZD test, which no longer passes, and replace it by the
approx test with rel=1e-10.
PIPE-3088: speed up compute_zd_telmjd_for_ms by 1.8x
Optimizations:
- Pre-compute observatory position once instead of per iteration
- Mutate reusable epoch dict in-place instead of me.epoch() + datetime.isoformat()
- Eliminate casa_tools.quanta.quantity() and quanta.convert() calls
- Inline compute_zenith_distance to avoid function call overhead
Measured: 22.50 ms -> 12.61 ms on 74 timestamps (1 field TARGET)
Note: this commit does not pass the exact test, which is fixed in the next commit.