Commit bd709c70 authored by Médéric Boquien's avatar Médéric Boquien

The wavelength arrays are sorted. So there is no need to call min() and max()...

The wavelength arrays are sorted. So there is no need to call min() and max() to find the extrema. We can directly get the first and last elements.
parent f384e58d
......@@ -317,15 +317,15 @@ class SED(object):
"""
# Filter limits
lambda_min = np.min(transmission[0])
lambda_max = np.max(transmission[0])
lambda_min = transmission[0][0]
lambda_max = transmission[0][-1]
wavelength = self.wavelength_grid
l_lambda = self.luminosity
# Test if the spectrum cover all the filter extend
if ((np.min(wavelength) > lambda_min) or
(np.max(wavelength) < lambda_max)):
if ((wavelength[0] > lambda_min) or
(wavelength[-1] < lambda_max)):
f_nu = -99.
else:
......
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