GalSim-developers/GalSim — pull request #194 by rmjarvis (2012-06-18 03:38:11+00:00)
Title: #159 Allow both flux and surface brightness normalizations in draw commands.

This is a fairly straightforward pull request.

I mostly just added some code to the draw and drawShoot commands in python to check for an optional kwarg: `normalization` which can be either "flux" or "surface brightness". (I ended up going without the underscore, since it looked a little funny to me with the underscore inside the quotes. But I'm open to switching that.)

I also made some tweaks to the various shoot methods when the flux wasn't coming out quite accurate enough for the unit tests I wrote when doing drawShoot.

Gary, you might want to check them to make sure I didn't do something invalid there. Especially OneDimensionalDeviate, where I explicitly rescale the flux after all the interval draws that don't come back with quite the right total flux.

Finally, I added two new "magic numbers": xvalue_accuracy and shoot_flux_accuracy which are used by Airy and Sersic for their sampler objects. They had used alias_threshold for their flux accuracy, which isn't all that accurate, so now there are more explicit parameters that can be tuned separately as desired.