@@ -712,7 +712,7 @@ def _sim_timestamps(self, max_rate, bg_rate, emission, i_start, rs,
712712 times_chunk_p = []
713713 par_index_chunk_p = []
714714 for ip , counts_chunk_ip in enumerate (counts_chunk ):
715- # Compute timestamps for particle ip for all bins with counts
715+ # Compute timestamps for particle ip for all bins with counts > 0
716716 times_c_ip = []
717717 for v in range (1 , max_counts + 1 ):
718718 times_c_ip .append (ts_range [counts_chunk_ip >= v ])
@@ -742,6 +742,7 @@ def _sim_timestamps_populations(self, emission, max_rates, populations,
742742
743743 # Loop for each population
744744 ts_chunk_pop_list , par_index_chunk_pop_list = [], []
745+ # Loop through populations
745746 for rate , pop , bg in zip (max_rates , populations , bg_rates ):
746747 emission_pop = emission [pop ]
747748 ts_chunk_pop , par_index_chunk_pop = \
@@ -808,11 +809,13 @@ def simulate_timestamps_mix(self, max_rates, populations, bg_rate,
808809 timeslice_size = timeslice // self .t_step
809810
810811 name = self ._get_ts_name_mix (max_rates , populations , bg_rate , rs = rs )
811- kw = dict (name = name , clk_p = self .t_step / scale ,
812- max_rates = max_rates , bg_rate = bg_rate , populations = populations ,
813- num_particles = self .num_particles ,
814- bg_particle = self .num_particles ,
815- overwrite = overwrite , chunksize = chunksize )
812+ kw = dict (
813+ name = name , clk_p = self .t_step / scale ,
814+ max_rates = max_rates , bg_rate = bg_rate , populations = populations ,
815+ num_particles = self .num_particles ,
816+ bg_particle = self .num_particles ,
817+ overwrite = overwrite , chunksize = chunksize
818+ )
816819 if comp_filter is not None :
817820 kw .update (comp_filter = comp_filter )
818821 try :
@@ -833,6 +836,7 @@ def simulate_timestamps_mix(self, max_rates, populations, bg_rate,
833836 # Load emission in chunks, and save only the final timestamps
834837 bg_rates = [None ] * (len (max_rates ) - 1 ) + [bg_rate ]
835838 prev_time = 0
839+ # Loop through time and for each time-slice simulate all populations
836840 for i_start , i_end in iter_chunk_index (timeslice_size , t_chunksize ):
837841
838842 curr_time = np .around (i_start * self .t_step , decimals = 0 )
0 commit comments