Skip to main content
Solved

generate a surface with grid sag and csv file

  • July 12, 2023
  • 1 reply
  • 282 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
Did this topic help you find an answer to your question?

1 reply

Benjamin.N
Forum|alt.badge.img
  • Visible
  • 34 replies
  • Answer
  • July 13, 2023

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


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