Fix BCAL normalization of first block#286
Open
bhawkins wants to merge 2 commits into
Open
Conversation
rad-eng-59
approved these changes
Jun 8, 2026
rad-eng-59
left a comment
Contributor
There was a problem hiding this comment.
LGTM, Thanks.
FYI, the first 200 ms (~ 500 pulses) of the first observation of a datatake have bad HCAL values which causes similar issue or even worse if not excluded from processing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In the elevation antenna pattern code, the transmit path is characterized by the ratio of high-power amplifier calibration loop (HCAL) and bypass calibration loop (BCAL) measurements (normalized by the BCAL of the first channel). The HCAL and BCAL measurements are interleaved in time, so some logic is needed to associate the correct pairs of HCAL and BCAL measurements.
The existing code assumes that the first pulse is a BCAL measurement, which is typically true for the first observation in a data take. However, subsequent observations may not start with a BCAL. In those cases, a block of HCAL weights does not get properly normalized and the resulting antenna pattern is wrong. This PR handles the case by using the first BCAL to normalized the first set of HCAL pulses, even if that BCAL happens later in time.