does it do the same image distortion as applyTransformation? is there still this function applyTransformation?
and about the applyShear function, it only apply shear, no other lensing effect, i.e. no magnification, or no other higher order effects, right?
In version 1.1, the methods
applyShear
andapplyTransformation
were deprecated. The preferred methods to use are nowshear
andtransform
.The
shear
method is typically used assheared_obj = obj.shear(g1=g1, g2=g2)
whereg1
,g2
are the components of the reduced shear to be applied. You can also givee1
,e2
(distortions rather than shear), org
,beta
ore
,beta
(giving the magnitude and position angle), among other possibilities. See the docs for theShear
class for more information about ways to specify a shear in GalSim.However you specify the shear, the
shear
method will shear the given surface brightness profile by that amount in a manner that preserves total flux.The
transform
method is somewhat more general in that you can transform by any arbitrary 2x2 coordinate transformation matrix. Specifically, you specify an arbitrary Jacobian:dudx
,dudy
,dvdx
,dvdy
, where (x,y) are the original coordinates and (u,v) are the transformed coordinates. With this method, you could apply a transformation that is equivalent to a shear, but you would need to manually calculate the correct terms in the Jacobian.The other difference is that
transform
does not necessarily preserve flux. The flux is only preserved if the Jacobian has unit determinant. So depending on your use case, you may want to rescale the flux by the determinant when you are done.My guess is that you will most often want to use
shear
rather thantransform
. Here is a sample use case (taken from demo5.py in the GalSim examples directory):Hope this helps.
Note: The links above are current as of December, 2014. If they go stale, try navigating from the top level of the Doxygen documentation, which hopefully will still work.