Hi folks,

   Just got my beta UCAC-2 disks today,  and have confirmed that my
C/C++ source code to access them (written while waiting for them to
arrive) works properly.  It's now posted at

http://www.projectpluto.com/ucac2.zip     (about 27 KBytes)

   This also includes files that allow the data to be displayed in
Guide 8.0.  (I'll rig it to be used for astrometry in Charon in a bit.
For that purpose,  the absence of brighter stars may be a problem;
this confuses the pattern-matching algorithm.)

   'ucac2.h' and 'ucac2.cpp' show how one can process UCAC-2 binary
data from C.  The code will work in Linux and DOS/Windows.  I've added
in byte-reordering code that ought to let it work on "wrong-Endian"
platforms, but I don't have one handy with which to test the matter.

   As best I can tell,  this code has no particular advantages (or
disadvantages) relative to the FORTRAN source,  so your choice should
reflect only your prejudices in programming languages.

   Compiled as

cl -W4 -Ox ucac2.cpp                (Microsoft C/C++,  DOS/Windows)
wcl386 -W4 -Ox ucac2.cpp            (Watcom C/C++,  DOS/Windows)
g++ -o ucac2 -DUNIX ucac2.cpp       (GNU C/C++,  Linux)

   you'll get a program that can be run as

ucac2 <ra> <dec> <width> <height>

   with all arguments in decimal degrees.  UCAC-2 data will be extracted
and written to a text file,  'ucac2.txt'.  Optionally,  one can add a path:

ucac2 <ra> <dec> <width> <height> <path>

   to have the data read from another directory or from CD.  For example,
if your CD-ROM is drive d:,  you might put the CD in the drive and run

ucac2 45 -12 1.3 1.8 d:\u2

   to extract a 1.3-degree wide,  1.8-degree high field around RA=3h00m00s
(a.k.a. 45 degrees),  declination -12.  As you might expect,  you need to
be sure to have the correct CD in the drive:  disk 1 for declinations
-90 to -37,  disk 2 for declinations -37 to +1,  or disk 3 for areas
north of declination +1.

   The DOS executable is provided.  The extracted data in 'ucac2.txt'
can be displayed in Guide 8.0.  Just put 'ucac2.txt' and the file
'ucac2.tdf' (provided as part of the above ZIP) in the Guide directory,
and zoom in on the extracted region.  You can also then right-click on
the UCAC-2 stars displayed on the chart,  and get "more info" (basically,
a dump in human-readable form of all the info on that star.)

   BE WARNED that if you make use of Guide's ability to show 2MASS data:

http://www.projectpluto.com/update8.htm#b1_2mass

   the JHKs photometry from UCAC-2 won't quite match that from 2MASS.
This happens because Guide is downloading 2MASS data from VizieR,  which
hasn't moved to the "final release" 2MASS data yet.

   The code will be untroubled by changes in the number of stars in
the final version,  but (unsurprisingly!) will have to be revised if
the format changes in that version.

   Hope this is useful to you,  or at least interesting.  Please let me
know if you've problems or thoughts.

-- Bill
