GETZERNIKE

Calculates Zernike Fringe, Standard, or Annular coefficients in units of waves for the currently loaded lens file, and places them in one of the vector arrays (either VEC1, VEC2, VEC3, or VEC4).

Syntax:

GETZERNIKE maxorder, wave, field, sampling, vector, zerntype, epsilon, reference

Discussion:

The maxorder argument is any number between 1 and 37 for Fringe or between 1 and 231 for Standard or Annular coefficients (see the discussion of zerntype below), and corresponds to the highest Zernike term desired. Wave and field are the integer values for the wavelength and field number respectively. The value for sampling determines the size of the grid used to fit the coefficients. Sampling may be 1 (32 x 32), 2 (64 x 64), etc.... up to 2048 x 2048. The vector argument must be an integer value between 1 and 4, and specifies which vector array the data should be placed in. The zerntype is 0 for "fringe" Zernike terms, 1 for "Standard" Zernike terms, and 2 for "Annular" Zernike terms. See "Zernike Fringe Coefficients", "Zernike Standard Coefficients", and "Zernike Annular Coefficients" for descriptions of these different types of Zernike terms. For Annular Zernike Coefficients epsilon is the annular ratio; this value is ignored for other Zernike types. To reference the OPD to the chief ray, the reference value should be zero or omitted; use 1 to reference to the surface vertex. If any of the arguments fall outside the valid ranges, then the nearest acceptable value is used instead.

The data is returned in one of the vector arrays with the following format: Vector position 1: Peak to valley to the chief ray in waves; Vector position 2: RMS to the zero OPD line in waves (this value is not physically meaningful but is provided for reference); Vector position 3: RMS to the chief ray in waves; Vector position 4: RMS to the image centroid in waves (this is the most physically meaningful number related to image quality); Vector position 5: Variance in waves; Vector position 6: Strehl ratio; Vector position 7: RMS fit error in waves; Vector position 8: Maximum fit error (at any one point) in waves. The remaining vector positions contain the actual Zernike coefficient data. For example, Zernike term number 1 is in vector position 9, Zernike term 2 is in position 10, and so on.

Example:

! This macro computes the first 37 Zernike Fringe coefficients
! for the currently loaded lens, at wave 1, field 1
! and a 32x32 grid density (sampling = 1). The coefficients
! will be placed in vector 1. First get the data:
GETZERNIKE 37,1,1,1,1,0
! Now print it out:
FORMAT 16.6
PRINT "Peak to Valley   : ", vec1(1)
PRINT "RMS to chief     : ", vec1(3)
PRINT "RMS to centroid  : ", vec1(4)
PRINT "Variance         : ", vec1(5)
PRINT "Strehl ratio     : ", vec1(6)
PRINT "RMS Fit Error    : ", vec1(7)
PRINT "Maximum Fit Error : ", vec1(8)
i = 1
label 1
FORMAT 2.0
PRINT "Zernike #", i, " = ",
FORMAT 16.6
PRINT vec1(8+i)
i = i + 1
if (i < 38) THEN GOTO 1
PRINT "All Done!"

Next: