Skip to main content
Solved

generate a surface with grid sag and csv file

  • Jul 12, 2023 7:37 PM UTC
  • 1 reply
  • 476 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?

Best answer by Benjamin.N

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

View original

1 reply

Benjamin.N
Forum|alt.badge.img
  • Visible
  • Answer
  • Jul 13, 2023 4:16 AM UTC

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