I have data generated by the following function:
def generator(photons):
runs = 10000
sectors = []
events = np.random.poisson(photons, runs)
for i in events:
hit = np.random.randint(low=1, high=9, size=i)
sectors.append(hit)
freq = np.zeros((9,), dtype=int)
for j in sectors:
act_sec = len(np.unique(j))
freq[act_sec] += 1
freq = [ k / runs for k in freq ]
return freq
Basically, there are events with a poisson distribution that trigger a detector and I'm counting the amount of active detectors. I wish to be able to look at the amount of active detectors to see how many events occurred.
So far I've used scipy.optimize.curve_fit
and lmfit
to try and return the input parameter but I've had no luck. The fit must be truncated to the amount of detectors and there is only one input parameter. If anyone could offer some guidance it would be much appreciated.