how to get peak irrandiance from NSC detector through ZPL Macro

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?





Best answer by Berta.Bernad 19 May 2023, 11:45

View original

2 replies

Userlevel 4
Badge +2

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)

Hi Bernad,

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

sincerely yours