About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: 26 October 2007
Hardcopy (PDF): A4 | Letter

How can I calculate the centroid of counts in a region?


The centroid is only calculated when the dmstat infile parameter is an image and centroid=yes. If you wish to use an event file as input, add an image binning filter to create an image on-the-fly:

unix% dmstat "acisf01838N001_evt2.fits[sky=circle(4072,4252,36)][bin sky=1]" centroid=yes
EVENTS_IMAGE(x, y)
    min:        0             @:        ( 4072 4216 )
    max:        77            @:        ( 4070 4251 )
cntrd[log] :    ( 34.7667075 35.927113107 )
cntrd[phys]:    ( 4069.7667075 4250.9271131 )
sigma_cntrd:    ( 65.305691356 67.893006882 )
   good:        4053 
   null:        1276 

From top to bottom, the output reports the value and location (in physical coordinates) of the minimum and maximum pixel values, the location of the centroid of the pixel distribution in both logical and physical coordinate systems, the number of valid ("good") pixels, and the number of invalid (i.e. the value equals the Null/NaN value) pixels.

The help file has further details on how these values are calculated.



Hardcopy (PDF): A4 | Letter
Last modified: 26 October 2007


The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.