GETDENCUSER1D
Calculates diffraction encircled energy data from a Huygens PSF text file and places the data in one of the vector arrays (either VEC1, VEC2, VEC3, or VEC4).
Syntax:
GETDENCUSER1D wave, pupil_samp, PSFFile$, vector
Discussion:
Wave is an integer corresponding to the wavelength number to use for the calculation. A value of zero indicates a polychromatic calculation. Pupil_samp may be 1 (32 x 32), 2 (64 x 64), 3 (128 x 128), etc... up to 2048 x 2048. PSFFile$ is a string containing the file name and path of the text file containing the Huygens PSF data to use. The vector argument must be an integer value between 1 and 4, and specifies which vector array the data should be placed in. If any of the arguments fall outside the valid ranges, then the nearest acceptable value is used instead. This calculation uses the Huygens MTF method.
*Note that TXT File Encoding (set under OpticStudio Preferences > General) must be set to ANSI to use this keyword.
Example:
PSFFile$ = "C:\Users\Name\Documents\Zemax\PSF.txt" PSFFile$ = "C:\Users\Name\Documents\Zemax\PSF.txt" SettingsFile$ = "C:\Users\Name\Documents\Zemax\Configs\HPS.CFG" wave = 3 pupil_samp = 4 image_samp = 3 MODIFYSETTINGS SettingsFile$, HPS_PUPILSAMP, pupil_samp MODIFYSETTINGS SettingsFile$, HPS_IMAGESAMP, image_samp MODIFYSETTINGS SettingsFile$, HPS_WAVE, wave MODIFYSETTINGS SettingsFile$, HPS_FIELD, 1 MODIFYSETTINGS SettingsFile$, HPS_CENTROID, 0 GETTEXTFILE PSFFile$, Hps vector = 4 GETDENCUSER1D wave, pupil_samp, PSFFile$, vector N_BINS = vec4(0) OFFSET = vec4(1) OUTPUT SCREEN FORMAT 15.0 PRINT "Number of Bins = ", N_BINS FORMAT 15.0 PRINT "Offset = ", OFFSET OFF1 = OFFSET OFF2 = OFF1 + N_BINS MAXI = N_BINS-1 FORMAT 16.6 PRINT PRINT " Radial Distance Energy" PRINT FOR i, 0, MAXI, 1 PRINT vec4(OFF1 + i), PRINT vec4(OFF2 + i) NEXT i
Next: