Skip to content

Fix weighted sum of squares for the position angle in psfvary.py - #399

Open
AlexKurek wants to merge 1 commit into
lofar-astron:masterfrom
AlexKurek:Fix-weighted-sum-of-squares-for-the-position-angle-in-psfvary
Open

Fix weighted sum of squares for the position angle in psfvary.py#399
AlexKurek wants to merge 1 commit into
lofar-astron:masterfrom
AlexKurek:Fix-weighted-sum-of-squares-for-the-position-angle-in-psfvary

Conversation

@AlexKurek

@AlexKurek AlexKurek commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Bug
When calculating the weighted sum of squares for the position angle (stdpa), the bpa term was left linear instead of being squared. Because position angles wrap every 180 deg., the code applies a squared correction polynomial for angles $\ge 90^\circ$. Mixing a linear term with squared correction terms results in an invalid variance calculation.

$\sum \left( xw + (180^2 - 360x)w\delta \right)$

Fix
Added the missing square to correctly calculate the weighted sum of squares.

$\sum \left( x^2w + (180^2 - 360x)w\delta \right)$

@gmloose
gmloose requested a review from darafferty August 20, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant