Skip to content

Commit

Permalink
nan catcher
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhenshaw committed Jun 23, 2022
1 parent 9fea0fb commit 0fd5f5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scousepy/SpectralDecomposer.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ def fit_spectrum_from_parent(self,guesses,guesses_parent,tol,res,fittype='gaussi

# remove any instances of nans
for i in range(int(ncomponents)):
component = guesses[int((i * nparams)) : int((i * nparams) + nparams)]
component = self.guesses[int((i * nparams)) : int((i * nparams) + nparams)]
if np.any(~np.isfinite(np.asarray(component))):
guesses[int((i * nparams)) : int((i * nparams) + nparams)] = 0.0
self.guesses[int((i * nparams)) : int((i * nparams) + nparams)] = 0.0

# remove any instances of negative intensity
for i in range(int(ncomponents)):
Expand Down

0 comments on commit 0fd5f5b

Please sign in to comment.