GalSim-developers/GalSim — pull request #565 by jmeyers314 (2014-06-11 02:48:21+00:00)
Title: #564

Added a `.centroid()` method to ChromaticObject, which works pretty much the same as `GSObject.centroid()`, but requires a `Bandpass` object against which to integrate.

The only open question I have is what's the right way to integrate the product of a `Bandpass` and (effectively) an `SED`, when exactly one of these maintains a `wave_list` with specific wavelengths at which the integrand should be evaluated and the other doesn't. Here I chose the more efficient approach, though possibly less conservative, that if even one multiplier defines a `wave_list`, then integration is done via numpy.trapz instead of integ.int1d. In contrast, note that `SED.calculateFlux()` implements the logic: numpy.trapz if `Bandpass.wave_list` is not empty, integ.int1d otherwise, which seems a little strange to me now.