Last updated 2 May 2014
Source code for CMC-1x (and some other catalogues), on GitHub.
This code contains a library of routines for use of the CMC-14 and CMC-15 star catalogue data. (The format for the two versions is the same. CMC-15 extended the coverage from -30 dec to -40, and included more observations in the original area as well. In what follows, the two flavors will be treated interchangeably, and referred to as 'CMC-1x'.) 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++. You can also compile the code with make MSWIN=1 on MinGW, or make CLANG=1 for OS/X or BSD... though I've not tested the latter, except to verify that clang does produce correct executables in Linux. 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-1x data into a structure, and write such a structure back into ASCII. (See cmc.cpp, functions cmc1x_ascii_to_struct() and cmc1x_struct_to_ascii(). )
• Put a CMC-1x star structure into a compressed 25-byte binary format, and vice versa. (See cmc.cpp, functions cmc1x_binary_rec_to_struct() and cmc1x_struct_to_binary_rec(). )
With these functions, it's possible to losslessly compress the 102-byte ASCII records of the "original" CMC-14 or 15 into 25-byte binary records, resulting in a roughly fourfold decrease in file size. This allows all of CMC-14 or -15 to fit in about half of a DVD (2.6 GBytes). The code in cmc_xvt.cpp shows how the conversion is done.
• Find all CMC-1x 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_cmc1x_stars() in 'get_cmc.cpp'.)
An example of the use of the above function is given in extr_cmc.cpp.