Update models.py
With correct parenthesis...
@@ -1650,8 +1650,8 @@ class SpectralGaussian(SpectralModel):
# kwargs are passed to this function but not used
# this is to get a consistent API with SpectralModel.integral()
pars = self.parameters
- u_min = (emin - pars["mean"].quantity) / (np.sqrt(2) * pars["sigma"].quantity).to_value('')
- u_max = (emax - pars["mean"].quantity) / (np.sqrt(2) * pars["sigma"].quantity).to_value('')
+ u_min = ((emin - pars["mean"].quantity) / (np.sqrt(2) * pars["sigma"].quantity)).to_value('')
+ u_max = ((emax - pars["mean"].quantity) / (np.sqrt(2) * pars["sigma"].quantity)).to_value('')
return pars["norm"].quantity / (2) * (erf(u_max) - erf(u_min))
@@ -1672,8 +1672,8 @@ class SpectralGaussian(SpectralModel):
from scipy.special import erf
pars = self.parameters
- u_min = (emin - pars["mean"].quantity) / (np.sqrt(2) * pars["sigma"].quantity).to_value('')
- u_max = (emax - pars["mean"].quantity) / (np.sqrt(2) * pars["sigma"].quantity).to_value('')
+ u_min = ((emin - pars["mean"].quantity) / (np.sqrt(2) * pars["sigma"].quantity)).to_value('')
+ u_max = ((emax - pars["mean"].quantity) / (np.sqrt(2) * pars["sigma"].quantity)).to_value('')
a = pars["norm"].quantity * pars["sigma"].quantity / np.sqrt(2 * np.pi)
b = pars["norm"].quantity * pars["mean"].quantity / 2
return a * (np.exp(-u_min ** 2) - np.exp(-u_max ** 2)) + b * (erf(u_max) - erf(u_min))
