Solved

ZPL: GETTEXTFILE with and w/o settingsfile

  • 19 June 2020
  • 2 replies
  • 467 views

Userlevel 2
Badge

Dear support team,


I have problems understanding the behaviour of the PDL statement GETTEXTFILE in combination with the settingsfile:


I am using GETTEXTFILE for Huygens PSF simulations.


My questions:


1. Which settings are used if no settingsfile is given at all? It seems that in this case the settings that are saved with the 'save' button in the 'Huygns PSF' window are used. Is this correct and always the case? Does it additionaly depend on the 'flag' setting?


2. With flag=2 the settings box for the requested feature should be displayed. This doesn't seem to happen. No setting box appears. Or is this only the case in combination with an explicit  settingsfile? I tryed w/o settingsfile.


3. How can I make sure that the current  settings in the 'Huygns PSF' window are used for the simulation?


Thank you and best regards,

Christof.


--


DR. CHRISTOF BODENDORF

Max-Planck-Institute for Extraterrestrial Physics

Division: Optical and Interpretative Astronomy

Giessenbachstr. 1

85748 Garching

Germany

Phone.: +49 89 30000 3693

E-Mail: ChBo@mpe.mpg.de

icon

Best answer by Allie 24 June 2020, 00:14

View original

2 replies

Userlevel 2
Badge

Now, my finding is that I can use flag value 0. Then the settings from the Huigens PSF window are saved with the 'save' button from this window in the file lensfilename.cfg.


However, the same settings seem to be *additionally* saved in the file ....\Documents\Zemax\Configs\HPS.GFG.


This doubling confuses me. However, the subsequent execution of GETTEXTFILE with flag = 0 seems to use these settings (from one of these two files). Right?

Userlevel 6
Badge +2

Hi Christoph,


1. Which settings are used if no settingsfile is given at all? It seems that in this case the settings that are saved with the 'save' button in the 'Huygens PSF' window are used. Is this correct and always the case? Does it additionally depend on the 'flag' setting?


When you use GETTEXTFILE without explicitly stating the settings file, then the settings used will be the same ones that are shown when you open a fresh instance of the analysis tool in question. Those initial settings are pulled from the lens-specific configuration file (lensfilename.cfg) if available. Otherwise, the settings are pulled from the {Zemax}\Configs folder. 


When you click the 'Save' button, then both the lens-specific CFG and the configuration file found in the {Zemax}\Configs folder will be updated with the new settings. GETTEXTFILE will then use those updated settings. 


With regards to the 'Flag' setting - I personally never use this, but it will choose the settings based on the method as described in the Help System file 'The Programming Tab > About the ZPL > KEYWORDS (about the zpl) > GETTEXTFILE (keywords)'. 


In general, the process I use is this:



  1. Open the analysis window I want to use for GETTEXTFILE

  2. Update the settings and click 'Save'. This will generate (or update) a lens-specific configuration file. All analyses and GETTEXTFILE will default to this file now.

  3. Run the macro with GETTEXTFILE. It will use the most-recently saved settings.

  4. For any other updates to the settings beyond that, use the keyword MODIFYSETTINGS to change the settings in the lens-specific CFG


2. With flag=2 the settings box for the requested feature should be displayed. This doesn't seem to happen. No setting box appears. Or is this only the case in combination with an explicit  settingsfile? I tryed w/o settingsfile.


I discussed this with one of our developers. This functionality may have been available in Z13, but is no longer available as part of OpticStudio. I have submitted a request to update the Help System with this information. I apologize for the confusion here. 


3. How can I make sure that the current  settings in the 'Huygens PSF' window are used for the simulation?


The most straight-forward method would be to open the analysis tool you're interested in, update the settings, and click 'Save'. Then GETTEXTFILE will use those settings. 


4. Settings are saved to two different locations. Why?


Two CFG files are updated in order to maintain distinct settings for each project you are working on. Consider this following scenario:


You are working on Lens1.ZMX. You are interested in the Phase-output for the Huygen’s PSF. You change the settings and you click “Save”. This updates HPS.CFG and Lens1.CFG.


Now, you create a new lens file. You name it Lens2.ZMX. When you open a Huygen’s PSF for this fresh file, it will defer to the settings in HPS.CFG. However, let’s say you are interested in Type = Linear for this file’s PSF instead of Phase. You update the settings and you click “Save”. Now, Lens2.CFG is created, and HPS.CFG is updated.


The lens-specific CFG file will always take precedence. This way, if you return to Lens1.ZMX and open a new Huygen’s plot, it will still show the Phase output. Any new lens files which do not have a lens-specific CFG will then defer to HPS.CFG.


 


Let me know if you have any other questions about this!


Best,


Allie

Reply