Skip to content

Commit

Permalink
Collapse 3D y before calculating initial model guess for gaussian model
Browse files Browse the repository at this point in the history
  • Loading branch information
rosteen committed Nov 15, 2024
1 parent f715ffe commit ffd2de0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jdaviz/configs/default/plugins/model_fitting/initializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,10 @@ def initialize(self, instance, x, y):
The initialized model.
"""

if y.ndim == 3:
# For cube fitting, need to collapse before these calculations
y = np.nanmean(y, axis=(0, 1))

# X centroid estimates the position
centroid = np.sum(x * y) / np.sum(y)

Expand Down

0 comments on commit ffd2de0

Please sign in to comment.