locan.simulation.simulate_locdata.simulate_frame_numbers#
- locan.simulation.simulate_locdata.simulate_frame_numbers(n_samples, lam, seed=None)[source]#
Simulate Poisson-distributed frame numbers for a list of localizations.
Return numpy.ndarray of sorted integers with each integer i being repeated n(i) times where n(i) is drawn from a Poisson distribution with mean lam.
Use the following to add frame numbers to a given LocData object:
frames = simulate_frame_numbers(n_samples=len(locdata), lam=5) locdata.dataframe = locdata.dataframe.assign(frame = frames)
- Parameters:
n_samples (
int
) – number of elements to be returnedlam (
float
) – mean of the Poisson distribution (lambda)seed (
Union
[None
,int
,Sequence
[int
],SeedSequence
,BitGenerator
,Generator
]) – random number generation seed
- Returns:
The generated sequence of integers with shape (n_samples,)
- Return type:
npt.NDArray[np.int64]