On Mar 17, 2013, at 8:29 PM, Mike Jarvis <notifications@github.com> wrote:

> In galsim/lensing.py:
> 
> >              else:
> >                  g1.append(sbii_g1.xValue(pos+self.offset))
> >                  g2.append(sbii_g2.xValue(pos+self.offset))
> > +                if get_kappa:
> > +                    kappa.append(sbii_kappa.xValue(pos+self.offset))
> > +                else:
> > +                    kappa.append(0.)
> Do you think it makes sense to have both getConvergence and getMagnification?
> 
> I would keep both I think. It makes sense to provide access to the raw values (gamma, kappa) as well as convenient derived quantities.
> 
There is a scenario I'm slightly concerned about, which is that someone would say "I want to apply shear and magnification, so I will use getShear and getMagnification" - but getMagnification has to get the shear and convergence, so essentially they are getting the shear twice.  That means they are doing 5 interpolations instead of 3.  Perhaps we could flag this in the documentation, and provide a convenience function that converts from theory quantities = shear and convergence to observed quantities = reduced shear and magnification?  i.e., we would suggest that for efficiency, they should do something like

```
g1, g2 = my_ps.getShear(…)
kappa = my_ps.getConvergence(…)
g1_reduced, g2_reduced, magnification = galsim.lensing.theoryToObserved(g1, g2, kappa)
```

There would still be a getMagnification (for people who don't care about shear at all), and a getReducedShear (for people who don't care about magnification), we would just note in the documentation that if you do care about both, it's more efficient to do the above.

This scheme of having a theory -> observed quantity converter also would help with the fact that some people will only want to work with quantities on the grid (not interpolating), so they could run the outputs of buildGrid directly through that converter.
> The other one that I might add is getReducedShear, which is probably the one we actually want to use when we apply to galaxies, right? i.e. That's the one that config should use when the shear type is PowerSpectrumShear or NFWHaloShear. And also the one that should be used with a combined applyLensing function if we add that feature.
> 
Do you like the idea of applyLensing / createLensed?  I could also do that here.