Skip to main content

How to detect by source location?

  • January 25, 2021
  • 4 replies
  • 104 views

I am using non-sequential mode. And I want to detect by automatically moving the location of the source by 1mm. How to write zpl file? I want to figure out the number of hits by point source location.


Ex) point source location(0,0,0) >> clear & trace >> point source location(1mm,0,0) >> clear & trace >> point source location(2mm,0,0) >> clear & trace >> point source location(3mm,0,0) >> clear & trace ...

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

4 replies

David.Nguyen
Luminary
Forum|alt.badge.img+2
  • Luminary
  • 1083 replies
  • January 25, 2021

Hi Suhwan,


You can try something like that:


! Define detector position in the NSCE

DetectorPosition = 2



! Retrieve current detector Z Position

ZPosition = NPOS(1, DetectorPosition, 3)



! Iterate over different positions of the Detector (three in this example)

FOR ii, 1, 3, 1

    ! Define offset value (starts at zero, by steps of five lens units)

    ZOffset = (ii-1)*5

    

    ! Move the Detector to the new Z Position

    SETNSCPOSITION 1, DetectorPosition, 3, ZPosition+ZOffset

    

    ! Clear the Detector

    clear = NSDD(1, -DetectorPosition, 0, 0)

    

    ! Perform a ray-trace

    NSTR 1, 0, 0, 0, 0, 1, 0

NEXT

I'm attaching an example file, together with the ZPL macro that I wrote. Let me know if this works for you.


Take care,


PS: I just noticed you wanted the Detector to move along the X Direction. Notice that in my example, I moved it along Z. I let you browse the help file with the terms used in my macro to figure out how to change it :p


David


  • Author
  • Infrared
  • 12 replies
  • January 26, 2021

Hi David


Thank you very much for answering.


It seems that my explanation was lacking. 


I'm very sorry, but can you help me one more time?


I will write it down in detail.


1. I have 16 detectors.


2. There is one point source.


3. I want to move the point source.


4. The detectors do not move.


5. I want to save the file after clear & ray-trace every time the source is moved.


Conclusion: From 1detector to 16detector, the number of hits detected by each detector will be different. And as the location of the source moves, the number of hits detected by each detector from 1detector to 16detector will also be different. In other words, I am designing to figure out the number of hits detected by each detector. 


I've been using zemax for about a month and I don't know much yet.


Thank you.


Su Hwan Kim


 


 


 


  • Author
  • Infrared
  • 12 replies
  • January 26, 2021

Hi David


I have created a perfect ZPL file with your advice.


Thank you very much.


 


Su Hwan Kim


David.Nguyen
Luminary
Forum|alt.badge.img+2
  • Luminary
  • 1083 replies
  • January 26, 2021

Hi Su Hwan,


Sorry again, I was too quick in reading your question, this happens way too often... :D


Fortunnately, you figured it out.


Don't hesitate to share your version of the ZPL here. Maybe it can be useful to other users.


Take care,


David


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