GalSim-developers/GalSim — pull request #532 by rmandelb (2014-04-14 18:10:42+00:00)
Title: #526 - correlated noise fixes, addNoiseSNR modification, and documentation

Hi all -

This pull request is for the work that Mike and I did on issues #526, #527, and #528, which turned out to be somewhat connected. There was also some documentation work that got done together with code changes. In brief, here are the changes:

From pull request #514:
* Clean up docstrings in one particular way: make sure classes are just called by their names (e.g., CorrelatedNoise rather than CorrelatedNoise() or `CorrelatedNoise`), use back ticks for parameters and arguments, and use () for functions (addNoiseSNR() rather than `addNoiseSNR`). Once I was going over the documentation I also made a few updates to things that seemed out of date. I tried to put those into separate commits than the cleanup, though occasionally I forgot and lumped both kinds of changes together. As usual when imposing some standards for the documentation there were a few iffy cases, for which I tried to make sensible judgment calls, but I'm open to suggestions for changes.

From #526:
* Made addNoiseSNR() return the variance of the noise that was added, which otherwise was not obvious for ```preserve_flux=True```.
* Fixed a bug that broke getRNG() and therefore withVariance() and addNoiseSNR() for objects that were initialized with a default RNG.
* Added some unit tests for the above issues.
* Fixed a bug that made UncorrelatedNoise objects impossible to convolve with some GSObjects, and added unit tests for that problem.
* Made an easier way to initialize CorrelatedNoise objects with default RNG, etc.

From #527:
* im.getCorrelatedNoise() was broken, but now it works due to the changes on #511.

From #528:
* Added unit tests of getVariance() / setVariance() methods for CorrelatedNoise class.

I'll be offline starting tonight for a few days, but will reply to suggestions once I'm back.