Open jordiferrero opened 1 year ago
Indeed, the function runs through about 6-times faster on a map of mine. For the uniform axis, the results are the same - but when converting to non-uniform axes, the results are not the same as for the old implementation. In particular, for jacobian=False
the centroid in the old implementation is the same in energy and wavelength scale, which makes sense. In the new implementation, they are not the same.
I think the weighted average that you calculate is correct for the equidistant scale, but for non-uniform axes you still would need interpolation if you want to use that formula.
Description of the change
I realised I had overengineered the
com
utils function. I have now simplified it with a huge speed improvement. It does not rely onscipy
interpolation anymore.Progress of the PR