Skip to content

Commit da2c491

Browse files
changed paint generator mode, allowing bigger kons
1 parent 043dfd9 commit da2c491

File tree

2 files changed

+3
-23
lines changed

2 files changed

+3
-23
lines changed

picasso/gui/simulate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def initUI(self):
156156
taub = QtGui.QLabel('Bright time')
157157

158158
self.konEdit = QtGui.QDoubleSpinBox()
159-
self.konEdit.setRange(1, 10000000)
159+
self.konEdit.setRange(1, 10000000000)
160160
self.konEdit.setDecimals(0)
161161
self.konEdit.setSingleStep(100000)
162162
self.imagerconcentrationEdit = QtGui.QDoubleSpinBox()

picasso/simulate.py

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)