threeML.utils.histogram module
- class threeML.utils.histogram.Histogram(list_of_intervals, contents=None, errors=None, sys_errors=None, is_poisson=False)[source]
-
Bases:
IntervalSet
- bin_entries(entires)[source]
-
add the entries into the proper bin
- Parameters:
-
entires – list of events
- Returns:
- property contents
- property errors
- classmethod from_entries(list_of_intervals, entries)[source]
-
create a histogram from a list of intervals and entries to bin
- Parameters:
-
list_of_intervals
entries
- Returns:
- classmethod from_numpy_histogram(hist, errors=None, sys_errors=None, is_poisson=False, **kwargs)[source]
-
create a Histogram from a numpy histogram. .. rubric:: Example
r = np.random.randn(1000) np_hist = np.histogram(r) hist = Histogram.from_numpy_histogram(np_hist)
- Parameters:
-
hist – a np.histogram tuple
errors – list of errors for each bin in the numpy histogram
sys_errors – list of systematic errors for each bin in the numpy histogram
is_poisson – if the data is Poisson distributed or not
kwargs – any kwargs to pass along
- Returns:
-
a Histogram object
- property is_poisson
- property sys_errors
- property total
- property total_error