Skip to content

Commit

Permalink
deepcopy within apply_subset_masks
Browse files Browse the repository at this point in the history
otherwise subsets will just be applied on top of each other instead of the original non-masked spectrum
  • Loading branch information
kecnry committed Dec 28, 2022
1 parent c706da0 commit 141b62a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jdaviz/configs/default/plugins/model_fitting/model_fitting.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import re
import numpy as np
from copy import deepcopy

import astropy.units as u
from specutils import Spectrum1D
Expand Down Expand Up @@ -794,6 +795,7 @@ def _apply_subset_masks(self, spectrum, subset_component):
if subset_component.selected == subset_component.default_text:
return spectrum

spectrum = deepcopy(spectrum)
subset_mask = subset_component.selected_subset_mask

if spectrum.mask is not None:
Expand Down

0 comments on commit 141b62a

Please sign in to comment.