Skip to content

Commit

Permalink
Merge pull request #61 from aymgal/fix-phi-moments
Browse files Browse the repository at this point in the history
Fix position angle computed from central moments
  • Loading branch information
aymgal authored Apr 16, 2024
2 parents eb74eb6 + b58f039 commit e379d0f
Showing 1 changed file with 2 additions and 0 deletions.
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

0 comments on commit e379d0f

Please sign in to comment.