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

Use a multiplication rather than a division to convert luminosities into...

Use a multiplication rather than a division to convert luminosities into fluxes. This should yield a small speedup.
parent e10cad39
......@@ -9,6 +9,7 @@
### Optimised
- A significant fraction of the total run time is spent computing integrals (e.g. fluxes in passbands). We can make the integration faster by rewriting the trapezoidal rule in terms of np.dot(). This allows to offload the computation to optimised libraries. The end result is that the integration is twice as fast, with a gain of ~10-15% on the total run time. (Médéric Boquien)
- The conversion from luminosity to flux is now a bit faster. (Médéric Boquien)
## 0.9.0 (2016-04-04)
### Added
......
......@@ -65,9 +65,7 @@ def luminosity_to_flux(luminosity, dist):
"""
flux = luminosity / (4. * pi * dist * dist)
return flux
return luminosity * (1. / (4. * pi * dist * dist))
def lambda_flambda_to_fnu(wavelength, flambda):
......
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