Skip to main content
Solved

how to get peak irrandiance from NSC detector through ZPL Macro


Davis

Hi Sir/Madam,

I am trying to get the peak irrandiance through ZPL language, but seems do not have command fit my purpose.

I am thinkging if I could use NSDD to get flux value in position space for each pixel# and compare each value with a command like “maximun” to get the peak one in a array, then I still could reach my purpose. But is there any command for me could do it to get maximun value? and how should I use it?

 

Sincerely

Davis 

Best answer by Berta.Bernad

Hi Davis,

To retrieve the peak irradiance from your detector, you can use NSDD with pixel# = -1 and data=0/1/2 depending if you want the result in position space, flux/area or angle space:

The Programming Tab > About the ZPL > Numeric Functions

The Optimize Tab (non-sequential ui mode) > Automatic Optimization Group (optimize tab, non-sequential) > Merit Function Editor (optimize tab, non-sequential) > NSC Operands

In your macro you will need first to write a NSDD to clear the detectors 

NSDD(surf, object, pixel, data)

When object = 0 then all detectors are cleared

Then run a raytrace using NSTR:

NSTR surf, source, split, scatter, usepolar, ignore_errors, random_seed, save, savefilename, filter, zrd_format

Then you can read the detectors:

NSDD(surf, object, pixel, data)

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

2 replies

Berta.Bernad
Zemax Staff
Forum|alt.badge.img+2
  • Zemax Staff
  • 112 replies
  • Answer
  • May 19, 2023

Hi Davis,

To retrieve the peak irradiance from your detector, you can use NSDD with pixel# = -1 and data=0/1/2 depending if you want the result in position space, flux/area or angle space:

The Programming Tab > About the ZPL > Numeric Functions

The Optimize Tab (non-sequential ui mode) > Automatic Optimization Group (optimize tab, non-sequential) > Merit Function Editor (optimize tab, non-sequential) > NSC Operands

In your macro you will need first to write a NSDD to clear the detectors 

NSDD(surf, object, pixel, data)

When object = 0 then all detectors are cleared

Then run a raytrace using NSTR:

NSTR surf, source, split, scatter, usepolar, ignore_errors, random_seed, save, savefilename, filter, zrd_format

Then you can read the detectors:

NSDD(surf, object, pixel, data)


Davis
  • Author
  • Monochrome
  • 1 reply
  • May 22, 2023

Hi Bernad,

I did not real undersand how to set up USDD, now I see. thank you!

sincerely yours

Davis


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