GalSim-developers/GalSim — pull request #448 by rmjarvis (2013-07-03 16:15:29+00:00)
Title: #439 A bunch of fairly small changes

This PR was originally for adding the offset parameter to draw, but I decided to hit a number of other fairly small issues that had cropped up recently:

- (#439) The new `offset` parameter allows you to more easily center the given profile at a location other than the center of the image. It is given in pixels, rather than arcsec, so when you want to implement shifts in pixels (e.g. for sub-pixel dithering), you don't need to convert to arcsec in order to use `obj.applyShift`.
- I added usage of the new offset parameter to demos 9,11.
- (#424) David noticed some wrong behavior when shifting large amounts. This was because SBTransform wasn't correctly updating its stepk value for the shift. I fixed this.
- (#438) I had removed some of the default values for parameters in the C++ layer, since they can lead to difficult-to-find bugs. Without default values, the compiler helps you find when you forget to update a parameter in a call to the new signature in the definition. And since we mostly use python anyway, we get a much nicer version of default arguments there (with kwargs), so we don't really need them in C++. So I systematically went through and got rid of the defaults in most cases.
- (#441) We had been able to construct an Image from a differently-typed image (e.g. `Image` from `Image`) in C++, but it wasn't wrapped. Now we can do that in python too.
- (#443) Barney noticed that if you accidentally construct an `InterpolatedImage` from an empty `Image`, it gave a fairly non-helpful error message. Now raises a more explanatory exception: `RuntimeError: Trying to initialize InterpolatedImage with an empty image.`
- (#444) g++ 4.8 introduced a new warning that fails for boost code. I added pragmas to ignore this warning when we include boost header files.
- I also added scale to the Image constructor, so we can set it directly on image construction rather than setting it in the next line as we had often been doing.
- I had been moving away from using `getScale` and `setScale` in python, since we can just read and write to `im.scale` instead, which is more pythonic. The former methods are still there, but I removed them from our docs and example code to encourage people to use the simpler style. (And when possible, I moved the assignment into the constructor, now that that is possible.)
- Similarly, I switched getBounds and setBounds to using im.bounds directly, although there were far fewer examples of this in the code already.
- I added the ability to use a `PositionD` argument for `applyShift` in addition to `(dx,dy)`.