Skip to content

Wiregrid: Fix ellipse fit - #1763

Open
ykyohei wants to merge 4 commits into
masterfrom
wg_efit
Open

ykyohei wants to merge 4 commits into
masterfrom
wg_efit

Conversation

@ykyohei

@ykyohei ykyohei commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

The ellipse fit of wiregrid had several issues and has not been used for site-pipeline. This PR fixes issues to use this for next version of wiregrid_stats metadata.

  1. The bound was too tight, especially (-2b0, 2b0) was wrong bound for the center of ellipse.
  2. Some observations had smaller number of wg steps thant the number of parameters.
  3. Calculation of covariance (cov = np.linalg.inv(J.T @ J)) fails with np.linalg.LinAlgError when data is weird.
    This part is now inside try-exception block and failure for single detector doesn't cause entire observation to fail.

Also ea and eb were not necessarily major axis and minor axis. Added a step to make ensure ea >= eb and etheta is the angle of major axis.

This doesn't change the behavior of circle_fit and allows us to run ellipse fit.

@ykyohei
ykyohei requested a review from YutaroKASAI October 2, 2026 23:07
@ykyohei ykyohei changed the title Fix wg elliptic fit Wiregrid: Fix ellipse fit Oct 2, 2026
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