def simulate_timestamps_mix_da_online(self, max_rates_d, max_rates_a,<EOL>populations, bg_rate_d, bg_rate_a,<EOL>rs=None, seed=<NUM_LIT:1>, chunksize=<NUM_LIT:2>**<NUM_LIT:16>,<EOL>comp_filter=None, overwrite=False,<EOL>skip_existing=False, scale=<NUM_LIT:10>,<EOL>path=None, t_chunksize=<NUM_LIT:2>**<NUM_LIT>,<EOL>timeslice=None):
self.open_store_timestamp(chunksize=chunksize, path=path)<EOL>rs = self._get_group_randomstate(rs, seed, self.ts_group)<EOL>if t_chunksize is None:<EOL><INDENT>t_chunksize = <NUM_LIT:2>**<NUM_LIT><EOL><DEDENT>timeslice_size = self.n_samples<EOL>if timeslice is not None:<EOL><INDENT>timeslice_size = timeslice // self.t_step<EOL><DEDENT>name_d = self._get_ts_name_mix(max_rates_d, populations, bg_rate_d, rs)<EOL>name_a = self._get_ts_name_mix(max_rates_a, populations, bg_rate_a, rs)<EOL>kw = dict(clk_p=self.t_step / scale,<EOL>populations=populations,<EOL>num_particles=self.num_particles,<EOL>bg_particle=self.num_particles,<EOL>overwrite=overwrite, chunksize=chunksize)<EOL>if comp_filter is not None:<EOL><INDENT>kw.update(comp_filter=comp_filter)<EOL><DEDENT>kw.update(name=name_d, max_rates=max_rates_d, bg_rate=bg_rate_d)<EOL>try:<EOL><INDENT>self._timestamps_d, self._tparticles_d = (self.ts_store<EOL>.add_timestamps(**kw))<EOL><DEDENT>except ExistingArrayError as e:<EOL><INDENT>if skip_existing:<EOL><INDENT>print('<STR_LIT>')<EOL>return<EOL><DEDENT>else:<EOL><INDENT>raise e<EOL><DEDENT><DEDENT>kw.update(name=name_a, max_rates=max_rates_a, bg_rate=bg_rate_a)<EOL>try:<EOL><INDENT>self._timestamps_a, self._tparticles_a = (self.ts_store<EOL>.add_timestamps(**kw))<EOL><DEDENT>except ExistingArrayError as e:<EOL><INDENT>if skip_existing:<EOL><INDENT>print('<STR_LIT>')<EOL>return<EOL><DEDENT>else:<EOL><INDENT>raise e<EOL><DEDENT><DEDENT>self.ts_group._v_attrs['<STR_LIT>'] = rs.get_state()<EOL>self.ts_group.attrs['<STR_LIT>'] = <NUM_LIT:1><EOL>self._timestamps_d.attrs['<STR_LIT>'] = rs.get_state()<EOL>self._timestamps_d.attrs['<STR_LIT>'] = __version__<EOL>self._timestamps_a.attrs['<STR_LIT>'] = __version__<EOL>print('<STR_LIT>' % ctime(), flush=True)<EOL>par_start_pos = self.particles.positions<EOL>bg_rates_d = [None] * (len(max_rates_d) - <NUM_LIT:1>) + [bg_rate_d]<EOL>bg_rates_a = [None] * (len(max_rates_a) - <NUM_LIT:1>) + [bg_rate_a]<EOL>prev_time = <NUM_LIT:0><EOL>for i_start, i_end in iter_chunk_index(timeslice_size, t_chunksize):<EOL><INDENT>curr_time = np.around(i_start * self.t_step, decimals=<NUM_LIT:1>)<EOL>if curr_time > prev_time:<EOL><INDENT>print('<STR_LIT>' % curr_time, end='<STR_LIT>', flush=True)<EOL>prev_time = curr_time<EOL><DEDENT>_, em_chunk = self._sim_trajectories(t_chunksize, par_start_pos,<EOL>rs,<EOL>total_emission=False,<EOL>save_pos=False, radial=False,<EOL>wrap_func=wrap_periodic)<EOL>times_chunk_s_d, par_index_chunk_s_d =self._sim_timestamps_populations(<EOL>em_chunk, max_rates_d, populations, bg_rates_d, i_start,<EOL>rs, scale)<EOL>times_chunk_s_a, par_index_chunk_s_a =self._sim_timestamps_populations(<EOL>em_chunk, max_rates_a, populations, bg_rates_a, i_start,<EOL>rs, scale)<EOL>self._timestamps_d.append(times_chunk_s_d)<EOL>self._tparticles_d.append(par_index_chunk_s_d)<EOL>self._timestamps_a.append(times_chunk_s_a)<EOL>self._tparticles_a.append(par_index_chunk_s_a)<EOL><DEDENT>self.ts_group._v_attrs['<STR_LIT>'] = rs.get_state()<EOL>self._timestamps_d._v_attrs['<STR_LIT>'] = rs.get_state()<EOL>self.ts_store.h5file.flush()<EOL>print('<STR_LIT>' % ctime(), flush=True)<EOL>
Compute D and A timestamps arrays for a mixture of N populations.

        This method simulates the diffusion, emission and generates a pair
        of timestamps arrays (e.g. donor and acceptor) all at the same time.
        This method avoids saving the trajectories to disk.

        Timestamp data are saved to disk and accessible as pytables arrays in
        `._timestamps_d/a` and `._tparticles_d/a`.
        The background generated timestamps are assigned a
        conventional particle number (last particle index + 1).

        Arguments:
            max_rates (list): list of the peak max emission rate for each
                population.
            populations (list of slices): slices to `self.particles`
                defining each population.
            bg_rate (float, cps): rate for a Poisson background process
            rs (RandomState object): random state object used as random number
                generator. If None, use a random state initialized from seed.
            seed (uint): when `rs` is None, `seed` is used to initialize the
                random state, otherwise is ignored.
            chunksize (int): chunk size used for the on-disk timestamp array
            comp_filter (tables.Filter or None): compression filter to use
                for the on-disk `timestamps` and `tparticles` arrays.
                If None use default compression.
            overwrite (bool): if True, overwrite any pre-existing timestamps
                array. If False, never overwrite. The outcome of simulating an
                existing array is controlled by `skip_existing` flag.
            skip_existing (bool): if True, skip simulation if the same
                timestamps array is already present.
            scale (int): `self.t_step` is multiplied by `scale` to obtain the
                timestamps units in seconds.
            path (string): folder where to save the data.
            timeslice (float or None): timestamps are simulated until
                `timeslice` seconds. If None, simulate until `self.t_max`.