-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_birth_times.py~
40 lines (31 loc) · 1.03 KB
/
plot_birth_times.py~
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from pyRBC import rbc_histogram as rh
from matplotlib import pyplot as plt
import numpy as np
"""
This module is just for convenience. For manipulating plots (labels,
legends, etc) without having to tweak the original code in
rbc_histogram.py.
"""
def plot_hist( new, old ):
"""
new : list of lists holding normalized birth times for generators.
old : (same)
"""
out = rh.plot_hist_birth_times( new, old )
fig = out[0]
ax = fig.gca()
ax.set_xlabel( "First birth times (normalized) of midrange generators" )
plt.show()
def concat_birth_times( bt, thresh, num_bts=1 ):
cells = bt[ thresh ] # all midrange gens, (birth, death) for each cell
cvals = cells.values() # just grab all values, so 11 or 13 lists of 5000 lists
birth_times = {}
# extract all i'th generators
for i in range( num_bts ):
bt_n = []
for cell in cells:
for frame in cell:
bt_n.append( frame
bith_times[i] = [
# ca = np.vstack( avals )
# return ca