Solved

Reading Centroid-X / Centroid-Y for Detectorviewer in ZPL

  • 25 October 2021
  • 1 reply
  • 340 views

Hi All, how can I read the Centroid-X/Centroid-Y value from the Detectorviewer in ZPL?

Thanks in advance

Jannis

icon

Best answer by David.Nguyen 25 October 2021, 18:32

View original

1 reply

Userlevel 7
Badge +2

Hi Jannis,

 

Since you want ZPL to give you a number, you are looking for a Numeric Function, and the numeric function that does this is NSDD(surf, object, pixel, data). Surf should be used for mixed-mode, otherwise it can be left to one. Object is the object number corresponding to the detector. Then, pixel and data should be chosen according to the table in the Help File under The Optimize Tab (non-sequential ui mode) > Automatic Optimization Group (optimize tab, non-sequential) > Merit Function Editor (optimize tab, non-sequential) > NSC Operands. There are multiple centroid definition. One of them, for example, is

Pix#

Data#

Output

-6

0

The x coordinate of the centroid of the flux data

Therefore, if you use pixel = -6, and data = 0, the NSDD numeric function should return the centroid of the flux data. Here’s how it looks on a dummy example.

Let me know if this answers your question, and take care,

 

David

Reply