-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstills_from_pickles.py
executable file
·60 lines (42 loc) · 2.09 KB
/
stills_from_pickles.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import pickle
import numpy as np
import os.path
from copy import deepcopy
from plot import create_animated_output, create_stills_array
# save_directory = 'results/**_asymmetric_cut/remove_35L_24R/'
save_directory = 'results/testing/'
# save_directory = 'results/symmetric_large_cut/36_remaining/'
number_of_cells = 100
########################################################################################
""" Load pickled variables """
pickle_directory = save_directory + 'vars/'
t = pickle.load( open(pickle_directory + 't.p','rb') )
a = pickle.load( open(pickle_directory + 'a.p','rb') )
b = pickle.load( open(pickle_directory + 'b.p','rb') )
c = pickle.load( open(pickle_directory + 'c.p','rb') )
v = pickle.load( open(pickle_directory + 'v.p','rb') )
########################################################################################
""" Load params """
code_directory = save_directory + 'code/'
import sys
sys.path.insert(1, code_directory)
from params import params
########################################################################################
""" Create animated output """
stills_directory = save_directory + 'stills/'
if not os.path.isdir(stills_directory):
os.mkdir(stills_directory)
t = np.around(t, 2)
# stills_timepoints = [-1.2, -0.6, 0, 0.02, 1, 2.28, 3.04, 3.8, 5.1, 8.8]
stills_early_timepoints = [-1.2, -0.6, 0, 0.02, 1]
stills_late_timepoints = [2.28, 3.04, 3.8, 5.1, 8.8]
# stills_late_timepoints = [2.28, 3.04, 3.8, 4.3, 5.1]
stills_early_indices = deepcopy(stills_early_timepoints)
stills_late_indices = deepcopy(stills_late_timepoints)
for idx, val in enumerate(stills_early_timepoints):
stills_early_indices[idx] = list(t).index(val)
for idx, val in enumerate(stills_late_timepoints):
stills_late_indices[idx] = list(t).index(val)
create_stills_array(stills_early_indices, number_of_cells, t, a, b, v, c, params, stills_directory + 'early_timepoints.png')
create_stills_array(stills_late_indices, number_of_cells, t, a, b, v, c, params, stills_directory + 'late_timepoints.png')
# create_animated_output(number_of_cells, 1, t, a, b, v, c, stills_directory + )