I managed to add poisson noise to my .fits image, but I need to add noise that is distributed like a gaussian with mean/median (mu_0) of 0 and an increasingly wider distribution (sigma). I couldn't find the syntax governing the adding of noise in this way, so can somebody please walk me through it? At the moment, the poisson noise I added is evenly distributed, which isn't what I want; I need the gaussian randomness.
Here's the relevant bit of code:
im = pf.open(name)
isinstance(im,list)
im0 = im[0]
print im0.data.shape
print np.var(im0.data)
poissonNoise = np.random.poisson(poisson, im0.data.shape).astype(float)
test = im0.data + poissonNoise
print np.var(test)
im0.data = test
stringee = 'POISSON'
pf.writeto(stringee+poisson+name, data=test, clobber=True, header=im0.header)
check = pf.open(stringee+poisson+name)
np.var(check[0].data)