Fair enough.  I just pushed a fix.  I did this in a way that changed as little code as possible (I think) - meaning that while the internals of PowerSpectrumRealizer nominally could take ```nx!=ny``` (and give wrong results), the constructor itself only takes a single parameter (ngrid) and sets ```nx=ny=ngrid```.  This means that in future, someone could do a minor change to the constructor, fix the bits of the code that are wrong in the non-square case, and not have to rewrite everything. 

On Mar 21, 2013, at 10:19 PM, Mike Jarvis <notifications@github.com> wrote:

> In galsim/lensing.py:
> 
> >  
> >          # Set up the scalar |k| grid. Generally, for a box size of L (in one dimension), the grid
> > -        # spacing in k_x or k_y is Delta k=2pi/L.
> > -        self.k=2.*np.pi*((kx/(pixel_size*nx))**2+(ky/(pixel_size*ny))**2)**0.5
> > +        # spacing in k_x or k_y is Delta k=2pi/L (Barney edit: sqrt faster than **.5 I think...)
> > +        self.k = 2. * np.pi * np.sqrt((i_kx / (pixel_size * nx))**2 + (i_ky / (pixel_size * ny))**2)
> I just think it is bad form to leave in code that is known to be wrong. Either we should fix the code to be correct if nx != ny, or we should make sure that we enforce nx == ny. My preference is for the latter (perhaps just calling it ngrid again), but leaving it in a fractured state of incorrectness just seems like it's inviting trouble down the road.
> 
> —
> Reply to this email directly or view it on GitHub.
> 


-------------------------------

Rachel Mandelbaum
rmandelb@andrew.cmu.edu
http://www.andrew.cmu.edu/~rmandelb/