Skip to content

Commit

Permalink
Fix initial Gaussian theta for centroid_2dg
Browse files Browse the repository at this point in the history
  • Loading branch information
larrybradley committed Feb 20, 2025
1 parent 2a18439 commit 22dfeac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ New Features
Bug Fixes
^^^^^^^^^

- ``photutils.centroids``

- Fixed an issue with the initial Gaussian theta units in
``centroid_2dg``. [#2013]

API Changes
^^^^^^^^^^^

Expand Down
4 changes: 2 additions & 2 deletions photutils/centroids/gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def centroid_2dg(data, error=None, mask=None):
>>> data = data[40:80, 70:110]
>>> x1, y1 = centroid_2dg(data)
>>> print(np.array((x1, y1)))
[19.98519436 20.0149016 ]
[19.9851944 20.01490157]
.. plot::
Expand Down Expand Up @@ -270,7 +270,7 @@ def centroid_2dg(data, error=None, mask=None):
y_mean=props.ycentroid,
x_stddev=props.semimajor_sigma.value,
y_stddev=props.semiminor_sigma.value,
theta=props.orientation.value)
theta=props.orientation)

# Gaussian2D [x/y]_stddev are bounded to be strictly positive
fitter = TRFLSQFitter()
Expand Down

0 comments on commit 22dfeac

Please sign in to comment.