GETLSF

Calculates the geometric edge and line response functions, similar to the "Geometric Line/Edge Spread".

Syntax:

GETLSF wave, field, sampling, vector, maxradius, use_polarization

Discussion:

Wave is an integer corresponding to the wavelength number to use for the calculation. A value of zero indicates a polychromatic calculation. Field must be an integer between 1 and the maximum number of fields. The value indicates which field position to use. Sampling may be 1 (32 x 32), 2 (64 x 64), 3 (128 x 128), 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 maxradius argument is the maximum radial coordinate of the edge and line spread functions; this is the half-width of the data range. Use 0 for a default width. If any of the arguments fall outside the valid ranges, then the nearest acceptable value is used instead.

The data is returned as an array of values in the specified vector. Vector position 0-3 will hold the number of points "N", the starting x coordinate (this is the negative of the half width of the data range), the delta coordinate, and the offset (defined below), respectively. The offset is the first position in the vector that holds the edge or line spread data. Starting at the offset, the first N value are the tangential LSF response. The next N values are the sagittal LSF response. The tangential and sagittal ERF values are in the next two groups of N data values.

If the current vector size is not large enough, OpticStudio will automatically increase the size of the vectors to hold the LSF data in the manner described in SETVECSIZE.

Example:

 
! Macro computes and prints the LSF and ERF for polychromatic light at field 1.
!
! Syntax is GETLSF wave, field, samp, vector, maxradius, usepol
!
GETLSF 0, 1, 3, 1, 0, 0
 
N_BINS = vec1(0)
STARTX = vec1(1)
DELTAX = vec1(2)
OFFSET = vec1(3)
 
FORMAT 15.0
PRINT "Number of Bins     = ", N_BINS
FORMAT 15.3 EXP
PRINT "Starting Coordinate = ", STARTX
PRINT "Delta Coordinate   = ", DELTAX
FORMAT 15.0
PRINT "Offset             = ", OFFSET
 
OFF1 = OFFSET
OFF2 = OFF1 + N_BINS
OFF3 = OFF2 + N_BINS
OFF4 = OFF3 + N_BINS
MAXI = N_BINS-1
FORMAT 16.3 EXP
PRINT
PRINT "             X          TLSF          SLSF          TERF          SERF"
PRINT
 
FOR i, 0, MAXI, 1
PRINT STARTX + DELTAX*i,
PRINT vec1(OFF1 + i),
PRINT vec1(OFF2 + i),
PRINT vec1(OFF3 + i),
PRINT vec1(OFF4 + i)
 
NEXT i

Next: