Browse Home

The ISDC Database Batch Interface

Topics:


The batch interface allows a user to interrogate the ISDC databases as if they were local to the users machine. The user downloads a pair of small Perl scripts which act as a local client to query the database. The client is configured to be easily called from programs or from within command scripts -- though it may be used interactively.

Getting Started and Software Installation

Note that only Object Name/Coordinates Searches can be executed using the batch interface. Also, in order to use the batch facility, you will need access to a Unix workstation with Perl 5.x or Perl 4.x compiled and installed on it.

You will need to download two Perl scripts:

  1. browse_extract_isdc
  2. webquery (Perl 5.x) OR webquery (Perl 4.x)
from the ISDC's anonymous FTP server. Once you've downloaded these files, make sure they have executable permissions and place them in your executable path. These scripts assume your system has the Perl command installed in /usr/local/bin. If Perl has been installed elsewhere on your machine, you should edit the first line of each script to change:
#!/usr/local/bin/perl to the correct location.

Note: These scripts are in the public domain. Please feel free to copy and modify them to use however you wish. However, we can only support the versions of the scripts that we have made available.

Usage

To use the Batch Interface, simply use browse_extract.pl command at the Unix shell prompt. Many options are available, but you only need to specify the table to be searched and the astronomical position(s) of interest.

The syntax of the command is:

browse_extract.pl table=table name

optional arguments:
position=object name or position
coordinates=EQUATORIAL or GALACTIC
equinox=year
radius=numerical value in units of arc-minutes
fields=STANDARD or ALL
name_resolver=NED or SIMBAD
infile=input filename
outfile=output filename
All arguments are case insensitive.

Explanation of command line arguments:

table
This is the abbreviated or short table name as used in Browse, e.g., ABELL, XTEOBS, ROSPUBLIC. These table names are given in Browse in the boxes where you select the tables.
position
This is either the name of an object or a set of coordinates to search around. If a name is given it will be resolved using the service given in the name_resolver argument or SIMBAD by default. The syntax for coordinates is the same as those supported in the Browse Web service. If the coordinates string contains embedded spaces (e.g., 12 2 3.3, -13 8 1), then this argument should be enclosed in quotes.
coordinates
This should be either "Equatorial" or "Galactic". The default is Equatorial.
equinox
This defines the equinox year for both your input and and the resulting coordinates in the output. It defaults to 2000.
radius
This gives the radius in arcminutes for which a match should be made. This defaults to 1 degree. Note that this is different from the interactive Browse system where the default differs from table to table.
fields
indicates which parameters are to be retrieved from the table. The default, "Standard", indicates that only a preselected set of the most critical parameters will be retrieved. "All" will retrieve all parameters from the table.
name_resolver
may be used to select the system used to convert names into coordinates. The currently supported services are NED and SIMBAD. The default is SIMBAD.
infile
specifies a file containing positions to be searched.
outfile
specifies a file to contain the table of returned results. If not specified the results will be printed on standard out.

Users may specify the target positions using the position argument, using a predefined file specified with infile, or from the standard input. In the latter two cases each line until an EOF will be used as a position.

Example

Are there any Science Windows (SCW) of crab in INTEGRAL archive, revision 1?

% browse_extract_isdc.pl table=integral_rev1_scw radius=300 position=crab name_resolver=ned fields=standard

should print to standard output a table like the following:


|scw_id      |scw_ver|scw_type   |ra_x       |dec_x      |obs_id     |obs_type   |start_date         |end_date           |pi_name|ps     |good_spi|good_picsit|good_isgri|good_jemx1|good_jemx2|good_omc|dsize    |_search_offset|
+------------+-------+-----------+-----------+-----------+-----------+-----------+-------------------+-------------------+-------+-------+--------+-----------+----------+----------+----------+--------+---------+--------------+
|004000040010|001    |pointing   |05 34 31.98|+22 00 51.9|88600190005|Calibration|2003-02-11 13:24:02|2003-02-11 14:03:28|Public |public |    2366|       2199|      2358|      2357|      2357|    2208| 41764864|0.004         |
|004000040020|001    |pointing   |05 34 31.98|+22 00 51.9|88600190005|Calibration|2003-02-11 14:03:28|2003-02-11 15:18:24|Public |public |    4496|       4403|      4488|      4495|      4495|    4496| 78703616|0.004         |
|004000040030|001    |pointing   |05 34 31.98|+22 00 51.9|88600190005|Calibration|2003-02-11 15:18:24|2003-02-11 16:00:02|Public |public |    2448|       2143|      2462|      2463|      2475|    2498| 43953152|0.004         |
|003900050010|001    |pointing   |05 34 31.96|+22 00 52.4|88600190003|Calibration|2003-02-08 23:17:56|2003-02-09 00:41:20|Public |public |       0|       4997|      4990|      5003|      5004|    4969| 85724160|0.006         |
|003900050020|001    |pointing   |05 34 31.96|+22 00 52.4|88600190003|Calibration|2003-02-09 00:41:20|2003-02-09 02:04:40|Public |public |       0|       4991|      4988|      5000|      5000|    5000| 85199872|0.006         |
|003900050040|001    |pointing   |05 34 31.96|+22 00 52.4|88600190003|Calibration|2003-02-09 03:28:00|2003-02-09 04:51:20|Public |public |       0|       4933|      4994|      4999|      5000|    5000| 85001216|0.006         |
|003900050030|001    |pointing   |05 34 31.96|+22 00 52.4|88600190003|Calibration|2003-02-09 02:04:40|2003-02-09 03:28:00|Public |public |       0|       4976|      4990|      4999|      5000|    5000| 85174272|0.006         |
|003900050070|001    |pointing   |05 34 31.96|+22 00 52.4|88600190003|Calibration|2003-02-09 07:38:00|2003-02-09 09:01:20|Public |public |       0|       4980|      4995|      5000|      4999|    5000| 84959232|0.006         |
|003900050090|001    |pointing   |05 34 31.96|+22 00 52.4|88600190003|Calibration|2003-02-09 10:24:40|2003-02-09 11:48:00|Public |public |       0|       4990|      4996|      5000|      4999|    5000| 85132288|0.006         |
|003900050110|001    |pointing   |05 34 31.96|+22 00 52.4|88600190003|Calibration|2003-02-09 13:11:20|2003-02-09 14:34:40|Public |public |       0|       4980|      4979|      4997|      4999|    5000| 85161984|0.006         |
|003900050130|001    |pointing   |05 34 31.96|+22 00 52.4|88600190003|Calibration|2003-02-09 15:58:00|2003-02-09 17:21:20|Public |public |       0|       4987|      4996|      5000|      4999|    5000| 85144576|0.006         |
|003900050150|001    |pointing   |05 34 31.96|+22 00 52.4|88600190003|Calibration|2003-02-09 18:44:40|2003-02-09 19:43:52|Public |public |       0|       2297|      2331|         0|         0|    3535| 40749056|0.006         |
|003900050160|001    |pointing   |05 34 31.96|+22 00 52.4|88600190003|Calibration|2003-02-09 19:43:52|2003-02-09 20:43:25|Public |public |       0|          0|         0|         0|         0|    3573|  1712128|0.006         |
|003900050140|001    |pointing   |05 34 31.96|+22 00 52.4|88600190003|Calibration|2003-02-09 17:21:20|2003-02-09 18:44:40|Public |public |       0|       4987|      4993|      3719|      3726|    5000| 83588096|0.006         |
|003900050120|001    |pointing   |05 34 31.96|+22 00 52.4|88600190003|Calibration|2003-02-09 14:34:40|2003-02-09 15:58:00|Public |public |       0|       4983|      4984|      4999|      4999|    5000| 85248000|0.006         |
|003900050100|001    |pointing   |05 34 31.96|+22 00 52.4|88600190003|Calibration|2003-02-09 11:48:00|2003-02-09 13:11:20|Public |public |       0|       4956|      4988|      5000|      4999|    5000| 84877312|0.006         |
...
Search of table integral_rev1_scw around 'crab' with a radius 300' returns 617 rows

If you have questions concerning the installation or usage of these scripts please contact ISDC.