Scripts and Modules
Provides command-line access to the
Chandra Footprint service
allowing users to find—and optionally
download—publicly-available Chandra data by position
or object name
Provides easy command-line downloads of public Chandra
Retrieve source properties and associated data products
for a single position and radius from the Chandra Source Catalog
*EXPERIMENTAL* Downloads only the subset of Calibration
Database (CalDB) files required to analyze one
observation at a time. As additional observations are
processed, the CalDB will grow incrementally as new
files are accrued.
Data reprocessing script that runs all the recommended
analysis threads for a given set of observations.
Find the ACIS "blank-sky" datasets in the CALDB
matching your observation
Find the HRC-I background event and spectrum files in the CALDB
matching your observation
Tailor an unscaled blanksky background file compatible
with a given observed events file that combines and
reprojects the necessary background files from the CalDB.
The background scaling factors for each chip are
calculated and stored in the file header.
Create a scaled background events file by using the scale
factor calculated by and sampling the blanksky background
file generated by the blanksky
script for an observation; may also be used to
"fill in the hole" with events.
Run either lc_clean
or lc_sigma_clip from the
command line to filter flares from a lightcurve. These
lightcurve routines are provided by the
Check the header of the input file and add the parameter
block and/or SIM-related keywords introduced in the latest
Automates the steps necessary to separate multi-ObI and
interleaved-mode observations into individual directories
compatible with chandra_repro
multi-ObI grating observations, the REGION
is attached to the level 2 event file.
Create an on-screen summary of the status bits in an event
file to show the number of rows with each bit set and
what the bit means.
For ACIS observations only. Synchronizes the
input GTIs to the ACIS exposure boundaries. For most
users, this is a tiny fraction of the total exposure time;
however, if the observation has many GTIs then the
accumulated error can be significant.
Create a single mutli-chip GTI from individual GTIs.
Create light curves from the aspect camera optical monitor data.
Corrects for small (~0.1″) alignment drifts over
the course of recent, long (>50 ks) observations of
bright, on-axis (<2′) point sources with minimal
Create exposure-corrected images and exposure maps for an
Combine an arbitrary number of ObsIDs to create exposure
maps and exposure-corrected images. These scripts replace the
deprecated merge_all script.
Create source and background PHA or PI spectra and the
associated unweighted or weighted ARF and RMF files for
point and extended sources
Sums multiple imaging source PHA spectra, and (optionally)
the associated background PHA spectra and source and
background ARF files
Compute various estimates of the net source flux, given an
event file and a location.
Compute upper-limits for the detection of a source using
data obtained from backgroun apertures in event lists,
images, and exposure maps.
Extract encircled counts fraction profile, as a function
of distance, for a circular region around a source position.
Creates an image of an event file using the limits from
the FOV file.
Model the Out of Time (OOT) contribution of bright and
extended sources to the ACIS background. The OOT events
are detected during the ~0.04s it takes to transfer each
exposure into the readout array during which source events
are detected at a random CHIPY location.
Create scaled background and background-subtracted images given an
observation-specific blanksky background file and a reference
A number of scripts for grating data analysis
which use ISIS, the
Interactive Spectral Interpretation System, are available
S-Lang Packages webpage. Note that ISIS is not
packaged with CIAO; users have to download and install it
Combine Chandra gratings PHA files and their associated
response files. Replaces add_grating_orders
Create a grating ARF for a particular order
Create PHA background file for use in XSPEC
Create the ARF and RMF files for each grating-order and
arm for Type II PHA file outputted by
or the specified Type I
Split a Type II grating PHA file into several Type I files
Create custom region extraction masks for tgextract2
Corrects the time-dependent tilt by adjusting
the TG_D value of events from HRC-S/LETG
observations by applying a linear correction as a function
Removes small "wiggles" and straighten the dispersed
HRC-S/LETG spectrum by correcting the TG_D value
of events which cannot be corrected by the HRC-S degapping
procedure in reprocessing.
Adjusts the TG_D values of all HRC-S/LETG events
to make the cross-dispersion profiles more symmetric
about TG_D=0 so that EEFRAC values will be
accurate even when using narrower-than-standard spectral
Create a source spectrum for which you would like a PSF to
be simulated; the spectrum is used as input to
Create a circular region that encloses the specified
fraction of the PSF at specified energy.
Determine the PSF fraction a circular region encloses at a
An interface to simplify running MARX for both raytrace
PSF simulations or projecting ChaRT/SAOTrace rayfiles to the
detector-plane for an existing observation.
Create a source region file from a simulated monochromatic PSF that is created with MARX.
Create an annular background region with a fixed number of
counts based on the ECF-derived PSF size at a specified location.
Clear (set to 0) ACIS status bits before reprocessing with
Estimate the actual energy range for an ACIS observation.
Find the FITS Embedded Function file for use by mkrmf
Update ardlib.par files to find bad pixel lists
A tool to test the installation of the CIAO Calibration
A tool to test the installation of the CIAO and the Calibration
Generate a color-color diagram by computing hardness
ratios from simulated spectra folded through a user-provided ARF.
Experimental: compile an XSpec user-model for use in Sherpa.
Experimental: convert a XSpec (xcm) save file to
a file that can be used in Sherpa or a Python program. It
is intended to simplify checking out fits from XSec in
Sherpa, but is not guaranteed to create exactly the same
results due to differences in how XSpec and Sherpa work.
Calculates the sky limits (i.e. bounding box) for all the
chips in a Chandra FOV file.
Find the required binning to match two images.
Determine the approximate dither period and amplitude used during an observation.
A script for splitting the source and background
regions created by the roi tool.
Take a stack of roi output files
and assign the overlapping area to "the best" source.
Users can choose which metric to use to determine the
source ranking: most counts, largest area, etc.
Compute simple statistics for events in each map region.
This script is used in dax
convert from DS9 regions to CIAO format. This may be
useful for other users, but please be aware that
interpreting a DS9 region file can be a surprisingly
Convert a region stored in physical coordinates, including
FITS region files, into DS9-format regions in celestial
coordinates. This can be especially useful when using
with multiple observations
which requires that user supplied regions be specified in
Automates the standard steps necessary to download, build,
and install the latest version of MARX. MARX can be used
to simulate Chandra observations and can used with ChaRT
to simulate the Chandra PSF.
Python modules must be imported into an interpreter - such
or IPython - in order to use the functions. For example:
sherpa> from lightcurves import *
The ciao_contrib module loads in all the routines from the
The available modules include:
module for running CIAO tools as if they were Python functions;
module for smoothing 2D data (gaussian, top hat, box car, and using
a kernel read from a file or an image);
module for converting between CIAO stacks
and Python arrays;
module for access to version information of the installed CALDB;
the ciao_contrib.psf_contrib module adds
the PSF class and the psfFrac() and psfSize()
functions to simplify the use of the CIAO psf module.
and the ciao_contrib.cda.search and ciao_contrib.cda.data
modules for searching and accessing publically-available data from
the Chandra Data Archive.
Python class supports stacks of field-of-view (FOV)
files that can be queried to see which ObsIDs include a
given celestial position.
The lightcurves module contains two
routines for identifying flares in lightcurves:
lc_clean: clean a lightcurve to match the ACIS
an alternative algorithm for cleaning
lightcurves that uses sigma clipping to reject outliers.
Provides save_chart_spectrum, plot_chart_spectrum,
and get_chart_spectrum which are used when using Sherpa to
generate model spectra for ChaRT/SAOTrace. They are similar to the
routines provided by sherpa_contrib.marx.
Provides save_marx_spectrum, plot_marx_spectrum,
and get_marx_spectrum which are used when using Sherpa to
generate model spectra for MARX. They are similar to the
routines provided by sherpa_contrib.chart.
Allows users to
create radial (or elliptical) profiles of 2D imaging data,
including model fits, from within
Sherpa to allow users to visually inspect the quality of
Load compiled XSpec user-model with Python lmod function.
Provides routines for converting between sexadecial
format and decimal degrees, including
A collection of routines for spherical and cartesian coordinate
systems, based on the code from the
The TGPixlib Python introduced to help convert
from sky coordinates to grating coordinates: dispersion
angles and energy.
This section describes a number of scripts and routines
that were included in the script package but have
since been removed.
script was removed in
the CIAO 4.10 release.
It displayed the LaTeX dataset identifier macro used to
describe observations in papers written for AAS managed
Literature Links for more information.
This Python module has been removed in CIAO 4.12 as ChIPS
functionality was replaced with Python's Matplotlib package.