/** @addtogroup tools
*/
/**@{*/
/**
*
* @file
*
* - NAME
* Wds2StarCat - convert WDS catalogue entries to FITS catalog file
*
* - SYNOPSIS
* @code
* Wds2StarCat [-s] -f wds-ascii-file.txt [-f wds-ascii-file2.txt ...] firststardesig [secondstardesig ...]
* Wds2StarCat [-s] -f wds-ascii-file.txt [-f wds-ascii-file2.txt ...] -r starregexp
* @endcode
*
* - DESCRIPTION
* Catalogue lines of the txt version of the WDS catalog of http://ad.usno.navy.mil/wds/
* are converted into the PRIMA star catalog FITS format.\n
* The arguments of the -f options must be ASCII files containing pieces of the
* full input catalog; these files will not be changed and are only
* used in read-mode. At least one of these must be provided.\n
* All other command line arguments must contain designators
* within any of these cataloges, which are the first 10 letters in each of
* its lines. Alternatively, the switch -r may be used to provide a
* regular expression to match all stars in a name group. To prevent the UNIX
* shell from expanding this into a list of files, this argument must
* generally be included in simple quotes.\n
* A FITS file is written to standard output containing all stars selected by
* the command line arguments. If the switch -s is used (recommended), the results
* will be sorted according to increasing right ascension.\n
* Proper motions that are not found in the WDS catalog are reported as
* zero on output.
*
* - FILES
* @c wdsnew[1234].txt are the standard names of the WDS ASCII files
* after downloading them from the web page. To search through all of
* them at a time, one would first concatenate the pieces to a large
* file and continue with this one:
* @code
* cat wdsnewweb[1-4].txt > wdsnewweb.txt
* Wds2StarCat -f wdsnewweb ... > stars.fits
* @endcode
* or scan them separately
* @code
* Wds2StarCat -f wdsnewweb1.txt -f wdsnewweb2.txt ... > stars.fits
* @endcode
*
* - EXAMPLES
* @code
* Wds2StarCat -f wdsnewweb1.txt 00004+5044 00005+3114
* Wds2StarCat -s -f wdsnewweb1.txt -f wdsnewweb2.txt 00005+4556 00005+3114 00005-0342 00002-3623 00003-4417 00017+6309
* Wds2StarCat -s -f wdsnewweb1.txt -r '^00005'
* Wds2StarCat -s -f wdsnewweb2.txt -r '^00005.*\+'
* @endcode
*
* @see
* WDS
*
* @remarks
* The information on ellptical parameters or the inclination
* towards the line of sight is not available by these means.
* @remarks
* Triple systems and systems of more stars are represented by more than
* one line in the original catalog (e.g. 00026+6606). If one of these
* is selected by command line argument, each of the source lines generates
* two stars in the PRIMA output catalog, and some of these need to be
* removed by hand if duplications are to be avoided.
* .
*
* @author Richard J. Mathar
* @version $Id: Wds2StarCat.C,v 1.2 2006/03/06 17:48:12 mathar Exp $
*
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
// STL headers
#include
#include
#include