Package pylal :: Module moving_histogram :: Class MovingHistogramFixedN
[hide private]
[frames] | no frames]

Class MovingHistogramFixedN

source code

object --+
         |
        MovingHistogramFixedN

This class is a histogram with a bounded size such that as new elements come in, old elements are removed in chronological order. The timestamp is retained only so that some rough idea of live time is retained and so that we can enforce monotonicity.

Instance Methods [hide private]
 
__init__(self, bins, max_len)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
__len__(self)
Return the current number of elements in the histogram.
source code
 
_flush_oldest(self)
Remove the oldest element from the histogram.
source code
 
update(self, timestamp, stat)
Push the stat's bin onto the queue and update the histogram.
source code
 
get_sf(self, stat)
Return the fraction of events with stats than stat.
source code
 
get_pdf(self, stat)
Return the PDF at stat.
source code
 
get_cdf(self, stat)
Return the CDF of the stat.
source code
 
get_oldest_timestamp(self) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, bins, max_len)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

get_sf(self, stat)

source code 

Return the fraction of events with stats than stat. This is formally the survival function (sf), which is 1 - CDF(stat).

get_cdf(self, stat)

source code 

Return the CDF of the stat. (To get the "CDF from the right", see get_sf().)