Skip to main content
Solved

how to write ZPL macro to save detector data from ZRD file to .DAT or .SDF file?

  • December 28, 2022
  • 2 replies
  • 333 views

Ntran

Hi,

I want to save data from 100 detectors (ZRD file) to .DAT or .SDF files using ZPL macro or something similar.  Can anyone help with a code?  It is tedious to manually save one by one.  

Thank you very much!

Best answer by Ethan

Hi @Ntran,

Apologies for the delayed response to your question. I’m glad you were able to use the ZRDSAVERAYS function to approach the problem. However, this is a limitation of ZPL, and you have limited control over some of the analysis and export features. To overcome this challenge, you could consider using the ZPL to manually edit the wavelength in the output files. The DAT format is pretty straightforward (see the Help File, The Setup Tab > Editors Group (Setup Tab) > Non-sequential Component Editor > Non-sequential Sources > Source File). You will find that each ray follows this format (per line):

x   y   z   l   m   n   intensity   wavelength

 

Let me know if this might work for you.

Best,
Ethan

View original
Did this topic help you find an answer to your question?

2 replies

Ntran
  • Author
  • Monochrome
  • 3 replies
  • December 30, 2022

I am able to write a loop to save Detector data to .DAT file using  ZRDSAVERAYS.  However, the .DAT file seems not “flux only” and I cannot use “System wavelength” when the .DAT files are used as source file.  However, .DAT file that is manually saved through “Ray Data Viewer” is ok, “flux only” type and “System wavelength” can be used.


Ethan
En-Lightened
Forum|alt.badge.img+2
  • En-Lightened
  • 107 replies
  • Answer
  • January 30, 2023

Hi @Ntran,

Apologies for the delayed response to your question. I’m glad you were able to use the ZRDSAVERAYS function to approach the problem. However, this is a limitation of ZPL, and you have limited control over some of the analysis and export features. To overcome this challenge, you could consider using the ZPL to manually edit the wavelength in the output files. The DAT format is pretty straightforward (see the Help File, The Setup Tab > Editors Group (Setup Tab) > Non-sequential Component Editor > Non-sequential Sources > Source File). You will find that each ray follows this format (per line):

x   y   z   l   m   n   intensity   wavelength

 

Let me know if this might work for you.

Best,
Ethan


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