@@ -33,28 +33,8 @@ def paintgen( meandark,meanbright,frames,time,photonrate,photonratestd,photonbud
3333 meanlocs = meanlocs * 10
3434
3535 #Generate a pool of dark and brighttimes
36- dark_times_pool = _np .random .exponential (meandark , meanlocs )
37- bright_times_pool = _np .random .exponential (meanbright , meanlocs )
38-
39- darksum = _np .cumsum (dark_times_pool )
40- maxlocdark = _np .argmax (darksum > (frames * time ))+ 1
41-
42- #Simulate binding and unbinding and consider blocked binding sites
43- dark_times = _np .zeros (maxlocdark )
44- bright_times = _np .zeros (maxlocdark )
45-
46- dark_times [0 ] = dark_times_pool [0 ]
47- bright_times [0 ] = bright_times_pool [0 ]
48-
49- for i in range (1 ,maxlocdark ):
50- bright_times [i ] = bright_times_pool [i ]
51-
52- dark_time_temp = dark_times_pool [i ]- bright_times_pool [i ]
53- while dark_time_temp < 0 :
54- _np .delete (dark_times_pool ,i )
55- dark_time_temp += dark_times_pool [i ]
56-
57- dark_times [i ] = dark_time_temp
36+ dark_times = _np .random .exponential (meandark , meanlocs )
37+ bright_times = _np .random .exponential (meanbright , meanlocs )
5838
5939 events = _np .vstack ((dark_times ,bright_times )).reshape ((- 1 ,),order = 'F' ) # Interweave dark_times and bright_times [dt,bt,dt,bt..]
6040 simulatedmeandark = _np .mean (events [::2 ])
0 commit comments