\cgidef{-tex -mail -oglu
\file #1{{\tt\fg{red3}#1}}
}
\CDSpage{Structure of UCAC1 compressed files}{VizieR.logo}


The files are organized in {\em zones}, each zone being {0.5\d} wide,
starting with zone 001 (file \file{z001.bin}) at the South Pole. 

The first 80bytes of each of these files contain a text treated as a
{\em magic number} -- some keys which identify the file. Here are two examples:

\begin{glossary}

\term{file \file{z001.bin}}
\verb!#UCAC1-18#12-1234(80chunks)#1998#750: Z001 00000001-00000908!

\term{file \file{z123.bin}}
\verb!#UCAC1-17#12-1234(80chunks)#1998#750: Z123 21128972-21409220!
\end{glossary}

The numbers at the end describe the zone number, and the range in the UCAC1
numbers contained in the file; the preceding numbers indicate the
lowest values used for the magnitudes (7.50) and the Epoch (1998).
The $17$ or $18$ number represents the length of the coded records --
as $18$ bytes near the Poles, or generally $17$ bytes.

This first line is followed by 80 binary numbers of 4 bytes each (i.e.
a total of 320 bytes) which represent the seek position, in the file,
of {\em chunks} of data records, one chunk being approximately 18.5minutes
wide in RA --- the exact range of RA is $2^{24}$mas = 16777.216arcsec = 
1118.4811sec.

Each {\em chunk} of data records starts with a {\em chunk header}
which specifies the origins used for each parameter, the number of data
records, etc. The data, made of fixed-length records of 17 or 18 bytes,
follow this header.

The various structures are described in the following table:

\Beg{TABULAR}{CELLPADDING=5}{|rrp|}
\multicolumn{3 \bg{MistyRose}}{c}{{\bf file header} {\em(400 bytes)}}\\
\multicolumn{2}{r}{80bytes}&``magic'' header \\
80*i4&320bytes&seek positions of the 78 data chunks\\
\multicolumn{3 \bg{Yellow}}{c}{{\bf Chunk\#0 Header} {\em(32+... bytes)}}\\
i4&4bytes&total length of chunk in bytes, rounded to a multiple of 4 bytes\\
i4&4bytes&UCAC number of first star in the chunk\\
i2&2bytes&Length of this header {\em(32+...)} bytes\\
i1&1bytes&Number of this chunk = leftmost byte value of RA\\
i1&1bytes&{\em N(m4)} = Number of out-of-range proper motion values
		requiring a storage on 4 bytes\\
i1&1bytes&{\em N(mu)} = Number of out-of-range proper motion values
		requiring a storage on 2 bytes\\
i1&1bytes&{\em N(Vm)} = Number of out-of-range magnitude values \\
16*i1&16bytes&out-of-range Nobs values \\
i2&2bytes&{\em(unused)}\\
{\em N(m4)}*i4&{\em N(m4)}*4bytes&Out-of-range proper motions 
	requiring 4-byte storage\\
{\em N(mu)}*i2&{\em N(mu)}*2bytes&Out-of-range proper motions 
	requiring 2-byte storage\\
{\em N(Vm)}*i2&{\em N(Vm)}*2bytes&Out-of-range magnitudes\\
\multicolumn{3 \bg{Yellow}}{c}{{\bf Chunk\#0 Body}} \\
RA&24bits&Right ascension in mas (offset in chunk) -- is 32 bits 
		near the poles\\
SPD&21bits&South Polar Distance in mas (offset in chunk, value between 0 and
	1800000)\\
Epoch&11bits&Epoch of Position, in myr (origin 1998.000)\\
sRA&8bits&Sigma on RA (mas)\\
sDE&8bits&Sigma on DE (mas)\\
UCmag&10bits&Magnitude in cmag: values between 0 and 950 are cmag
	with origin at 750, values from 951 on are out-of-range values
	reported in the chunk header\\
Nobs&5bits&Number of observations offset 2; values above 16 are out-of-range
	values reported in the header\\
Ncat&5bits&Number of catalogues offset 2\\
pmx&13bits&Proper motion in 0.1mas/yr, offset -2048; values larger than
	4096 (i.e. outside the limits [-409.6 +409.6[mas/yr 
	are out-of-range values (2-byte values if smaller than 6143,
	4-byte proper motions for values larger than 6144)\\
spmx&9bits&Sigma on pmx in 0.1mas/yr\\
pmy&13bits&Proper motion in 0.1mas/yr, same conventions as pmx\\
spmy&9bits&Sigma on pmy in 0.1mas/yr\\
\End{TABULAR}
\CDStail{UCAC1 Description}
