HERA-Team / hera_cal

Library for HERA data reduction, including redundant calibration, absolute calibration, and LST-binning.
MIT License
13 stars 8 forks source link

Add additional fast sky-based calibration to `abscal` module #892

Open tyler-a-cox opened 1 year ago

tyler-a-cox commented 1 year ago

This PR adds a new sky-based calibration function to the abscal module. There are currently functions for performing traditional sky-based calibration (amp_logcal and phs_logcal), but both are quite slow as they involve matrix inversions. This new function, sky_calibration, implements the StEfCal algorithm (Salvini et al 2014) which scales as nants^2. Below is a time comparison between the existing abscal functions and the new method

Screenshot 2023-04-30 at 3 04 39 PM

And here is a comparison of the residuals of the two methods, showing nearly identical results for the two approaches

Screenshot 2023-04-29 at 8 06 22 PM

I also tested on H6C data using redundantly-calibrated, redundantly-averaged data as the sky model and found that the redundantly-calibrated data and sky-calibrated data agree quite well. Below are the delay-transformed redundantly calibration and sky-calibrated visibilities for a single baseline type.

Screenshot 2023-11-03 at 9 11 31 PM
codecov[bot] commented 1 year ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (b045b6e) 97.16% compared to head (5241467) 97.18%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #892 +/- ## ========================================== + Coverage 97.16% 97.18% +0.02% ========================================== Files 23 23 Lines 10638 10722 +84 ========================================== + Hits 10336 10420 +84 Misses 302 302 ``` | [Flag](https://app.codecov.io/gh/HERA-Team/hera_cal/pull/892/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/HERA-Team/hera_cal/pull/892/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team) | `97.18% <100.00%> (+0.02%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.