Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix position angle computed from central moments #61

Merged
merged 2 commits into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions coolest/api/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ def ellipticity_from_moments(light_map, pixel_size):
lambda_2 = (mu_20_ + mu_02_) / 2. - np.sqrt(4*mu_11_**2 + (mu_20_ - mu_02_)**2) / 2.
q = np.sqrt(lambda_2 / lambda_1) # b/a, axis ratio
phi = np.arctan(2. * mu_11_ / (mu_20_ - mu_02_)) / 2. # position angle
if mu_02_ > mu_20_:
phi += np.pi / 2. # makes it consistent angles conventions in COOLEST
return phi, q


Expand Down
Loading