Skip to main content

Can I reformat data output from analysis windows?

  • May 28, 2020
  • 1 reply
  • 264 views

Angel Morales
En-Lightened
Forum|alt.badge.img+1

I have some data (such as the text output from a Surface Sag or Surface Phase window). I would like to save this data, but with a different representation of the significant digits. Is there any way to accomplish this?

Did this topic help you find an answer to your question?

1 reply

Angel Morales
En-Lightened
Forum|alt.badge.img+1
  • Author
  • En-Lightened
  • 203 replies
  • May 28, 2020

While we do have a Copy button in the toolbar for any analysis window with text output, it might be more efficient to instead approach this by outputting the values for the associated Merit Function Editor operand in a text file. For example, let's say we wanted to save the Surface Phase data for the following Zernike Fringe Phase surface:

The text output itself will always be in scientific notation with six digits following the decimal point:

To get this same set of data, what we could instead do is leverage the ZPL with the OCOD/OPEV functions to read in Surface Phase data and save it to an array. Once the data is saved to the array, we can then use the FORMAT keyword to re-define how we want the number data represented and the OUTPUT keyword to define a text file name to save the file to. For further information on the syntax for these keywords, we recommend you take a look at our Help File documentation.

An example ZPL file is provided here for your reference as well as this demo file. Please note that if you run the ZPL with no modifications, the resulting text file will be saved to your {Zemax}\Macros folder, since no file path is specified. The following is the output TXT file:

Feel free to reply to this thread if there are any follow up questions!

~ Angel


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings