Skip to content

Commit

Permalink
check for the template dimension
Browse files Browse the repository at this point in the history
  • Loading branch information
moustakas committed Jan 2, 2024
1 parent 431d582 commit 5b18774
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion py/redrock/zfind.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,11 @@ def zfind(targets, templates, mp_procs=1, nminima=3, archetypes=None, priors=Non
allzfit.replace_column('spectype',allzfit['spectype'].astype('<U6'))

maxcoeff = np.max([t.template.nbasis for t in templates])
ntarg, ncoeff = allzfit['coeff'].shape
if allzfit['coeff'].ndim == 1:
ntarg = 1
ncoeff = allzfit['coeff'].shape
else:
ntarg, ncoeff = allzfit['coeff'].shape
if ncoeff != maxcoeff:
coeff = np.zeros((ntarg, maxcoeff), dtype=allzfit['coeff'].dtype)
coeff[:,0:ncoeff] = allzfit['coeff']
Expand Down

0 comments on commit 5b18774

Please sign in to comment.