Definition at line 1373 of file C2Functions.py. 01373 : 01374 be=_numeric.array(binedges, _numeric_float) 01375 bh=_numeric.array(binheights, _numeric_float) 01376 01377 if drop_zeros or inverse_function: #invese functions cannot have any zero bins or they have vertical sections 01378 01379 nz=_numeric.not_equal(bh, 0) #mask of non-empty bins, or lower edges 01380 if not inverse_function: nz[0]=nz[-1]=1 #always preserve end bins to keep X range, but don't dare do it for inverses 01381 bh=_numeric.compress(nz, bh) 01382 be=_numeric.compress(_numeric.concatenate( (nz, (nz[-1],) ) ), be) 01383 01384 cum=_numeric.concatenate( ( (0,), _numeric.cumsum( (be[1:]-be[:-1])*bh ) )) 01385 01386 if be[1] < be[0]: #fix backwards bins, if needed. 01387 be=be[::-1] 01388 cum=cum[::-1] 01389 cum*=-1 #the dx values were all negative if the bins were backwards, so fix the sums 01390 01391 if normalize: 01392 cum *= (1.0/max(cum[0], cum[-1])) #always normalize on the big end 01393 01394 if inverse_function: 01395 be, cum = cum, be #build it the other way around 01396 01397 InterpolatingFunction.__init__(self, be, cum, **args) 01398 self.y2 *=0 #clear second derivatives... we know nothing about them 01399 class LogLogAccumulatedHistogram(AccumulatedHistogram):
|