HERA-Team / hera_qm

HERA Data Quality Metrics
MIT License
2 stars 2 forks source link

Minor calc_corr_stats() speedup in ant_metrics #431

Closed jsdillon closed 1 year ago

jsdillon commented 1 year ago

This PR avoids an unnecessary nanmedian speeding up calc_corr_stats() from 11.3s to 9.16s on a pre-loaded file from last night (which is the dominant component of ant_metrics, which takes 13.2 s).

I can't see a way of making calc_corr_stats much faster without vastly increasing the memory footprint by building a giant array of visibilities from many baselines and then doing some clever vectorization of the code. @tyler-a-cox if you have any ideas, I'm all ears.

codecov[bot] commented 1 year ago

Codecov Report

Base: 97.04% // Head: 97.04% // No change to project coverage :thumbsup:

Coverage data is based on head (54694b2) compared to base (466a027). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #431 +/- ## ======================================= Coverage 97.04% 97.04% ======================================= Files 9 9 Lines 3515 3515 ======================================= Hits 3411 3411 Misses 104 104 ``` | [Impacted Files](https://codecov.io/gh/HERA-Team/hera_qm/pull/431?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team) | Coverage Δ | | |---|---|---| | [hera\_qm/ant\_metrics.py](https://codecov.io/gh/HERA-Team/hera_qm/pull/431/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team#diff-aGVyYV9xbS9hbnRfbWV0cmljcy5weQ==) | `98.21% <100.00%> (ø)` | | 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.