Skip to main content
Solved

how to get peak irrandiance from NSC detector through ZPL Macro

  • May 17, 2023
  • 2 replies
  • 272 views

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)

2 replies

Berta.Bernad
Zemax Staff
Forum|alt.badge.img+2
  • Zemax Staff
  • 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
  • May 22, 2023

Hi Bernad,

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

sincerely yours

Davis