Solved

Creating a Grid Phase .DAT file

  • 6 July 2020
  • 1 reply
  • 902 views

Badge
  • Single Emitter
  • 0 replies

I'm trying to create a Grid Phase data file to act as a phase screen, and the manual describes the file format as equivalent to a Grid Sag .DAT file, but that doesn't seem to be working for me. For a Grid Sag file, information is arranged as follows: 


! nx ny delx dely unitflag xdec ydec  <-- First data line

! z dz/dx dz/dy d2z/dxdy <-- Other data lines


I  was wondering if my problem is with the unitflag value; there doesn't seem to be a flag value corresponding to phase units/no units? I would very much appreciate if someone could give me the correct format for a Grid Phase .DAT file, and if you could also send me an example Grid Phase .DAT file to look at.


Thanks!

icon

Best answer by Csilla Timar-Fulep 7 July 2020, 11:11

View original

1 reply

Userlevel 5
Badge +2

Hello Ravi,

Thanks for your question here!

You are right, the unitflag value is used in a different way for Grid Sag and Grid Phase data.

If the Grid file describes a Sag profile, then the unit defined by the unitflag value (i.e. 0 for mm, 1 for cm, 2 for in, and 3 for meters) sets the scale for the z sag and d2z/dxdy cross-derivative values, as well as for the delx and dely increments. The first derivate values are dimensionless and therefore are not scaled.

On the other hand, when the Grid file describes a Phase profile, the units are radians of phase, instead of units of length. In this case, the unitflag data is only used to scale the delx, dely, and derivative values.

Apart from the above, the file format for the Grid Sag and Grid Phase .DAT files are equivalent. You may find example .DAT files in the \Zemax\Objects\Grid Files filder.

To ensure that the DAT file has been properly imported, the Surface Phase analysis tool can be used. Open this analysis by navigating to Analyze…Surface…Phase.

You may find more information about Grid file generation and usage in the following knowledgebase aricles:

How to use the Grid Sag surface type

How to write a Grid Sag DAT file programmatically

Best,

Csilla

Reply