GETMTF
Calculates tangential and sagittal MTF, real part, imaginary part, phase, or square wave response data for the currently loaded lens file, and places the data in one of the vector arrays (either VEC1, VEC2, VEC3, or VEC4).
Syntax:
GETMTF freq, wave, field, sampling, vector, type
Discussion:
- The freq argument is the desired spatial frequency in MTF Units (see "MTF Units"). If the frequency is less than zero, or greater than the cutoff frequency, GETMTF returns zero.
- 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 type argument refers to the data type:
- 1 for MTF,
- 2 for real part,
- 3 for imaginary part,
- 4 for phase in radians,
- 5 for square wave MTF.
If any of the arguments fall outside the valid ranges, then the nearest acceptable value is used instead.
This calculation uses a fast, sparse sampling integration method to compute the MTF, i.e. at the given point the MTF value is calculated as the autocorrelation of the complex pupil function (the complex wavefront in the exit pupil). The fast sampling method used by GETMTF is not directly related to the MTF Analysis feature. Because only a single spatial frequency is required, the method of computation used by GETMTF is different, and generally much faster, than the algorithm used by the analysis feature (see also MTFA operand Grid parameter).
The data is returned in one of the vector arrays with the following format:
- Vector position 0: tangential response;
- Vector position 1: sagittal response.
Example:
! This macro computes the T & S response at 30 lp/mm ! for the currently loaded lens, polychromatic, ! at the maximum defined field, ! and a 32x32 grid density (sampling = 1). ! Data will be placed in vector 1. ! This is all it takes to get the data: GETMTF 30, 0, NFLD(), 1, 1, 1 PRINT "Tangential response:", vec1(0) PRINT "Sagittal response :", vec1(1)
Next: