Last modified: July 2026

URL: https://cxc.cfa.harvard.edu/ciao/ahelp/crisscross.html
AHELP for CIAO 4.18

crisscross

Context: Tools::Composite

Synopsis

Analysis tool for Chandra-HETG observations with multiple bright sources in a field of view.

Syntax

crisscross  infile outdir main_list subset_src_list [single_src_pos]
[single_src_root] [wavdetect_file] [conf_table_level] [arf_ratios_dir]
[max_pntsrc_dist] [min_pntsrc_counts] [min_spec_counts]
[min_spec_confuser_counts] [osip_frac] [spec_confuse_limit]
[max_arm_dist] [arm_nsig] [arm_confuse_limit] [min_arm_counts]
[meg_cutoff_low] [meg_cutoff_high] [heg_cutoff_low] [meg_cutoff_low]
[highest_order] [min_tg_d] [max_tg_d] [clobber] [verbose]

Description

CrissCross and its helper tool clean_spec allow users to analyze Chandra High Energy Transmission Grating (HETG) spectra that are extracted from a field of view with multiple astrophysical X-ray sources. The HETG instrument will disperse events onto the ACIS CCDs from all sources in a field of view. If there are several sufficiently-bright X-ray sources then there is a potential for 'confusion' to occur. Confusion is a term used here for special scenarios where standard HETG spectral extraction of a source may erroneously assign events (counts) from a different astrophysical source in the field of view to the extracted spectrum. This can result in events from an unrelated astrophysical source 'confusing' the spectrum of an extracted source.

CrissCross is used to identify when spectral confusion occurs for a list of input sources (or a single source) and generates 'confusion tables' which identify the wavelength in each source's spectrum that are likely to include X-ray events from other sources in the field. The user can then choose to remove all events from the source spectrum in the wavelength range where this confusion occurs. The CrissCross helper program clean_spec uses the CrissCross output confusion tables and input HETG PHA spectra to generate 'cleaned' spectra (and ARFs) where these events are removed. CrissCross is especially useful for crowded X-ray fields with multiple observations such as stellar clusters.

Try the jupyter notebook tutorial!

Users are encouraged to try CrissCross and clean_spec using the jupyter notebook tutorial. It provides two end-to-end examples of running CrissCross on HETG observations of a crowded stellar cluster and extracting a cleaned spectrum. As shown in the tutorial, Sherpa provides a useful interface for checking the results of the confusion assessment by viewing HETG spectra before and after cleaning.

How does CrissCross work?

The CrissCross routine (crisscross) takes advantage of the characteristic 'X' shape the Chandra-HETG instrument makes when dispersing X-ray light onto the ACIS-S CCDs. For each source, the center of this 'X' is located at the position of the (non-dispersed zeroth-order) X-ray source in the field of view. While technically all X-ray sources cast their own X shape, most sources are too faint to disperse enough events onto the detector for high-resolution X-ray spectroscopy purposes. As a result, only the brightest X-ray sources will produce this X shape visible by eye in an HETG event file. If there are two or more bright sources in the same field of view then their respective X shapes likely intersect with each other somewhere on the detector. In other words, if one were to extract HETG spectra from each of these sources using only standard CIAO tools, there are locations (wavelength ranges) in each spectrum that could contain events from other sources. Throughout this documentation, this scenario is referred to as 'confusion'. Confusion occurs when events from another source end up in the spectrum of a source of interest during extraction.

HETG-ACIS already has a mechanism to handle some level of this confusion. Energy/wavelength as a function of distance from the center of the HETG 'X' shape is known based on the gratings' dispersion equation and the instrumental setup. When the energy of an X-ray event, as measured by the ACIS CCDs, is very different than what is expected at the location in the spectral arm (distance from center of X) then CIAO tools will remove these events automatically using Order Sorting Integrated Probability tables in the CALDB. However, there can be cases where the energy of confusing events from another source matches what is expected from the spectrum of the extracted source based on the dispersion distance from its 0th order. Crisscross is the tool designed to handle these cases. For example, if the user is interested in the HETG spectrum of 'Src A' and there is another source in the field of view called 'Src B'. The crisscross routine handles all four possible types of confusion:

What are the main considerations for running crisscross and clean_spec?

The crisscross tool has a lot of parameters but the vast majority of them can be kept at their default values. Most importantly, crisscross needs a list of potential X-ray sources in the field of view of the observation (parameter 'main_list'). CrissCross ultimately needs to know the number of counts for every 0th order point source in the field of view. For non-HETG observations, this list of coordinates can be obtained with CIAO source-detection programs like wavdetect. However, these detection tools are not designed to work on HETG event files where many events are dispersed by the gratings which can cause a lot of false detections. CrissCross runs wavdetect by default (or alternatively uses an input wavdetect source table) and cross-matches positive source-detections with the main_list to remove the erroneous gratings-identified sources. With knowledge of the point source locations and counts, CrissCross identifies confusion for every source provided in the subset_src_list file (or a single source if parameter single_src_pos is used) and creates a corresponding confusion table.

Users are expected to have already extracted HETG source spectra from the observation of interest using standard grating CIAO tools. It is these sources for which CrissCross will produce confusion tables that can be used with clean_spec to create 'cleaned' spectra free of identified confusion. CrissCross will create confusion tables for every source in the subset_src_list, which is expected to include only the bright HETG sources for which the user has extracted spectra. Note, a source bright enough to obtain quality HETG spectra can also produce confusion for other sources in the field of view. As such, every source in subset_src_list must also include an identical entry in the 'main_list' file.

What is an example workflow for creating cleaned spectra?

A typical end-to-end workflow using CrissCross would look something like this:

The examples below highlight some of the ways crisscross can be used to create confusion tables and cleaned spectra. Chandra observations of the Orion Nebular Cluster, a cluster of X-ray-emitting pre-main sequence stars, are used to demonstrate the utility of crisscross.


Examples

Example 1

unix% download_chandra_obsid 3498
unix% punlearn chandra_repro
unix% chandra_repro 3498
unix% punlearn fluximage
unix% fluximage 3498/repro/acisf03498_repro_evt2.fits binsize=2.0
bands=broad \
outroot=acisf03498 psfecf=0.9 clobber=yes
unix% punlearn wavdetect
unix% wavdetect infile=acisf03498_broad_thresh.img
outfile=source_list.fits \
scellfile=source_cell.fits imagefile=image.fits
defnbkgfile=background.fits \
expfile=acisf03498_broad_thresh.expmap regfile=source_list.reg
expfile=none \
psffile=acisf03498_broad_thresh.psfmap scales='2 4 8' clobber=yes
unix% punlearn dmcopy
unix% dmcopy infile='source_list.fits[cols RA,DEC]' outfile =
all_srcs.fits
unix% dmcopy infile='source_list.fits[cols RA,DEC][NET_COUNTS > 3500]' \
outfile = bright_srcs.fits clobber=yes

This example demonstrates one way to create 'main_list' and 'subset_src_list' input files for crisscross using ACIS imaging-mode (non-HETG) observations. First we reprocess the observation to utilize up-to-date calibration files and then run fluximage and wavdetect to create a table of detected X-ray sources in the Orion Nebula Cluster. Fluximage is a helpful tool prior to running wavdetect because it creates a psfile and an image file used in wavdetect. More information on these tools can be found on their respective CIAO pages. The dmcopy tool is then used to remove the columns unnecessary for crisscross from the output wavdetect table to generate an RA/DEC list of all sources in the field of view (all_srcs.fits) and a list of only the brightest sources (greater than 3500 counts) for which we will later want to extract HETG spectra (bright_srcs.fits). Note that it is not guaranteed that any single obsID represents all potential X-ray sources in a field of view and that some astrophysical sources are variable so if they are 'bright' in one obsID it does not mean they will be bright in all future obsIDs.

Example 2

unix% download_chandra_obsid 3
unix% punlearn chandra_repro
unix% chandra_repro 3
unix% punlearn crisscross
unix% crisscross infile=3/repro/acisf00003_repro_evt2.fits
outdir=cc_outdir main_list=all_srcs.fits \
subset_src_list=bright_srcs.fits verbose=1 clobber=yes mode=a
unix% punlearn clean_spec
unix% clean_spec infile=3/repro/acisf00003_repro_pha2.fits \
conf_file=cc_outdir/output_dir_obsid_3/confusion_output_files/table_fits
_data/confused_src_397_consolidated_obsID_3.fits \
spec_root=tet1oriC

Run crisscross for a single HETG observation (obsID 3) with a list of input sources generated in example 1 above. This will create an output directory 'cc_outdir' that contains two subdirectories: (1) 'confusion_output_files' which contains confusion tables generated for each source in subset_src_list and (2) wavdetect_output_files which contain wavdetect files that were used to estimate the number of 0th order counts for each source in main_list. The clean_spec tool is used with the HETG PHA2 spectral file automatically generated by chandra_repro for the source at the aimpoint (theta1 Ori C) to produce a 'cleaned' spectrum.

Example 3

unix% punlearn chandra_repro
unix% chandra_repro indir=3 outdir=3/custom_hetg_extraction
root=tet1oriE \
tg_zo_position='83.8156671,-5.3861617'
unix% punlearn crisscross
unix% crisscross
infile=3/custom_hetg_extraction/tet1oriE_repro_evt2.fits \
outdir=cc_singlesrc_outdir main_list=all_srcs.fits
single_src_pos='83.8156671,-5.3861617' \
single_src_root='tet1oriE' mode=a
unix% punlearn clean_spec
unix% clean_spec
infile=3/custom_hetg_extraction/tet1oriE_repro_pha2.fits \
conf_file=cc_singlesrc_outdir/output_dir_obsid_3/confusion_output_files/
table_fits_data/confused_tet1oriE_consolidated_obsID_3.fits \
spec_root=tet1oriE mode=a

Run crisscross to assess confusion for a single source. For this example, we utilize the chandra_repro tg_zo_position parameter which allows users to pick an RA and DEC to extract a specific source's HETG spectra. This runs the standard tg_extract tools and produces PHA files and ARFs and RMFs. The chandra_repro tg_orders parameter can be used to specify more orders than the default +1/-1. Users can assess confusion for a single source by utilizing the single_src_pos parameter. Running crisscross with a single RA and DEC will create a single confusion table for that source as long as it matches a source in the main_list input file. The main_list sources still need to be provided as they are the sources of potential confusion.

Example 4

unix% punlearn stk_build
unix% stk_build infile='obs1_evt2.fits obs2_evt2.fits obs3_evt2.fits' \
outfile=crisscross_evt2_stk.lis
unix% punlearn crisscross
unix% crisscross infile=@crisscross_evt2_stk.lis
outdir=multi_obs_crisscross \
main_list=all_srcs.fits subset_src_list=bright_srcs.fits

The crisscross tool can also be run with multiple obsIDs at once. This is a convenient way to calculate confusion for HETG campaigns that were split into many observations. The above commands will not work verbatim but are meant to demonstrate syntax. Users that don't wish to have crisscross run wavdetect every time can also provide matching wavdetect source files in a stack matching the evt2 syntax above. The evt2 and wavdetect stacks do not have to be in the same order.

Example 5

unix% punlearn crisscross
unix% crisscross infile=3/repro/acisf00003_repro_evt2.fits \
wavdetect_file=custom_wavdetect_file.fits outdir=cc_outdir \
main_list=all_srcs.fits subset_src_list=bright_srcs.fits clobber=yes

For users that wish to run wavdetect with custom parameters, a wavdetect output source fits file can be provided to crisscross. This also saves computation time. The above commands will not work verbatim without creating the appropriate wavdetect file.


Parameters

name type ftype def reqd stacks
infile file input   yes yes
outdir file     yes  
main_list file input   yes  
subset_src_list file input   yes  
single_src_pos string        
single_src_root string        
wavdetect_file file input     yes
conf_table_level string        
arf_ratios_dir string   $ASCDS_CALIB/data    
max_pntsrc_dist real   8    
min_pntsrc_counts real   5    
min_spec_counts real   3    
min_spec_confuser_counts real   50    
osip_frac real   1.0    
spec_confuse_limit real   0.1    
max_arm_dist real   8.0    
arm_nsig real   6.0    
arm_confuse_limit real   0.1    
min_arm_counts real   50    
meg_cutoff_low real   1.0    
meg_cutoff_high real   32.0    
heg_cutoff_low real   1.0    
meg_cutoff_low real   16.0    
highest_order integer   3    
min_tg_d real   -6.6e-4    
max_tg_d real   6.6e-4    
clobber boolean   no    
verbose integer   1    

Detailed Parameter Descriptions

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

The evt2 file(s) of an ACIS-HETG observation.

The primary input to this tool is an event file (or stack of event files) which correspond to the observation(s) that include sources input in main_list and subset_src_list.

If a stack of event files is included then crisscross will run sequentially for each observation.

Parameter=outdir (file required)

Root for the output directory where crisscross output will be saved.

This directory will contain all the output from crisscross which includes the spectral confusion tables for each source in subset_src_list or single_src_pos as well as log files and wavdetect output if it was run.

Parameter=main_list (file required filetype=input)

An ascii/tsv file which includes columns RA, DEC, and ID of all potential X-ray sources in the input evt2 file(s).

Wavdetect must be run on each event file to identify 0th order point sources and obtain an estimate of their counts. This is done automatically if users do not provide a wavdetect_file. When wavdetect is run on an HETG observation, dispersed events from the HEG/MEG arms can be erroneously identified as 'real' sources. The 'main_list' of sources is matched to the wavdetect output and only sources listed in both are treated as real sources and are considered when assessing confusion.

Parameter=subset_src_list (file required filetype=input)

An ascii/tsv file which includes columns RA, DEC of sources for which confusion will be assessed.

This list should contain sources for which HETG spectra will be used for scientific analysis later, so these sources need to be assessed for confusion. Every source in subset_src_list should also be present in main_list since even these sources can cause confusion in other sources. Typically the sources in this list will be relatively bright otherwise the spectra may not be useful. If users wish to only calculate confusion for a single source (single_src_pos) then this field can be left blank.

Parameter=single_src_pos (string)

Assess confusion for only a single HETG source.

Instead of providing a list of relatively-bright HETG sources in subset_src_list, users can provide the RA and DEC in J2000 deg of a single source. The format should be (RA, Dec) in degrees, e.g. '(83.818,-5.389)' . When this parameter is used, single_src_root controls the name of the output file.

Parameter=single_src_root (string)

Root name for output confusion table of single_src_pos.

This root will be included in the name of the output confusion table if crisscross is run with a single source (single_src_pos). If 'None' or empty then the element number of the source matched in the main_list is used in the table name.

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

The wavdetect output source table. If None, CrissCross will create one.

The wavdetect source fits table(s) associated with the evt2 observation. This is the '*src.fits' file output from wavdetect. If no files are included (wavdetect_file=None) then wavdetect will be run during execution of CrissCross for each evt2 file provided.

Wavdetect is run with a set input including binsize=2.0, bands='broad', and psfecf=0.9 and scales='1 2 4 8 16'. These parameters are generally optimized for HETG observations to minimize the number of false (dispersed event) detections. Users may wish to run wavdetect separately from crisscross with different parameters. In that case, users should provide their choice of wavdetect source fits table to 'wavdetect_file'. Otherwise crisscross runs with these default parameters. Running wavdetect may take some time providing wavdect files as input seeps up the tool.

Parameter=conf_table_level (string)

The type of output to be saved to the confusion file for each subset_src_list source. Options are 'confused', 'warn' and 'clean'.

The 'confused' option (default) includes spectral regions with high confidence of confusion. The 'warn' option includes both confused regions and regions where confusion is predicted to occur but below the levels set in the other parameters (typically, that means less than 10% of the counts in a specific spectral region originate from the confusing source). The 'clean' option includes 'confused', 'warn' and regions where there should be no confusion.

Parameter=arf_ratios_dir (string default=$ASCDS_CALIB/data)

Path to ARF ratio fits tables that are necessary to estimate the number of counts expected in the nth order based on the detected 0th order counts.

The default value will use arf ratios tables designed for and dsitributed with CrissCross. It is based on the expected response ratios of an HETG source located at the ACIS-S aimpoint. Based on the number of 0th order counts detected in a particular energy range, this file is used to estimate the number of nth (1,2,3) order events at locations where confusion can occur. If a directory is input it will look for arf ratio tables with a file format and file name matching the default files.

Parameter=max_pntsrc_dist (real default=8)

Maximum distance in ACIS pixels to be considered a potential (0th order) point source confuser.

Field sources whose 0th order position is less than or equal to this distance, measured in ACIS pixels perpendicular from the dispersed spectrum of an extracted source, will be assessed as potential point source confusion.

Parameter=min_pntsrc_counts (real default=5)

0th order counts limit for field source to be assessed as a potential point source confuser.

Field sources with 0th order counts greater than this threshold will be assessed for potential point source confusion. This parameter can be used to save computation time by restricting the number of sources for which confusion is assessed.

Parameter=min_spec_counts (real default=3)

Minimum number of 0th order counts required to calculate confusion for sources in subset_src_list or single_src_pos. This parameter can be used to save computation time by restricting the number of sources for which confusion is assessed.

Minimum number of 0th order counts for a source in subset_src_list or single_src_pos to be considered bright enough to warrant confusion assessment from field sources. This parameter can be used to save computation time by restricting the number of sources for which confusion is assessed.

Parameter=min_spec_confuser_counts (real default=50)

0th order counts limit for field source to be assessed as potential sources of spectral confusion.

Minimum number of 0th order counts for a field source to be considered bright enough to disperse spectra and potentially contaminate the spectrum of source in subset_src_list or single_src_pos.

Parameter=osip_frac (real default=1.0)

Fraction of the OSIP window to use in spectral intersection calculation.

When a confuser source disperses light that intersects with the spectrum of a source in subset_src_list, the confused source's OSIP window at the ACIS-chip intersection location is used to determine the liklihood that events from the confuser source would cause confusion. This parameter represents a fraction from 0 to 1 denoting the portion of an OSIP (Order Sorting Integrated Probability) range to be used in the spectral intersection calculation. 1.0 means 100% of the OSIP window (which is less than 100% of the total flux) is used.

Parameter=spec_confuse_limit (real default=0.1)

Fraction of dispersed counts allowed in a spectral confusion region before flagging as confused.

The fraction of dispersed events allowed in a potential confusion region before deciding the region is confused (and thus later removed with clean_spec). A value of 0.1 means if confuser 'Src B' contributes more than 10% of counts in the confused portion of the spectrum of 'Src A' then the spectral region of Src A is flagged as confused. Note: The number of counts from each source in the affected spectral intersection region (wavelength range) is estimated using the HETG instrument effeciency (ARF) and the number of 0th order counts from each source within the wavelength range and is suspect to Poisson errors for low count rates.

Parameter=max_arm_dist (real default=8.0)

Maximum distance in pixels perpendicular to confused spectra to be considered as a potential arm confuser.

Two bright sources whose 0th order distance, measured in ACIS pixels perpendicular from one source to the dispersed spectrum of an extracted source, is less than this will be considered as potential arm confusion. Users can increase this parameter if they believe spectra are unfairly being flagged as arm confused. An on-axis source spectrum has a width of approximately 5 pixels so if two on-axis sources are within 10 pixels then it is possible they can cause confusion in each other's spectra.

Parameter=arm_nsig (real default=6.0)

Approx for OSIP range for arm confusion. Higher values will ignore more of spectrum for arm confusion.

Approximation for how wide the OSIP range is for order sorting when determining which events are part of the Nth order spectrum. This parameter is for arm confusion only and increasing it will cause larger portions of a spectrum to be considered confused by arm confusion. Users should consider increasing this value up to ~10 if arm confusion appears to be missed with lower values.

Parameter=arm_confuse_limit (real default=0.1)

Fraction of events allowed in arm confusion regions before flagging as confusion.

This fraction is based on 0th order counts ratio of each arm-confusion pair. For example, if the position and minimum brightness of two sources are sufficient to cause arm confusion with each other, this ratio allows some confusion in the subset_src_list spectrum without flagging it as confused. Arm confusion can result in the flagging of significant portions of extracted spectra so users may wish to tolerate some fraction of erroneous events.

Parameter=min_arm_counts (real default=50)

Min number of 0th order counts before a field source is considered a potential source of arm confusion.

While it depends on the spectrum, if a 0th order source has 50 counts then there are only approximately (1.3 * 50) = 65 dispersed counts in the sum of all arms (HEG/MEG) and orders. This parameter can be increased if the arm confusion flagging is too aggressive for the particular field and anticipated source spectra.

Parameter=meg_cutoff_low (real default=1.0)

MEG wavelength lower boundary in Angstroms for all confusion calculations. Confusion is not assessed outside bounds.

Parameter=meg_cutoff_high (real default=32.0)

MEG wavelength upper boundary in Angstroms for all confusion calculations. Confusion is not assessed outside bounds.

Parameter=heg_cutoff_low (real default=1.0)

HEG wavelength lower boundary in Angstroms for all confusion calculations. Confusion is not assessed outside bounds.

Parameter=meg_cutoff_low (real default=16.0)

HEG wavelength upper boundary in Angstroms for all confusion calculations. Confusion is not assessed outside bounds.

Parameter=highest_order (integer default=3)

Determines which orders are included in the confusion calculations. '3' includes orders -3, -2, -1, +1, +2, +3.

The highest order of the HETG spectra to consider for confusion. Default is 3 which means orders -3, -2, -1, 1, 2, and 3 are included in the confusion calculations.

Parameter=min_tg_d (real default=-6.6e-4)

Lower bound of spectral extraction in cross-dispersion direction in degrees.

This parameter should be set to the value used in `tg_extract` and defaults to the default used in `tg_extract`. Crisscross assumes rectangular extraction regions.

Parameter=max_tg_d (real default=6.6e-4)

Upper bound of spectral extraction in cross-dispersion direction in degrees.

This parameters should be set to the value used in `tg_extract` and defaults to the default used in `tg_extract`. Crisscross assumes rectangular extraction regions.

Parameter=clobber (boolean default=no)

Specifies if an existing output file should be overwritten.

Parameter=verbose (integer default=1)

Specifies the level of verbosity (0-5) in displaying diagnostic messages.


About Contributed Software

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 this page for installation instructions - such as how to ensure that the parameter file is available.


Bugs

See the bug pages on the CIAO website for an up-to-date listing of known bugs.

Refer to the CIAO bug pages for an up-to-date listing of known issues.

See Also

calibration
ardlib
psf
psf
tools::aspect
asphist, dither_region
tools::background
acis_bkgrnd_lookup, hrc_bkgrnd_lookup, readout_bkg
tools::composite
combine_grating_spectra, combine_spectra, specextract
tools::coordinates
sky2tdet
tools::core
dmextract
tools::response
acis_fef_lookup, acis_set_ardlib, addresp, dmarfadd, eff2evt, find_mono_energy, fullgarf, make_instmap_weights, mean_energy_map, mkacisrmf, mkarf, mkexpmap, mkgarf, mkgrmf, mkinstmap, mkosip, mkpsfmap, mkrmf, mkrprm, mkwarf, psf_project_ray, rmfimg
tools::statistics
aprates