C/C++ source code for CMC-14

Last updated 3 November 2006

Click here for the CMC-14 source code (about 10 KBytes)

Click here for information about source code for accessing UCAC-2 data

This code contains a library of routines for use of the CMC-14 star catalogue data. For information about CMC-14, see:

http://www.ast.cam.ac.uk/~dwe/SRF/cmc14.html 

The library is written in C, despite the .cpp file extensions. Make files are provided for g++ in Linux, OpenWatcom C/C++, and Microsoft Visual C/C++. I'd expect the code to port readily to other systems, though it looks as if there may be problems (at least thus far) on "big-Endian" (non-Intel) systems.

Functions are provided to:

  • Read the ASCII CMC-14 data into a structure, and write such a structure back into ASCII. (See cmc14.cpp, functions cmc14_ascii_to_struct() and cmc14_struct_to_ascii(). )
  • Put a CMC-14 star structure into a compressed 25-byte binary format, and vice versa. (See cmc14.cpp, functions cmc14_binary_rec_to_struct() and cmc14_struct_to_binary_rec(). )
  • With these functions, it's possible to losslessly compress the 102-byte ASCII records of the "original" CMC-14 into 25-byte binary records, resulting in a roughly fourfold decrease in file size. This allows all of CMC-14 to fit in about half of a DVD (2 597 619 150 bytes). The code in cmc14xvt.cpp shows how the conversion is done.

  • Find all CMC-14 records covering a given RA/dec rectangle, writing them out to an ASCII file. The function will use either the ASCII or binary files as input, but the output is always in ASCII. (See the function extract_cmc14_stars() in 'get_cmc.cpp'.)
  • An example of the use of the above function is given in extr_cmc.cpp.