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

Skip the navigation links
Last modified: February 2007

URL: http://cxc.harvard.edu/ciao3.4/merge_all.html
Hardcopy (PDF): A4 | Letter
AHELP for CIAO 3.4 merge_all Context: tools

Synopsis

Combine any number of observations. If desired, create corresponding exposure maps and exposure-corrected images.

Syntax

merge_all evtfile [asol] [dtffile] chip [refcoord] [xygrid] [energy]
[merged] [expmap] [expcorr] [intdir] [clobber] [mode]

Description

This script takes a list of level=2 event files, reprojects them to a given RA and Dec, and combines them. It can then make a combined exposure map and an exposure-corrected image. If only one event file is input, it is treated as a merged event file. One may first use the script to create a merged file and then run it a second time using this merged file as input, omitting the parameters "refcoord" and "merged".

Note that the script may be used to simply combine a set of two or more level=2 event files. In this case, the only parameters which are needed are "evtfile", "chip", "refcoord", and "merged".

If a combined aspect histogram exists from a previous run, and it is in the "intdir" and retains its original name, the script will use this instead of creating a new one.

Using datamodel filters:

It is possible to provide an energy filter. However, region filters are not supported: this is because the "xygrid" is the region filter for the exposure map, and the image size and shape must match that of the exposure map. Filters (to remove sources, etc.) can be applied to the event file prior to running the script, if desired.

Using HRC data:

The script may be used to combine HRC observations (S- or I-array), but it can only make exposure maps and exposure-corrected images for the HRC-I configuration.

Caveats:

Merged files are, in general, not suitable for spectral analysis. The exposure map and exposure corrected image do not contain statistical errors, and therefore cannot be used to obtain meaningful values for source fluxes.

Example 1

merge_all evtfile=@events.lis chip="0:3" refcoord="42.4356 -20.6754"
merged=combined.fits

Combine a stack of input level=2 event files. The output level=2 event file will be reprojected to the coordinates 42.4356, -20.6754, and will contain data for ACIS-I (ccd_id 0 through 3).

Example 2

merge_all evtfile="data1.fits,data2.fits,data3.fits" asol=@asol.lis
chip="0,1,2,3,6,7" refcoord=data3.fits
xygrid="3056.5:4056.5:#1000,3024.5:4044.5:#1020" energy=spectrum.dat
merged=data123.fits expmap=expmap123.fits expcorr=expcorr123.fits

Combine three level=2 event files using a time-sorted stack of asol files. Reproject the data to match the tangent point in data3.fits. Create a full-resolution exposure map as well as an exposure-corrected image of a portion of the data using a spectral weights file.

Example 3

merge_all evtfile=hrcdata.fits asol=pcad_asol.fits
dtffile=hrc_dtf1.fits chip=hrc-i xygrid="1:16384:#128,1:16384:#128"
energy=1 expmap=hrc_expmp.fits expcorr=hrc_expcorr.fits intdir=.

Make an exposure map and exposure-corrected image for a single HRC-I observation. Write temporary files to the current directory.

Parameters

name type ftype def units reqd stacks
evtfile file input     yes yes
asol file input       yes
dtffile file input       yes
chip string       yes  
refcoord string input        
xygrid string          
energy string input   keV    
merged file output        
expmap file output        
expcorr file output        
intdir string   /tmp      
clobber boolean   no      

Detailed Parameter Descriptions

Parameter=evtfile (file required filetype=input stacks=yes)

Input level 2 file(s)

Comma-separated list or file stack of input level=2 event files. Region filters should not be used. Can use a merged file made from a previous run of the script.

Parameter=asol (file filetype=input stacks=yes)

Input aspect solution file(s)

Comma-separated list or file stack of aspect solution (asol) files. These are only required if you are creating an exposure map.

The script assumes that the aspect files are arranged in chronological order. If you have not altered the original filenames, a simple "ls" will put them in order, as the time is listed in the filename.

Parameter=dtffile (file filetype=input stacks=yes)

Input DTF files

SComma-separated list or file stack of DTF file name(s). Only necessary when creating an exposure map for HRC-I observations.

Parameter=chip (string required)

ACIS CCD numbers or "HRC-I" or "HRC-S"

Either ccd_id(s) for the ACIS CCDs you want or "HRC-I" or "HRC-S". If entering ccd_ids, can use either a range (seperated by ":" or "-") or a comma-separated list.

Parameter=refcoord (string filetype=input)

Tangent point to which data is reprojected

Either "RA Dec" or an level=2 event file to which the tangent point of observations will be reprojected. Do not need for single observations or if using an already-merged file.

Parameter=xygrid (string)

Input grid specification

Input grid for creating the exposure map and exposure-corrected image; should be of the same form expected by the tool mkexpmap: "xmin:xmax:#(no. of x bins),ymin:ymax:#(no. of y bins)"; for example, "0.5:8192.5:#1024,0.5:8192.5:#1024". Do not need if only using the script to merge data.

Parameter=energy (string filetype=input units=keV)

Energy value or spectral weights file for mkinstmap

Either an energy value (in keV) or a normalized spectral weights file. This will be used to calculate the instrument map, see "ahelp mkinstmap" for details on the format of the spectral weights file.

The script uses a decimal test to see if the value is a number or a file, so spectral weight filenames cannot consist entirely of numbers; "2" is not a valid filename, but "2.wgt" is.

Parameter=merged (file filetype=output)

Output merged event file name

Not required if inputting an already-merged file or single level=2 event file.

Parameter=expmap (file filetype=output)

Output exposure map

Not required if only merging data.

Parameter=expcorr (file filetype=output)

Output exposure corrected image.

Leave blank if output is not desired.

Parameter=intdir (string default=/tmp)

Directory for intermediate products

Directory where intermediate products are placed - default is /tmp, and intermediate products are deleted from /tmp when the script finishes. If the tmpdir is set to anything other than /tmp, the intermediate data products are not deleted by merge_all.

Parameter=clobber (boolean default=no)

Overwrite output files if they already exist?

CHANGES IN MERGE_ALL 3.5

There are several improvements in version 3.5 of merge_all:

  • Bug fix: Temporary filenames have a timestamp value as the root, rather than hardwired names. This means that multiple instances of merge_all may be run without conflict, as long as the appropriate PFILES environment variables are set.
  • The script tests whether the "energy" value is monochromatic or a spectrum file, and exits early if the spectrum file does not exist. The script uses a decimal test to see if the value is a number or a file, so spectral weight filenames cannot consist entirely of numbers; "2" is not a valid filename, but "2.wgt" is.
  • Error messages now contain the name of the script.

CHANGES IN CIAO 3.4/MERGE_ALL 3.4

New mkinstmap Parameters

Two new hidden parameters have been added to mkinstmap - a tool called by merge_all - to allow the ACIS dead area correction to be taken into account: "pbkfile" and "dafile".

UPDATED in February 2007: Since merge_all runs mkinstmap with a merged event file, it IS NOT appropriate to try to apply the ACIS dead area correction while running this script. Users who wish to apply this calibration should use the step-by-step exposure maps threads, online at http://cxc.harvard.edu/ciao/threads/imag.html.

merge_all Parameter Prompting

The script has also been updated to not prompt the user for parameters that have been supplied on the command line.

CHANGES IN CIAO 3.3

The syntax of the asphist tool was updated for this release: the GTI filter is attached to the event file instead of the aspect solution file(s). For a detailed explanation of the syntax change, refer to the asphist help file ("ahelp asphist").

NOTES

This script is not an official part of the CIAO release but is made available as "contributed" software via the CIAO scripts page. Please see the installation instructions page for help on installing the package.

Bugs

See the bugs page for this script on the CIAO website for an up-to-date listing of known bugs.

Hardcopy (PDF): A4 | Letter
Last modified: February 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.