Skip to content

Commit

Permalink
use nearest not linear interpolation to prevent nan in extrapolated p…
Browse files Browse the repository at this point in the history
…roperties
  • Loading branch information
moustakas committed Jan 12, 2022
1 parent 0aaba73 commit 36b3742
Show file tree
Hide file tree
Showing 2 changed files with 258 additions and 258 deletions.
6 changes: 3 additions & 3 deletions py/desisim/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -1506,10 +1506,10 @@ def make_star_templates(self, nmodel=100, vrad_meansig=(0.0, 200.0),
else:
from scipy.interpolate import griddata
baseflux = griddata(base_properties, self.baseflux,
input_properties, method='linear')
input_properties, method='nearest')
interptemplateid = griddata(base_properties, np.arange(nbase),
input_properties, method='linear')
interptemplateid = np.array([int(tempid) for tempid in interptemplateid])
input_properties, method='nearest')
#interptemplateid = np.array([int(tempid) for tempid in interptemplateid])

# Build each spectrum in turn.
if restframe:
Expand Down

0 comments on commit 36b3742

Please sign in to comment.