Commit 319016a9 authored by Médéric Boquien's avatar Médéric Boquien
Browse files

Use the base numpy interp() function rather than scipy's interp1d(). The...

Use the base numpy interp() function rather than scipy's interp1d(). The reason is that when interpolation only 1 array the former is much faster (probably because it is compiled and there is no overhead returning a function. We can only do that for the new component. For the old ones, there are too many for this to be worthwhile. Still, it nets a nice improvement.
parent b9c1bd89
...@@ -243,11 +243,9 @@ class SED(object): ...@@ -243,11 +243,9 @@ class SED(object):
# Interpolate the added luminosity array to the new wavelength # Interpolate the added luminosity array to the new wavelength
# grid # grid
interp_lumin = interp1d(results_wavelengths, interp_lumin = np.interp(new_wavelength_grid,
results_lumin, results_wavelengths, results_lumin,
bounds_error=False, left=0., right=0.)
assume_sorted=True,
fill_value=0)(new_wavelength_grid)
self.wavelength_grid = new_wavelength_grid self.wavelength_grid = new_wavelength_grid
self.luminosities = np.vstack((new_luminosities, interp_lumin)) self.luminosities = np.vstack((new_luminosities, interp_lumin))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment