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

Update logic for identifying phase flips #899

Closed jsdillon closed 1 year ago

jsdillon commented 1 year ago

In analyzing a day outside H6C IDR2 (specifically 2459906), I found that phase shifts in the calibration solution due to bright sources (e.g. the galactic anticenter) could trigger the detection of phase flipping:

image

This is not the intended behavior, so I changed the logic to identify phase flips based on changes of 90 degrees in the phase from one integration to the next. I have verified on 2459866 and 2459870 that the same integrations are being identified as phase flipped with the new logic as with the old.

The new method is very, very slightly slower, but not in a way that increases the runtime of smooth_cal by more than a few seconds compared to the ~30 min runtime of the smooth_cal notebook (which is I/O dominated anyway).

Doing this enabled a more natural way to handle completely flagged integrations, which is to give them have the same flipped-status as the most-recent non-flagged integration. So I've made that change, which required editing a unit test, but should have few practical implications.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (5d4337d) 97.21% compared to head (f842f63) 97.21%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #899 +/- ## ======================================= Coverage 97.21% 97.21% ======================================= Files 21 21 Lines 9445 9454 +9 ======================================= + Hits 9182 9191 +9 Misses 263 263 ``` | [Impacted Files](https://app.codecov.io/gh/HERA-Team/hera_cal/pull/899?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team) | Coverage Δ | | |---|---|---| | [hera\_cal/smooth\_cal.py](https://app.codecov.io/gh/HERA-Team/hera_cal/pull/899?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=HERA-Team#diff-aGVyYV9jYWwvc21vb3RoX2NhbC5weQ==) | `96.98% <100.00%> (+0.05%)` | :arrow_up: |

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