[LSST|dm-users 585] Re: pipe_tasks 10.0+1 build error

Russell Owen rowen at uw.edu
Sat Feb 14 10:59:43 PST 2015


On Feb 13, 2015, at 6:40 PM, Robert Lupton the Good <rhl at astro.princeton.edu> wrote:

> Is there some other problem with this test, giving different results under different circumstances (https://jira.lsstcorp.org/browse/DM-1984).  Or did we demonstrate that those circumstances were numpy version?
> 
> Anyway, I don't think that we should be using numpy.mean() on large arrays.  It's not guaranteed to be smart, and switching to 64-bit floats rather than fixing the algorithm is among the refuges of the scoundrel.
> 
> In this case you should either:
> 	subtract of the approximate mean and iterate, using np.mean()
> or
> 	use afwMath.makeStatistics(im,  afwMath.MEAN).getValue() that /is/ guaranteed to be smart, and if it isn't we can fix it.
> I appreciate the mean

We believe it is purely a bug in an older version of numpy and our workaround maintains compatibility with older versions of numpy. I’m sorry you aren’t happy with the workaround. I would prefer that our unit tests focus on using simple numpy routines when reasonable. I suppose we could subtract the median before taking the mean. Keep in mind that the background image in question is virtually flat, so this is not a stress test of statistics.

— Russell


More information about the dm-users mailing list