Skip to main content

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!

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