Skip to content

Commit

Permalink
changed paint generator mode, allowing bigger kons
Browse files Browse the repository at this point in the history
  • Loading branch information
straussmaximilian committed Dec 19, 2016
1 parent 043dfd9 commit da2c491
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 23 deletions.
2 changes: 1 addition & 1 deletion picasso/gui/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def initUI(self):
taub = QtGui.QLabel('Bright time')

self.konEdit = QtGui.QDoubleSpinBox()
self.konEdit.setRange(1, 10000000)
self.konEdit.setRange(1, 10000000000)
self.konEdit.setDecimals(0)
self.konEdit.setSingleStep(100000)
self.imagerconcentrationEdit = QtGui.QDoubleSpinBox()
Expand Down
24 changes: 2 additions & 22 deletions picasso/simulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,8 @@ def paintgen( meandark,meanbright,frames,time,photonrate,photonratestd,photonbud
meanlocs = meanlocs*10

#Generate a pool of dark and brighttimes
dark_times_pool = _np.random.exponential(meandark, meanlocs)
bright_times_pool = _np.random.exponential(meanbright, meanlocs)

darksum = _np.cumsum(dark_times_pool)
maxlocdark = _np.argmax(darksum>(frames*time))+1

#Simulate binding and unbinding and consider blocked binding sites
dark_times = _np.zeros(maxlocdark)
bright_times = _np.zeros(maxlocdark)

dark_times[0] = dark_times_pool[0]
bright_times[0] = bright_times_pool[0]

for i in range(1,maxlocdark):
bright_times[i] = bright_times_pool[i]

dark_time_temp = dark_times_pool[i]-bright_times_pool[i]
while dark_time_temp < 0:
_np.delete(dark_times_pool,i)
dark_time_temp +=dark_times_pool[i]

dark_times[i] = dark_time_temp
dark_times = _np.random.exponential(meandark, meanlocs)
bright_times = _np.random.exponential(meanbright, meanlocs)

events = _np.vstack((dark_times,bright_times)).reshape((-1,),order='F') # Interweave dark_times and bright_times [dt,bt,dt,bt..]
simulatedmeandark = _np.mean(events[::2])
Expand Down

0 comments on commit da2c491

Please sign in to comment.