\newcommand{\degr}{\hbox{$^\circ$}}
\newcommand{\numm}{\hbox{$\nu_{m}$}}
\newcommand{\nuto}{\hbox{$\nu_{2}$}}
%
% LATEX DOCUMENT SETUP
%
\documentstyle[12pt]{article}
\topmargin -1.0 cm
\setlength{\textheight}{22 cm}
\setlength{\textwidth}{16cm}
\oddsidemargin 0cm
\begin{document}
\vspace{3.5cm}
\title{LOG2ANT \\ 
EVN ANTAB formatting program\\
Version 4.2}
\author {Fredrik T Rantakyr\"{o}\\
fredrik@ira.bo.cnr.it}
\date{971230}
\maketitle
\vspace{8.0cm}
\begin{center}
JIVE \\
IRA - CNR \\
\end{center}
\pagebreak
\tableofcontents
\pagebreak
\section{News}
This version represent a rewritten version that have been tested over
two sessions giving 100\% correctly formatted ANTAB files for {\bf ALL EVN}
antennas. It is easy to use and queries the user if there are any
problems with the logfile. On a 486 Linux machine it processes a
standard logfile in under 20 seconds. 
\section{What is LOG2ANT}
{\bf LOG2ANT} is a {\bf UNIX} script based program that will produce an 
{\bf ANTAB} formatted calibration file from a log file. The program 
automatically takes into account observation frequency, number of {\bf VC}'s 
used, different stations, {\bf SX}-band observations (it produces a 
separate output for {\bf S} and {\bf X}), modes({\bf A - E}), and 
most other standard things. 
\section{How to use LOG2ANT}
\subsection{Installation}
As stated in the the introduction {\bf LOG2ANT} is script based and thus 
doesn't need any compilation to run. 
The program heavily uses the {\bf sed} and the 
{\bf awk} programs to create the correct output, thus these two programs must 
be in the search path. On any normal {\bf UNIX} system setup both programs
should be available. 
\subsubsection{How to get {\bf LOG2ANT}}
{\bf LOG2ANT} can be found on {\bf ASTBO1.BO.CNR.IT}. 
\begin{enumerate}
\item Log in as {\bf EVN} using the password you can obtain from a 
friendly local Friend of VLBI. 
\item The tar archive can be found in {\bf [EVN.ANCAL]} under the name {\bf 
log2ant.tar}. 
To get there just issue the command {\bf cd ANCAL} after you login. 
\item Select binary transfer by typing {\bf bin}. 
\item Type {\bf get log2ant.tar} to get the archive. 
\item After successful transfer type {\bf quit}. 
\end{enumerate}
In the same directory as the tar archive you can find this document. 
\subsubsection{First Installation}
\begin{enumerate}
\item Put the {\bf tar}file in the directory where your binaries are 
stored, typically in \\
{\bf /usr2/oper/bin} in a standard field-system setup. 
\item Unpack the {\bf tar}file with the commando {\bf tar xvf log2ant.tar}. 
\item If you put the files in a different directory than specified above 
you will need to edit the path specified inside the script program. 
Edit the line in the {\bf log2ant} script file that says:\\ 
{\bf dir\_for\_scripts=``/usr2/oper/bin/scripts/script''} \\
to say: \\
{\bf dir\_for\_scripts=``your-new-path-goes-here/script''} \\
Remember that the {\bf /script} must be tagged to the end of the path.  
\item Place the two document files ({\bf log2ant.tex and log2ant.ps})
wherever you place your documents. I recommend that you print out the
PS-file so that you can have the manual to help you out the first
times you run the software.  
\item You are now done with the installation.
\end{enumerate} 
\subsubsection{Updating an old log2ant installation}
With this version the names of the script-files have changed, so before 
doing an installation (see first installation), take away all old scripts 
in {\bf /usr2/oper/bin/scripts}, {\bf /usr2/oper/bin/ascripts}, {\bf
/usr2/oper/bin/headers}, and {\bf /usr2/oper/bin/aheaders}.  
\subsection{Usage}
The usage is really simple, but before running {\bf log2ant} you
should check that the logfile fulfills the following criteria which
are all mandatory for {\bf log2ant} to function correctly: 
\begin{enumerate}
\item The FS in use should be 9.0 or newer.
\item For {\bf MEDICINA} it is assumed that there are {\bf 4} TSYS
lines with the order:\\
   \\
 tsys1(odd,if1)\\
 tsys1(even,if2)\\
 tsys2(odd,if1)\\
 tsys2(even,if2)\\
 
\item For {\bf METSAHOEVI} it is assumed that there are {\bf 4} TSYS
lines with the order:\\
   \\
 tsysa(usb)\\
 tsysa(lsb)\\
 tsysc(usb)\\
 tsysc(lsb)\\
 
\item For {\bf ALL OTHER} stations it is assumed that there are only
one set of defined TSYS lines for each TSYS measurement i.e. TSYS1 and
TSYS2 or TSYSA and TSYSC etc. As long as each TSYS(1,2,A,B,C,D,etc)
pair is uniquely defined then {\bf log2ant} takes care of it. Among
the many possible setups are: \\
   \\\
TSYS1=ODD,IF1 \& TSYS2=EVEN,IF2\\
TSYS1=ALL\\
TSYS1=VC01,VC02,...,VC04,IF1 \& TSYS2=VC05,...,VC14,IF2\\
etc \\

To this date this software has handled all setups during the last 
two sessions without any problems. 
\item There can only be two defined TSYS lines at maximum with the
exception of {\bf MEDICINA} and {\bf METSAHOEVI}. If there are more
than two definitions the program lists all definitions and asks the
user to select the two appropriate ones. If only 1 is used then when
the software asks for the 2nd TSYS line then just press return. 
\item The observing is determined from the LO line in the log, if this
line is missing or the LO frequency is unknown the program presents a
list of observing frequencies from which the user can select the appropriate
one. 
\item There is only one type of setup, i.e. each VC should be uniquely
defined, there should only be one LO frequency defined, and the
definition for the TSYS lines should not be different at different
parts in the log. This is the most frequent problem as some stations
initialize the FS with a SX setup and later goes on to set it up with
the correct frequencies for the experiment. {\bf Check that there is
only one setup, typically the ``false'' ones are found at the
beginning, at the end of the experiment, or at points where the system
where restarted.}
\item To identify whether the observations are with {\bf Dual} or {\bf
Single} polarization the program looks at the {\bf IFD} parameters. If
they are {\bf NOR, NOR} it assumes that it is a dual polarization
experiment, otherwise it assumes that it is a single polarization
experiment. If the program is unable to determine the polarization it
will query the user which of the two cases was used for the
experiment. 
\end{enumerate}
If your setup and the logfile fulfills these criteria then {\bf
log2ant} should produce a valid {\bf ANTAB} formatted file from the 
logfile. {\bf Note:} The spectral line VLBI observations typically
have very odd setups, even in these cases {\bf log2ant} usually
manages to produce a valid output but extra care should be taken when 
checking the resulting INDEX line. 
\begin{enumerate}
\item Change your working directory to that where you have your log-files.
\item Check that the files all have the correct {\bf EVN} naming
standard, ie\\ 
{\bf [exptname]log.[station]}. 
If not please change the names to conform to this standard (a script called 
{\bf fs2evn} has been written and can be sent on request, use the
email address below).   
\item Run the program by {\bf log2ant *.log}. The script will go 
through all your logfiles and create a corresponding number of {\bf ANTAB}
formatted calibration files with names {\bf [exptname]ant.[station]}. Any 
{\bf S}band files will be named {\bf [exptname]sbant.[station]}, while the 
{\bf X}band files will keep the standard names given above.  
\item Any problems encountered by the program will be given. See section 
\ref{errors} for further information. The previous section that
described the criteria for a ``correct'' logfile should also be
consulted if anything goes wrong.  
\item Wait for the program to finish and you are done.
\item Check the final {\bf ANTAB} formatted file so that the INDEX
line makes sense and there are a correct number of columns.  
\end{enumerate} 
\subsubsection{Error messages}
\label{errors}
There are not many error messages but that is hopefully not needed if the 
files are somewhat standard. The existing error messages are:
\begin{enumerate}
\item {\bf No TSYS information.} No {\bf TSYS} lines could be found in the 
log file. This can be due to a nonstandard setup of the {\bf TSYS} output 
or due to that there is no information. In the first case contact me so that 
your nonstandard setup of {\bf TSYS} can be put into the program, or if 
you are familiar with {\bf sed} and {\bf awk} you can make the appropriate 
changes to the script (please, send a copy of the updated file to me). 
\item {\bf Nonstandard frequency.} The program couldn't recognize the 
frequency used. See item {\bf 1} above for what to do. 
\item {\bf No VC information.} There is no information on the frequency 
for each VC, thus the BBCs can't be sorted in frequency order. See item 
{\bf 1} above for what to do. 
\item {\bf Nonstandard VC setup.} This is caused by an nonstandard number of 
{\bf VC}'s or other strangeness. See item {\bf 1} above for what to do.
\end{enumerate}
Please, if you send any bugreports, give information on the logfiles too. 
\section{How to contact the author}
I can be contacted by email at {\bf fredrik@ira.bo.cnr.it}. Please send 
any bugreports, comments and/or suggestions that you have to this address.
\end{document}
\end
