HERA-Team / hera_cal

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

Minor speed-up and memory savings to predict_chisq_per_bl #833

Closed tyler-a-cox closed 2 years ago

tyler-a-cox commented 2 years ago

Very short PR that reduces the memory usage and increases the performance of predict_chisq_per_bl by only computing the main diagonal of the ls_amp and ls_phs projection matrices. Prior to this PR, the function computed the entire matrix when only the diagonal is needed, leading to nbls x nbls matrices being formed. Improvement is negligible for a few antennas, but becomes more useful for many antennas.

Screen Shot 2022-09-22 at 5 05 16 PM Screen Shot 2022-09-22 at 5 05 27 PM
codecov[bot] commented 2 years ago

Codecov Report

Base: 97.15% // Head: 97.29% // Increases project coverage by +0.14% :tada:

Coverage data is based on head (70fc833) compared to base (7c8b84e). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #833 +/- ## ========================================== + Coverage 97.15% 97.29% +0.14% ========================================== Files 18 16 -2 Lines 8475 8067 -408 ========================================== - Hits 8234 7849 -385 + Misses 241 218 -23 ``` | [Impacted Files](https://codecov.io/gh/HERA-Team/hera_cal/pull/833?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team) | Coverage Δ | | |---|---|---| | [hera\_cal/redcal.py](https://codecov.io/gh/HERA-Team/hera_cal/pull/833/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team#diff-aGVyYV9jYWwvcmVkY2FsLnB5) | `99.31% <100.00%> (ø)` | | | [hera\_cal/apply\_cal.py](https://codecov.io/gh/HERA-Team/hera_cal/pull/833/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team#diff-aGVyYV9jYWwvYXBwbHlfY2FsLnB5) | | | | [hera\_cal/\_\_init\_\_.py](https://codecov.io/gh/HERA-Team/hera_cal/pull/833/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team#diff-aGVyYV9jYWwvX19pbml0X18ucHk=) | | | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.