Author image Graham Bell
and 3 contributors


Astro::Catalog::Query::SkyCat - Generate SkyCat catalogue query clients



On load, automatically parse the SkyCat server specification file from ~/.skycat/skycat.cfg, if available, and dynamically generate query classes that can send queries to each catalog server and parse the results.




Simple constructor. Forces read of config file if one can be found and the config has not been read previously. If no config file can be located the query object can not be instantiated since it will not know the location of any servers.

 $q = new Astro::Catalog::Query::SkyCat( catalog => 'gsc', %options );
 $q = new Astro::Catalog::Query::SkyCat( catalog => 'gsc@eso', %options );

The catalog field must be present, otherwise the new object will not know which remote server to use and which options are mandatory in the query. Note that the remote catalog can not be changed after the object is instantiated. In general it is probably not wise to try to change the remote host via either the query_url or url methods unless you know what you are doing. Modifying your skycat.cfg file is safer.

Currently only one config file is supported at any given time. If a config file is changed (see the cfg_file class method) the current config is overwritten automatically.

It is not possible to override the catalog file in the constructor. Use the cfg_file class method instead.

Obviously a config per object can be supported but this is probably not that helpful. This will be reconsidered if demand is high.

Accessor methods


Catalog name selected by the user and currently configured for this object. Not to be used outside this class..

General methods


Configure the object. This calls the base class configure , after it has made sure that a sky cat config file has been read (otherwise we will not be able to vet the incoming arguments.


Construct a query URL based on the options.

  $url = $q->_build_query();

All the SkyCat servers return data in TST format. Need to make sure that column information is passed into the TST parser.


This method declares which options can be configured by the user of this service. Generated automatically by the skycat config file and keyed to the requested catalog.


Get the default options that are relevant for the selected catalog.

  %defaults = $q->_get_default_options();

Class methods

These methods are not associated with any particular object.


Location of the skycat config file. Default location is $SKYCAT_CFG, if defined, else $HOME/.skycat/skycat.cfg, or $PERLPREFIX/etc/skycat.cfg if there isn't a version in the users home directory

This could be made per-class if there is a demand for running queries with different catalogs. This would also move the config contents into the query object itself.


'directory' entries are not followed by default although the class can be configured to do so by setting

 $Astro::Catalog::Query::SkyCat::FOLLOW_DIRS = 1;

to true.

This class could simply read the catalog config file and allow queries on explicit servers directly rather than going to the trouble of auto-generating a class per server. This has the advantage of allowing a user to request USNO data from different servers rather than generating a single USNO class. ie

  my $q = new Astro::Catalog::Query::SkyCat( catalog => 'usnoa@eso',
                                             target => 'HL Tau',
                                             radius => 5 );

as opposed to

    my $q = new Astro::Catalog::Query::USNOA( target => 'HL Tau',
                                              radius => 5 );

What to do with catalogue mirrors is an open question. Of course, convenience wrapper classes could be made available that simply delegate the calls to the SkyCat class.


SkyCat FTP server. [URL goes here]

SSN75 [] by Clive Davenhall.


At the very least for testing, an up-to-date skycat.cfg file should be distributed with this module. Whether it should be used by this module once installed is an open question (since many people will not have a version in the standard location).


Copyright (C) 2001-2003 University of Exeter and Particle Physics and Astronomy Research Council. All Rights Reserved.

This program was written as part of the eSTAR project and is free software; you can redistribute it and/or modify it under the terms of the GNU Public License.


Tim Jenness <>, Alasdair Allan <>