The Xamin Command Line Interface (CLI) and Data Products

We recently reviewed how data products are handled in the Xamin Command Line Interface and feel that some information on how to download data products might be helpful. (For help getting set up to use the CLI interface see our documentation.)

Let’s start with an example. The following command will return table results from the suzamaster table for object cen a:

java -jar users.jar table=suzamaster position="cen a" fields=name,ra,dec

The output is:

name |ra |dec |exposure
Cen A |13 25 28.68|-43 01 03.7|64675.90000
CENTAURUS_A|13 25 21.86|-43 04 19.2|62432.80000
CENTAURUS_A|13 25 19.73|-43 04 07.7|51278.70000
CENTAURUS_A|13 25 18.74|-43 03 53.6|55944.20000
CENTAURUS A|13 25 27.60|-43 01 09.0| -99.00000
CENTAURUS A|13 25 27.60|-43 01 09.0| -99.00000
Number of rows: 6
Number of columns: 4
—- Messages —-
Info: Search Radius
Search radius: 10′ from suzamaster

Info: Name resolution
Position cen a corresponds to J2000 decimal coordinates:201.365063 -43.019112
—————–

If you want to list the data products for each row add the parameter “products” to the command:

java -jar users.jar table=suzamaster position=”cen a” fields=name,ra,dec products

The output for this command is:

name |ra |dec |exposure
Cen A |13 25 28.68|-43 01 03.7|64675.90000

# Product suzaku.obs: Observation Directory
> /FTP/suzaku/data/obs/1/100005010/

# Product link.suzaxislog: Suzaku XIS Configuration Log
> query?table=suzaxislog&constraint=obsid=100005010

CENTAURUS_A|13 25 21.86|-43 04 19.2|62432.80000

# Product suzaku.obs: Observation Directory
> /FTP/suzaku/data/obs/7/704018010/

# Product link.suzaxislog: Suzaku XIS Configuration Log
> query?table=suzaxislog&constraint=obsid=704018010

CENTAURUS_A|13 25 19.73|-43 04 07.7|51278.70000

# Product suzaku.obs: Observation Directory
> /FTP/suzaku/data/obs/7/704018020/

# Product link.suzaxislog: Suzaku XIS Configuration Log
> query?table=suzaxislog&constraint=obsid=704018020

CENTAURUS_A|13 25 18.74|-43 03 53.6|55944.20000

# Product suzaku.obs: Observation Directory
> /FTP/suzaku/data/obs/7/704018030/

# Product link.suzaxislog: Suzaku XIS Configuration Log
> query?table=suzaxislog&constraint=obsid=704018030

CENTAURUS A|13 25 27.60|-43 01 09.0| -99.00000
CENTAURUS A|13 25 27.60|-43 01 09.0| -99.00000

Number of rows: 6
Number of columns: 8

—- Messages —-
Info: Search Radius
Search radius: 10′ from suzamaster

Info: Name resolution
Position cen a corresponds to J2000 decimal coordinates:201.365063 -43.019112
—————–

As you can see, if data products are available then product names and partial URLs strings are listed below each row of the table results. These URL strings can used with a command line data transfer tool (eg. wget, curl) to download data from the HEASARC server.

In this example there are two types of URLs – one type is used to download data products (eg., > /FTP/suzaku/data/obs/7/704018030/) and the other type (eg., > query?table=suzaxislog&constraint=obsid=100005010) is used to display data from related tables.

For data product downloads an example of a wget command for Unix type machines would be:

wget -q -nH -r -l0 -c -N -np -R ‘index*’ -erobots=off –-retr-symlinks –cut-dirs=1 http://heasarc.gsfc.nasa.gov/FTP/suzaku/data/obs/1//100005010/

If you are interested in what each of the wget options does take a look at this recent blog post.

If you would like to download data products at the same time that you run the java command the following Unix shell script example should work:

#!/bin/sh
java -jar users.jar table=swiftxrlog position=ngc4626 products | \
grep '>' | \
sort | \
uniq | \
sed -e "s/ > \/FTP/wget -q -nH --cut-dirs=6 -r -l0 -c -N -np -R 'index*' -erobots=off --retr-symlinks http\:\/\/heasarc.gsfc.nasa.gov\/FTP/" | \
sh

The URL string for Link Products (e.g., link.suzaxislog) can be used to view Xamin catalog results for related tables. An example of this type of command is:

wget -O suzaxislog_results “http://heasarc.gsfc.nasa.gov/xamin/query?table=ascamaster&radius=60&position=22+02+43.2,42+16+48″

The output is a list of rows from the ascamaster table for object cen a.

We will be creating a post soon with download instructions for users who may not have access to all the commands (eg, sed) used in our example shell script.