Paul, Thanks very much for this code. It is very much appreciated.

I think, however, that you have a bug in how you are normalizing your Zernike polynomials. Noll's paper shows that for terms with m=0 the normalization term should be (n+1)**0.5 and for terms with m!=0 the normalization term should be (2*(n+1))**0.5. In the routine zernpol.m you are normalizing all terms (including those with m=0) by (2*(n+1))**0.5.

Perhaps you have already fixed this? I have just downloaded it on 1-21-10 from this site. The creation date for the file I'm looking at is on Nov 13, 2006 12:56:48 PM.