Michiel Brentjens

Aips++ tables as LaTeX tables

Sometimes you want to use the contents of some aips++ (sub) table in a LaTeX table, for example all Antenna/station parameters for in your data reduction log or work document. It is rather straightforward to make something that does exactly that. Below are two simple examples. The first illustrates how to extract relevant information from the antenna subtable.

antenna_info :=function(ms='') { t := table(spaste(ms,'/ANTENNA')); names := t.getcol('NAME'); pos := t.getcol('POSITION'); pos[1,] := pos[1,] - pos[1, 10]; pos[2,] := pos[2,] - pos[2, 10]; pos[3,] := pos[3,] - pos[3, 10]; nant := t.nrows(); print '\\begin{tabular}{lll}'; print '\\hline'; print 'Number & Name & baseline w.r.t RT9\\\\'; print '\\hline'; for(i in 1:nant) { print i, '&', names[i], '&', as_integer(sqrt( pos[1,i]*pos[1,i]+pos[2,i]*pos[2,i] + pos[3,i]*pos[3,i])+0.5),'\\\\'; } print '\\hline'; print '\\end{tabular}'; t.done(); }

The next function dumps some general observation info for all MSses specified in mslist that can be found in sourcedir.

dump_obs_info := function(mslist=[], sourcedir='') { print '\\begin{tabular}{lll}'; print '\\hline'; print 'MS & Name & Timerange\\\\'; print '\\hline'; for(msname in mslist) { msin := spaste(sourcedir,'/', msname); obs := table(spaste(msin,'/OBSERVATION')); keywords := obs.getcolkeywords('TIME_RANGE'); timerange := obs.getcell('TIME_RANGE',1); name := obs.getcell('PROJECT', 1); obs.done(); print msname,'& ', name, '& ', dq.time(dq.quantity(timerange[1],'s'), form='ymd'), '-', dq.time(dq.quantity(timerange[2],'s'), form='ymd'), '\\\\'; } print '\\hline'; print '\\end{tabular}'; }