tij_to_pij

romanisim.l1.tij_to_pij(tij, remaining=False)

Convert a set of times tij to corresponding probabilities for sampling.

The probabilities are those needed for sampling from a binomial distribution for each read. These are delta_t / sum(delta_t), the fraction of time in each read over the total time, when remaining is False. When remaining is true, we scale these probabilities not by the total time but by the remaining time, so that subsequent reads get subsequent reads get scaled up so that each pij is delta_t / time_remaining, and the last read always has pij = 1.

Parameters:
tijlist[list[float]]

list of list of readout times for each read entering a resultant

remainingbool

scale by remaining time rather than total time

Returns:
list[list[float]]

list of list of probabilities for each read, corresponding to the chance that a photon not yet assigned to a read so far should be assigned to this read.