WFS_iss57 Sensor Noise Implementation

Added Readout (White Gaussian) and Photon (Poisson) Noise to WFS.  Can turn on and off with the 'Noisy' flag in paramsSensor.  Currently turned off (False) in main.py.  

Also includes demoWFS.py which was used for the presentation and can be used to isolate the sensor model from the rest of the loop and plot the intensity distribution for the lenslet array.  

Documentation for noise on WFSDocumentation branch.
Good justification.


On 20 June 2014 16:21, Amy Deeb <notifications@github.com> wrote:

> In src/WFS/mainWFS.py:
>
> >  	return x, y, Ii
> > -
> > +
> > +
> > +def addNoise(Ii, sigma_r, mean_r):
> > +	# Readout noise: White Gaussian
> > +	N_r = random.normal(mean_r, sigma_r, (size(Ii[1]), size(Ii[2])))
> > +
> > +	# Photon noise: Poisson
> > +	# Poisson distribution can only return integer values (# events), so here we assume 1000 events occur,
> > +	# then generate the corresponding noise for each pixel, then re-normalize back to a unit intensity distribution
> > +	lambda_p = mean(Ii)*1000
> > +	N_p = random.poisson(lambda_p, (size(Ii[1]), size(Ii[2])))
> > +	N_p = (N_p.astype(float))/1000
> > +	
>
> I agree, it is definitely not ideal, but the only other way would be to
> change from a normalized incident intensity to a number of photons for the
> intensity (which would require input of the exposure time for the frame and
> the power of the source) or the number of electrons that are read out on
> average. I think it won't make a large difference (only an error due to
> quantization), since even if we knew the number of photons or number of
> electrons, we would still normalize it afterwards in order to add it to the
> intensity. I chose 1000 because that seemed to be the typical value (of
> number of photons) for modelling photon noise in the literature.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/faitdivers/pyao/pull/83/files#r14021562>.
>