Hello!
I’m working on a system in which I evaluate physical optics propagation (POP) for beams of several different sizes in the merit function. The way I change the beam size within POP is using a little macro I wrote (see snippet below).
This code works well when I’m optimizing or playing with values in the LDE, but it does not yield consistent results when I run a tolerance analysis. I suspect this is because of how .cfg files are handled during tolerancing.
Is there a better way to modify the POP parameters so that they are modified appropriately during tolerancing?
path$ = $PATHNAME() + "\"
lensFilename$ = $FILENAME()
lengthFilename = SLEN(lensFilename$)
shortenFilename$ = $LEFTSTRING(lensFilename$, lengthFilename-3)
cfgFilename$ = path$ + shortenFilename$ + "CFG"
w0_in = PVHX() # read in the HX parameter. "PV" is a mnenomic for "pass value"
! change the beam waist of the light coming from the fiber
MODIFYSETTINGS cfgFilename$, POP_PARAM1, w0_in # Waist X of beam definition tab
MODIFYSETTINGS cfgFilename$, POP_PARAM2, w0_in # Waist Y of beam definition tab