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

Skip the navigation links
Last modified: 1 Dec 2006
Hardcopy (PDF): A4 | Letter

Correcting a Misplaced Zero-order Source Position

[CIAO 3.4 Science Threads]



Overview

Last Update: 1 Dec 2006 - updated for CIAO 3.4: change to wording of tgdetect/dmcopy warning

Synopsis:

When tgdetect is run as a stand-alone tool with the zero order filter position set to the default value as in the "Obtain Grating Spectra" threads, the tool uses hard-wired numbers to locate the center of the box for searching zero-order sources; see Get Started for the values. If the source is outside of the default search area, the tool will not locate it, regardless of how prominent it is.

Purpose:

To run tgdetect with a specific zero order filter position to identify the correct zero-order source position.

Read this thread if:

you are working with ACIS or HRC grating data and think that the zero-order source may be misidentified, as shown in the Display the Source List section.

Related Links:

Proceed to the HTML or hardcopy (PDF: A4 | letter) version of the thread.




Contents



Get Started

Sample ObsID used: 1703 (LETG/ACIS-S, PKS 2155-304)

File types needed: evt1; asol1

When tgdetect is run in the grating level 1.5 pipeline, it uses the observer-specified target coordinates from the file header to locate the center of box for searching zero-order sources.

However, if tgdetect is run as a stand-alone tool with zo_pos_x and zo_pos_y set to the default value (e.g. in the "Obtain Grating Spectra" threads), the tool uses hard-wired numbers to locate the center of the box for searching zero-order sources. For ACIS, the hard-wired center is (4096.5, 4096.5); for HRC-S it is (32768.5, 32768.5); for HRC-I it is (16384.5,16384.5). If the source is outside of the default search area (400 square pixels for ACIS, 1800 square pixels for HRC),the tool will not locate it, regardless of how prominent it is.

It is assumed that tgdetect has been run once already and therefore a source list called acis_src1a.fits exists.

This source list was not obtained from the Archive. The parameter file of the tgdetect run used to create it is available here, and the file may be downloaded (<SHIFT>-click to save).



Display the Source List

The source list may be viewed over the event file using ds9:

unix% ds9 acisf01703_000N002_evt1.fits &

Overlay the region file that was created by the first run of tgdetect (Region-> Load Regions-> acis_src1a.fits[SRCLIST]) and you should see something like Figure 1 [Link to Image 1: Incorrect source list overlaid on image]. Clearly the tool has not identified the prominent zero-order source.



Get Target Coordinates (dmkeypar)

The next step is to determine where the observer specified the source to be. This information is contained in the RA_TARG and DEC_TARG header keywords of the event file:

unix% dmkeypar acisf01703_000N002_evt1.fits RA_TARG echo+
329.716667

unix% dmkeypar acisf01703_000N002_evt1.fits DEC_TARG echo+
-30.225556

These are the celestial coordinates of the object in degrees; this is important to note for the next step.



Convert Position to Sky Coordinates (dmcoords)

Since tgdetect requires the search values to be in sky coordinates, we need to use dmcoords to convert the values. Here it is run in interactive mode after setting the celestial coordinate format to degrees:

unix% punlearn dmcoords
unix% pset dmcoords asolfile="pcadf076126900N002_asol1.fits,pcadf076142989N002_asol1.fits"
unix% pset dmcoords celfmt=deg
unix% dmcoords acisf01703_000N002_evt1.fits
dmcoords>: cel 329.716667 -30.225556
(RA,Dec):     21:58:52.000    -30:13:32.00   
(RA,Dec):      329.71667      -30.22556 deg
THETA,PHI          1.855'         14.77 deg
(Logical):        4124.07       3871.97
SKY(X,Y):         4124.07       3871.97
DETX,DETY         4315.24       4154.17
CHIP ACIS-S3       438.51        129.94
TDET              4355.51       1831.94
GDPX,GDPY        32768.50      16384.50
GAC R,D            0.00          0.00
ENERGY 1.000000
ZO(RA,Dec):     21:58:52.000    -30:13:32.00   
ZO(RA,Dec):      329.71667      -30.22556 deg
ZO SKY(X,Y):         4124.07       3871.97
ZO DETX,DETY         4315.24       4154.17
dmcoords>: q

The position in sky pixels is (4124.07, 3871.97).



Run tgdetect Again

Now we can tell tgdetect to center the search filter at these coordinates and run the tool again:

unix% pset tgdetect infile=acisf01703_000N002_evt1.fits
unix% pset tgdetect zo_pos_x=4124.07
unix% pset tgdetect zo_pos_y=3871.97
unix% pset tgdetect outfile=acis_target_src1a.fits
unix% tgdetect
Input L1 event file (root_evt1.fits or .lis) (acisf01703_000N002_evt1.fits): 
Input source position(s) file from previous OBI or NONE (NONE): 
Output source position(s) file name (acis_target_src1a.fits): 

# DMCOPY (CIAO 3.4): Bad data type in filter string formatting

The warning may be ignored; it is due to a minor bug in the Data Model and does not affect the output of tgdetect.

The contents of the parameter file may be checked using plist tgdetect.

Displaying the new source list:

unix% ds9 acisf01703_000N002_evt1.fits &

Region-> Load Regions-> acis_target_src1a.fits[SRCLIST]
shows that tgdetect now picks up the correct zero-order source [Link to Image 2: Correct source list overlaid on image] (this image is displayed at Zoom -> 4 to make the region more visible).




Summary

This thread is now complete. You can continue with the grating analysis from the "Get region mask (tg_create_mask)" step of the HETG/ACIS-S, LETG/ACIS-S, LETG/HRC-S, or LETG/HRC-I grating spectra thread.




Parameters for /home/username/cxcds_param/tgdetect.par


##
## TGDETECT -- Create filter; run celldetect; narrow down detected
##             'zero order' source list; set source id's; match 
##             sources to previous OBI source list.
##
## Note: if either "infile" or "OBI_srclist_file" are @lists, only
## the first item on the list is read in;  this tool only works on
## one set of input files;  if more than one file is listed, 
## everything but the first are ignored.
##
        infile = acisf01703_000N002_evt1.fits   Input L1 event file (root_evt1.fits or .lis)
OBI_srclist_file = NONE             Input source position(s) file from previous OBI or NONE
       outfile = acis_src1a.fits  Output source position(s) file name (root_src1a.fits)
#
#   output file naming
#
     (temproot = )                Path and root file name to be given to temporary files
     (keeptemp = no)              Keep temporary files?
     (keepexit = no)              Keep exit status file?
#
#
#
     (zo_pos_x = default)         Center GZO filter sky X position (default=pixel(ra_nom))
     (zo_pos_y = default)         Center GZO filter sky Y position (default=pixel(dec_nom))
 (zo_sz_filt_x = default)         Size of GZO filter in X pixels (ACIS=400; HRC=1800)
 (zo_sz_filt_y = default)         Size of GZO filter in Y pixels (ACIS=400; HRC=1800)
   (snr_thresh = 40)              SNR threshold to select the detected sources
# 
#   celldetect parameters
#
       (expstk = none)            list of exposure map files
       (thresh = )celldetect.thresh -> 3) celldetect source threshold
     (ellsigma = 3.0)             Size of output source ellipses (in sigmas)
     (expratio = 0)               cutoff ratio for source cell exposure variation
    (findpeaks = yes)             find local peaks for celldetect
(celldetect_log = )celldetect.log -> no) make a celldetect log file?
     (psftable = )celldetect.psftable -> /soft/ciao/data/psfsize_20000830.fits) table of PSF size data, for celldetect
    (fixedcell = 15)              celldetect fixed cell size to use
(fixedcell_cc_mode = 15)              celldetect fixed cell size to use for CC mode ACIS data
      (bkgfile = none)            background file, for celldetect
     (bkgvalue = )celldetect.bkgvalue -> 0) background count/pixel, for celldetect
  (bkgerrvalue = )celldetect.bkgerrvalue -> 0) background error, for celldetect
        (eband = )celldetect.eband -> 1.4967) energy band, for celldetect
      (eenergy = )celldetect.eenergy -> 0.8) encircled energy of PSF, for celldetect
      (snrfile = none)            celldetect snr output file (for convolution only)
     (convolve = )celldetect.convolve -> no) use convolutions for celldetect
      (xoffset = INDEF)           celldetect offset of x axis from optical axis
      (yoffset = INDEF)           celldetect offset of y axis from optical axis
     (cellfile = none)            output cell size image file
     (centroid = yes)             compute source centroids in celldetection?
#
#   tgidselectsrc parameters
#
(snr_ratio_limit = )tgidselectsrc.snr_ratio_limit -> 1) Value of SNR ratio to use as lower limit
     (setsrcid = )tgidselectsrc.setsrcid -> yes) Set src ids in output file?
#
#   tgmatchsrc parameters
#
(max_separation = )tgmatchsrc.max_separation -> 3) Maximum allowed separation (arcsec) for sources to match
#
#
      (clobber = yes)             OK to overwrite existing output file(s)?
      (verbose = 0)               Verbosity level (0 = no display)
         (mode = ql)
    


Parameters for /home/username/cxcds_param/tgdetect.par


##
## TGDETECT -- Create filter; run celldetect; narrow down detected
##             'zero order' source list; set source id's; match 
##             sources to previous OBI source list.
##
## Note: if either "infile" or "OBI_srclist_file" are @lists, only
## the first item on the list is read in;  this tool only works on
## one set of input files;  if more than one file is listed, 
## everything but the first are ignored.
##
        infile = acisf01703_000N002_evt1.fits   Input L1 event file (root_evt1.fits or .lis)
OBI_srclist_file = NONE             Input source position(s) file from previous OBI or NONE
       outfile = acis_target_src1a.fits Output source position(s) file name (root_src1a.fits)
#
#   output file naming
#
     (temproot = )                Path and root file name to be given to temporary files
     (keeptemp = no)              Keep temporary files?
     (keepexit = no)              Keep exit status file?
#
#
#
     (zo_pos_x = 4124.07)         Center GZO filter sky X position (default=pixel(ra_nom))
     (zo_pos_y = 3871.97)         Center GZO filter sky Y position (default=pixel(dec_nom))
 (zo_sz_filt_x = default)         Size of GZO filter in X pixels (ACIS=400; HRC=1800)
 (zo_sz_filt_y = default)         Size of GZO filter in Y pixels (ACIS=400; HRC=1800)
   (snr_thresh = 40)              SNR threshold to select the detected sources
# 
#   celldetect parameters
#
       (expstk = none)            list of exposure map files
       (thresh = )celldetect.thresh -> 3) celldetect source threshold
     (ellsigma = 3.0)             Size of output source ellipses (in sigmas)
     (expratio = 0)               cutoff ratio for source cell exposure variation
    (findpeaks = yes)             find local peaks for celldetect
(celldetect_log = )celldetect.log -> no) make a celldetect log file?
     (psftable = )celldetect.psftable -> /soft/ciao/data/psfsize_20000830.fits) table of PSF size data, for celldetect
    (fixedcell = 15)              celldetect fixed cell size to use
(fixedcell_cc_mode = 15)              celldetect fixed cell size to use for CC mode ACIS data
      (bkgfile = none)            background file, for celldetect
     (bkgvalue = )celldetect.bkgvalue -> 0) background count/pixel, for celldetect
  (bkgerrvalue = )celldetect.bkgerrvalue -> 0) background error, for celldetect
        (eband = )celldetect.eband -> 1.4967) energy band, for celldetect
      (eenergy = )celldetect.eenergy -> 0.8) encircled energy of PSF, for celldetect
      (snrfile = none)            celldetect snr output file (for convolution only)
     (convolve = )celldetect.convolve -> no) use convolutions for celldetect
      (xoffset = INDEF)           celldetect offset of x axis from optical axis
      (yoffset = INDEF)           celldetect offset of y axis from optical axis
     (cellfile = none)            output cell size image file
     (centroid = yes)             compute source centroids in celldetection?
#
#   tgidselectsrc parameters
#
(snr_ratio_limit = )tgidselectsrc.snr_ratio_limit -> 1) Value of SNR ratio to use as lower limit
     (setsrcid = )tgidselectsrc.setsrcid -> yes) Set src ids in output file?
#
#   tgmatchsrc parameters
#
(max_separation = )tgmatchsrc.max_separation -> 3) Maximum allowed separation (arcsec) for sources to match
#
#
      (clobber = yes)             OK to overwrite existing output file(s)?
      (verbose = 0)               Verbosity level (0 = no display)
         (mode = ql)
    

History

16 Dec 2004 updated for CIAO 3.2: new parameters for temporary and diagnostic files; include dmcoords asolfile parameter
05 Dec 2005 updated for CIAO 3.3: parameter file change (kernel parameter removed from tgdetect)
29 Mar 2006 renamed thread from "Correct Zero-order Source Position"
01 Dec 2006 updated for CIAO 3.4: change to wording of tgdetect/dmcopy warning

Return to Threads Page: Top | All | Grating
Hardcopy (PDF): A4 | Letter
Last modified: 1 Dec 2006


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.