Go up one levelGo to Previous Go to Next

Determining Which Catalogs are Available

In order to access a catalog, you need to know its name. This will most likely be selected from a menu of available catalogs in a user interface. This section describes how to find out which catalogs are available and from where.

Navigating the catalog lists

A list of available catalogs can be accessed via static member functions in class CatalogInfo(n) , the class responsible for reading and parsing the catalog configuration files. The following code demonstrates how you can access the default list of catalogs:

 
#include "CatalogInfo.h" 
... 
for(const CatalogInfoEntry* e = CatalogInfo::first(); e != NULL;   
    e = e->next()) { 
    cout << e->servType() << ": " << e->longName() << endl; 
}

The above example prints out the service type and long name of all of the catalogs in the default catalog list.

Hierarchical catalog lists

The catalog list is hierarchical in that it may contain catalog directory entries that point to other lists of catalogs. The next () method returns the next entry in the list, while the link () method returns a pointer to the first entry in a catalog directory, or NULL if the link does not exist. The following function traverses the list of known catalogs and returns a pointer to the named catalog entry or NULL if it was not found (taken from the CatalogInfo::lookup method):

 
CatalogInfoEntry* lookup(CatalogInfoEntry* entry, const char* name) {
     for (CatalogInfoEntry* e = entry; e != NULL; e = e->next()) 
         if (strcmp(e->longName(), name) == 0 
             || strcmp(e->shortName(), name) == 0) 
     return e;
 
     for (CatalogInfoEntry* e = entry; e != NULL; e = e->next()) { 
         if (e->link()) { 
             CatalogInfoEntry* p = lookup(e->link(), name); 
             if (p) 
                 return p; 
         } 
     } 
     return NULL; 
} 

Note that directory links are not followed automatically, since this could involve network delays or even endless loops. By default the link () method returns NULL unless the config file that the link points to is explicitly loaded like this:

 
if (CatalogInfo::load(dirEntry) != 0)
    return ERROR;

The CatalogInfo::load method takes a CatalogInfoEntry(3) pointer for a catalog directory, follows the URL, loads the new config file and sets the link () member of dirEntry to point to the first entry in the new list.

Catalog Entries

Catalog entries exists for each catalog and are represented by objects of class CatalogInfoEntry(3) . This class has methods for all of the known configuration file keywords. The methods all have 2 versions. With no arguments, they return the value, and with one argument set the value.

The servType() method returns the type of server. There are currently these types supported:

Server Type

Description

catalog

A standard astronomical catalog that returns a tab separated table of query results, with column headings separated by a dashed line from the data.

archive

Same as catalog , but used to distinguishes catalogs from archives in user interfaces.

local

A local catalog, implemented as a tab table - an ASCII file with tab separated columns.

namesvr

This is a special type of catalog that is used to resolve astronomical object names into world coordinates. Currently SIMBAD and NED are used as name servers.

imagesvr

This type of server returns a (possibly compressed) FITS image as a result.

directory

With this entry, the URL points to another config file. When the file is loaded, the link () method points to the first entry in the new list.

The other methods in the CatalogInfoEntry class all correspond to fields in the catalog config file. These fields were described in detail earlier in this document. Currently the following methods are available, each with versions for setting and getting the values:

Method

Description

servType

Get or set the catalog service type

longName

Get or set the long name of catalog

shortName

Get or set the short name of catalog.

url

Get or set the URL used to access the catalog.

symbol

Get or set the list indicating how to plot symbols.

copyright

Get or set the copyright notice for catalog to display in user interface.

searchCols

Get or set the list of column names and min and max value labels for columns that can be used to search the catalog.

sortCols

Get or set the list of columns to sort by.

sortOrder

Get or set the sort order: Set to increasing or decreasing .

showCols

Get or set the list of columns to display and the order of display.

id_col

Get or set the column index for columns containing the id field.

ra_col

Get or set the column containing the RA position.

dec_col

Get or set the column containing DEC position.

x_col

Get or set the column containing the X image pixel coordinate.

y_col

Get or set the column containing the Y image pixel coordinate.

is_tcs

Get or set the value of the tcs flag.

The default catalog configuration file is automatically read the first time it is needed. There is a default URL that points to the standard configuration file on archive.eso.org. You can override the default to add your own catalogs by defining the environment variable CATLIB_CONFIG 1 to a valid URL. The URL can point to a remote HTTP server ("http://host/dir/configfile") or it can point to a local file ("file://dir/configfile"). If the config file is not found, a hard coded default is used.


1. The environment variable SKYCAT_CONFIG is also accepted, for compatibility with previous versions.


Go up one levelGo to Previous Go to Next

Please send questions or comments to abrighto@eso.org@eso.org.
Copyright © 1998 ESO - European Southern Observatory