Solved

generate a surface with grid sag and csv file

  • 12 July 2023
  • 1 reply
  • 79 views

hi,  i have a csv file with x by y cells.  each cell row and column represents an x, y position in microns.  each cell has a z height corresponding to the x, y position.  

 

I would like to import this csv file into a grid sag surface  to create a surface in zemax.  

 

how can i do this?

icon

Best answer by Benjamin.N 13 July 2023, 06:16

View original

1 reply

Userlevel 2
Badge

Hi John,

the grid sag surface requires a .DAT file with a specific format. The format is described in the following article: How to use the Grid Sag surface type – Knowledgebase (zemax.com)

Your .CSV file does not seem to conform to the .DAT file format. The conversion can be done programmatically, you can find MATLAB and Mathematica examples in this article here: How to write a Grid Sag DAT file programmatically – Knowledgebase (zemax.com)

Best regards
Benjamin

Reply