Skip to content

Commit

Permalink
Only reshape here in 3D case
Browse files Browse the repository at this point in the history
  • Loading branch information
rosteen committed Sep 16, 2024
1 parent 2601799 commit 4c824f6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions jdaviz/configs/default/plugins/model_fitting/model_fitting.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,9 +516,11 @@ def _initialize_model_component(self, model_comp, comp_label, poly_order=None):
spectral_mask = mask
init_x = masked_spectrum.spectral_axis[~spectral_mask]
orig_flux_shape = masked_spectrum.flux.shape
init_y = masked_spectrum.flux[~mask].reshape(orig_flux_shape[0],
orig_flux_shape[1],
len(init_x))
init_y = masked_spectrum.flux[~mask]
if mask.ndim == 3:
init_y = init_y.reshape(orig_flux_shape[0],
orig_flux_shape[1],
len(init_x))
else:
init_x = masked_spectrum.spectral_axis
init_y = masked_spectrum.flux
Expand Down

0 comments on commit 4c824f6

Please sign in to comment.