Last modified: 29 February 2024

Why should I filter on sky coordinates rather than the CCD_ID column?


The "How can I define a region around a single chip?" FAQ describes how the skyfov tool can be used to create region files which bound each ACIS CCD in sky coordinates. What advantage does this have over filtering on the CCD_ID column of an event file?

  1. It allows you to filter files which do not have a CCD_ID column, such as images.

  2. The knowledge of the filter will be stored in the data subspace of the file. This will then be combined with any other filter using sky coordinates to determine the area involved. For instance, if a circle is used to filter an event file and part of the circle extends beyond the chip region, the extraction area will correspond to only that part of the circle that lies within the chip.

    For instance, using the files from the Using skyfov FAQ, we get:

    unix% dmstat "ccd_s3.fits[sky=box(4000,4000,400,400)][bin sky=::1]" centroid- 
    EVENTS_IMAGE
        min:        0             @:        ( 4189 3800 )
        max:        35            @:        ( 4092 4117 )
       mean:        0.14842846466 
      sigma:        0.5175473943
        sum:        18866 
       good:        127105 
       null:        33696 
    

    and

    unix% dmstat acisf00578N002_evt2.fits"[ccd_id=7,sky=box(4000,4000,400,400)][bin sky=::1]" centroid- 
    EVENTS_IMAGE
        min:        0             @:        ( 3800 3800 )
        max:        35            @:        ( 4092 4117 )
       mean:        0.11721320141 
      sigma:        0.46397958373 
        sum:        18848 
       good:        160801 
       null:        0 
    

    This image of ds9 shows the regions used; the green polygon is the ccd region created by skyfov which was used to create the file ccd_s3.fits while the red square shows the region given to dmstat. The first run of dmstat uses only those pixels that lie both within the square and are on the ACIS-S3 chip, whilst the second run uses all pixels that lie within the square, even those that lie outside the chip, which is why the mean level is lower in the second run of dmstat.