from numarray import * from numarray.random_array import * size = 8640 # Number of observations flare = 1.1 # Size of flare counts = 1208*4*4 # Number of counts in the absence of a flare threshold = 0.97 # Threshold of mean flare flux at which you claim a flare. seed() # start up the random number generator photons = poisson(counts,[size]) # set up poisson noise array. photons[100] = poisson(counts*flare) # Add in the object elecnoise = normal(0.0, 20.0, [size]) # set up electronics noise array signal = photons + elecnoise # Combine arrays. detected = where(signal > threshold*counts*flare) # Produces an array listing where the condition was met print detected # Prints this array out: ugly formatting but quite usable.