GalSim-developers/GalSim — pull request #193 by rmandelb (2012-06-15 20:49:36+00:00)
Title: #134 - shear conventions

This pull request is for some agreed-upon updates to our shearing conventions. It includes:

* on the C++ side, Shear objects are now initialized using g1/g2 (reduced shear) rather than e1/e2-type distortions; likewise the C++ applyShear works in terms of g1/g2.
* on the python side, there is a Shear method that can be initialized in many different ways, using reduced shear / distortion / conformal shear expressed either as components or as a total normalization and a position angle. There are unit tests to make sure these different initializations are all working properly. The applyShear/createSheared methods can take either a python Shear as an argument, or can take arguments to initialize its own Shear.
* there are some simplifications in how Ellipses are initialized, including the definition of a python Ellipse. Its behavior is not quite parallel to Shear, btu Ellipse is also not used as much, so I think that's okay for now. We can use this one for a while and then I can change it if we hate it.
* the applyDistortion/createDistorted methods are now applyTransformation/createTransformed. Also, there are more unit tests that use those methods.
* config is only minimally updated to use the proper methods but without adding more ways to initialize shears, per Jim's suggestion that I wait for his ongoing method to update config
* added getG1(), getG2() methods

Limitations because I ran out of time before i have to move:
* I realized that the HSMShapeData structure contains a C++ shear, whereas we might want it to have a python Shear. The difference is that if it's a C++ shear you have to do e.g.,
```
res = galsim.HSMShapeData()
g1 = res.observed_shape.getG1()
```
whereas if it's a python shear you could do
```
g1 = res.observed_shape.g1
```
which is slightly simpler. I didn't think it was a big deal and I'm out of time for a while so I didn't bother redefining the structure in python, but I could do it later if people want it.
* I wasn't sure what is our convention for doxygen documentation of possible args/kwargs that could be used in the Shear/Ellipse constructors. It didn't seem quite right to put them as params in the usual way. So right now the dox are slightly inadequate (with some useful examples but no params). Once I get some suggestions I can improve this.
* ShootInterpolated.py cannot be run, but that's an issue on master as well rather than something new, so I am putting in this pull request and hoping it will get fixed elsewhere rather than on this branch.

Because of the move, I'll be semi-responsive for the next week, but should be able to respond to concerns periodically so we can get this merged in within ~1 week.