cda.py

cda.py is a script to query and download data from the Chandra Data Archive (CDA). It is a stop-gap measure to allow for non-interactive usage of the CDA. To use it, a working Python installation is required (probably version >= 1.5) although a Solaris binary is also available. Most Linux systems already have Python installed. Currently it is only intended to download non-grating ACIS data. Most recent change was to account for small change in CXC ftp directory structure.

Download:

Get it from http://xassist.pha.jhu.edu/xassist/cda/cda_v1.13.tar.gz Solaris stand-alone version not available for v1.13 at the moment but can be produced upon request.

Installation:

Untar the tar file, and then add the directory created to your PATH system variable. E.g., if you are working in your home directory:
$ gunzip -c cda_v1.13.tar.gz | tar xvf -
$ setenv PATH $HOME/cda:$PATH
You may need to also add the directory to your PYTHONPATH variable:
$ setenv PYTHONPATH $HOME/cda
if PYTHONPATH already exists, this should be
$ setenv PYTHONPATH $HOME/cda:$PYTHONPATH
For the stand-alone Solaris version, also add the cda directory to your LD_LIBRARY_PATH.

Usage:

cda.py with no params print out the following help screen:
Usage: cda.py (-q) source name or coords or obsid
Gets position for sourcename using NED and then searches
for available Chandra data (by downloading the CDA web page)
If public ACIS data is available, minimal data files will be requested and
downloaded, unless -q is specified (query-only)
The html file with available data is saved to cda.html
If this file exists, it is not downloaded again, i.e., delete it to refresh
database
If the input is a valid integer, it is assumed to be an obs id
To specify which files to download, create 'files.dat' in the currecnt
directory with one search string per line, e.g.,
evt1
evt2
aoff1

Briefly, cda.py goes through the steps that you would be doing if you tried to retrieve data using the CXC CDA www interface. A caveat is that if the CXC changes the format of these www pages, this script will likely break. Since the www page listing the full archive is large, cda.py saves it to cda.html and only downloads it from if it isn't already present (obviously more effecient for multiple queries).

XAssist Home Page


Andrew Ptak
Last modified: Wed May 15 10:29:06 EDT 2002