Skip to main content
Solved

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

  • October 25, 2021
  • 1 reply
  • 492 views

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

Thanks in advance

Jannis

Best answer by David.Nguyen

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

1 reply

David.Nguyen
Luminary
Forum|alt.badge.img+2
  • Luminary
  • Answer
  • October 25, 2021

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