Introduction to AIPS

What is AIPS

The Astronomical Image Processing System was developed by NRAO, originally to handle VLA data. It is now the most comprehensive radio image processing system available. We are using a tried and tested version; AIPS++ is being developed but once you have an idea of how AIPS works all other data processing packages (also DIFMAP, MIRIAD etc) use the same physical principles even if the user interfaces appear different.

AIPS is initially used to edit *raw uv data, and apply corrections to compensate for atmospheric and instrumental degredation of the signal. You can also check the quality of the signal and the flux density of calibration sources. In AIPS, your uv data is in a file which contains one or many sources - known as a *multi-source file - and everything you do to that data is recorded in *extension tables, applied as required. They can also be deleted if you make a mistake. Once the data is calibrated you can transform it into maps and clean out the artefacts due to the instrument's characteristics. Later chapters describe how to do this in more detail.

This Chapter describes some basic features of AIPS. You can read/print it all or use the list of sections to skip to what you want.

I How to start AIPS

II How to load data

III How to save AIPS data

IV How uv data is managed in AIPS

Summary

I How to start AIPS

Before you start AIPS:
Find your AIPS number, e.g. 890
If you have just run tdproc (or tdproc_test etc) you will have a file called e.g. 00jan01.d:1.FITS. Assuming this is in your directory on golum:

% cd /scratch/golum_1/atac
% ls /scratch/golum_1/atac/00jan01.d:1.FITS
Set 'environments' which tell AIPS where to look for data to load (WORK), where to print out copies of plots and lists you want to keep (PRINT), and where to find runfiles if you want to run batch jobs (RUNFIL).
% setenv WORK /scratch/golum_1/atac
% setenv PRINT /scratch/golum_1/atac
% setenv RUNFIL /scratch/golum_1/atac
If you have to load files from a different directory or a *remote machine then set the relevent path.
% setenv WORK /scratch/fulgora_1/merlin
To start AIPS type
% aips
The numbers marked * below are entered by you (not the *!). Some other information will be shown which you can usually ignor. However if AIPS fails to start note any error messages.
Note the tape and disk numbers.
You have a choice of 4 printers.  These are:
   No. [ type  ] Description
-------------------------------------------------------------
    1. [     PS] caxton - in link room 
    2. [     PS] murdoch - opposite library 
    3. [     PS] maxwell - between Penthouses 1 & 2 
    4. [PS-CMYK] iris - colour printer in link room 
-------------------------------------------------------------
START_AIPS: Enter your choice, or the word QUIT [default is 1]: 1*	

AIPS 1: Enter user ID number
? 980*					

START_AIPS: Your initial AIPS printer is the caxton - in link room 

  Disk 1 (1) is /DA/GOLUM_1

Tape assignments: 
  Tape 1 is DDS-3 DAT on GOLUM
  Tape 2 is Exabyte on GOLUM
You should get 3 new windows:
AIPS_MSGSRV
TEKSRV
TEKSRV(Tek)
AIPS98-INET)

To start AIPS remotely

You can use another machine as a console and run aips on golum and access data already there (or v.v.).

Log into e.g. illapa. Start AIPS as above (without 'setenv') to get the message server etc. running on illapa. Then use a window on illapa to log in *remotely to golum and go to your directory on golum and do the 'setenv's. Then

% AIPS tv=illapa
and continue as above.

AIPS does not distinguish whether you type in upper or lower case but note use of inverted commas in some places. The only exception is in FITLD (FITs file LoaD) if the external file name is *lower case.

Some AIPS jargon and help:
AIPS operates on data with programs known as *TASKS, e.g. FITLD. The inputs to these are ADVERBS, e.g. INFILE, DOUVCOMP. The value assigned to an ADVERB is sometimes referred to as the argument. Some simple operations are known as VERBS e.g. HELP, ZAP.

You can look at the inputs to a task e.g. FITLD using

inp FITLD
You can get more information by typing
HELP FITLD
etc. In some cases
EXPLAIN FITLD
will give you more details.

Many ADVERBS are irrelevant at present and if a setting is not specified then the default value is OK.

Resetting default values

RESTORE 0
(zero. Alphabetical arguments (e.g for INFILE, see below) and source names are in *inverted commas, numeric arguments usually aren't). If you do RESTORE 0, then usually you want to do the first two things below, as the defaults do the opposite:

To avoid hanging the terminal

DOWAIT -1
To avoid sending what you don't mean to the printer
DOCRT 1

II Loading data

To load a FITS file from disk

e.g. *raw uv data. This means data from the correlator converted to FITS files using tdproc or similar. It should have the flux scaled in Jy but no other calibration. It contains a complex number ('visibility') representing amplitude and phase for each integration (2-16 sec), for each baseline, for each polarisation combination. A data set for a full track contains many thousand visibilities.

task 'FITLD'
inp FITLD
INFILE 'WORK:00jan01.d:1.FITS
(note single inverted comma as FITS file name is partially lower case).
DOUVCOMP -1
(don't compress MERLIN data usually, this would slightly degrade it)
OUTD 1
(outdisk 1; golum has only one disk but on other machines you might need to set 'OUTD 2' or etc.)
inp FITLD
to check
go FITLD
In the message server you should see:
golum > FITLD1: Task FITLD  (release of 15OCT98) begins
golum > FITLD1: Reading from disk file: WORK:00jan01.d:1.FITS
golum > FITLD1: ZTPOPD: using translated file name =
golum > FITLD1: ZTPOPD: /scratch/golum_1/atac/0jan01.d:1.FITS
golum > FITLD1: Found MULTI    observed on 01-DEC-2000
golum > FITLD1: Create MULTI  .UVDATA.   1 (UV)  on disk 1 cno    1
....
Look out for any errors like not finding the file.

To list your AIPS files

PCAT
AIPS 1: 1 890 MULTI   .UVDATA.  1 UV 25-JAN-2000 22:10:41 WRIT
WRIT means it is still loading the file; when it has finished the message server you see
golum > FITLD1: Appears to have ended successfully
To mount a tape and load an AIPS file:

If possible use the tape deck attatched to the machine you are running AIPS on.

inp MOUNT
INTAPE 1
(see the tape assignments shown when you first started aips to choose. DAT (small) tapes are normally used for AIPS data.)
REMHOST ''
MOUNT
See message server, if the tape fails to mount this probably means someone else has not *dismounted their tape. To check tape is at start
REWIND
To check what is on the tape
TPHEAD
which will show the *file header.

If the first file you want is the 4th on the tape:

NFILE 3
AVFI
This advances 3 files.
TPHEAD
to check.
task 'FITLD'
inp FITLD
INTAPE 1
(the same INTAPE number as in MOUNT)
INFILE ' '
NFILE 0
to load the 4th file.
NCOUNT 3
to load files 4, 5, 6
DOUVCOMP -1
OUTD 1
inp FITLD
check everything else is default values, set outname etc if you want.
go FITLD
When you have finished , always *dismount the tape in AIPS
DISMOUNT

III How to save AIPS data

To a local tape drive
It is good practice to save files to tape regularly.
NB you cannot mix files written out of AIPS with any other sort of file on the same tape.
a) so you can delete large files you are no longer working on
b) in case of computer problems
Use PCAT to find the file you want to save, e.g. 1, and mount the tape.

task 'FITTP'
GETN 1
OUTTAPE 1
(the same as INTAPE in MOUNT)
OUTFILE ''
DOSTOKES -1
DOEOT 1
to skip forward over files already on the tape. For a new tape only, use
DOEOT -1
inp FITTP
check other settings are defaults
go FITTP
If you want to save all the files on a particular AIPS disk e.g. 1 then have everything as above but use
CLRN
to clear the file name etc
DOALL 1
IND 1
go FITTP
Using a remote tape drive.
E.g. your data is in AIPS on golum but the DAT drive is in use. On e.g. fulgora, start aips as usual but with
% aips da=golum
This will give you
Disk 1 (1) is /DA/FULGORA_1
Disk 2 (2) is /DA/GOLUM_1
- note the disk numbers, there may be more than 2. Then you can use MOUNT and FITTP as above, in FITTP select the golum disk number. It is quite efficient to write to a disk (scratch or AIPS) or a tape on the machine you are logged in to (including by rlogin etc) from a *remote machine . Writing from the local machine to a remote disk or tape is disallowed to scratch disks and very slow and inefficient otherwise.

To list AIPS files on a tape

task 'PRTTP'
NFILE 0
PRTLEV -3
for a simple list
DOCRT -1
OUTPRINT   'PRINT:TACAIPS.LIST'
(or any name)
go PRTTP
When finished
DOCRT 1
DISMOUNT
Writing an AIPS file to disk
PRINT should point to a disk on the machine you are logged in to and you must save each file to a different name:
task 'FITTP'
getn 1
OUTFILE 'PRINT:NAME_UV.FITS'
DOSTOKES -1
inp FITTP
go FITTP

IV How uv data is managed in AIPS

The file header
AIPS files, like FITS files generally, have a header giving the important characteristics of the data. We normally process AIPS uv data in *multi-source format (even single sources can be stored in this way). The results of calibration and editing in AIPS are stored in *extension tables, along with more details of the data. The data itself is not modified so you can undo mistakes by deleting tables (although the data can be copied to another file with permanent corrections written into the data itself).

GETN 1
IMH
This will show the *file header
AIPS 1: Image=MULTI     (UV)         Filename=MULTI       .UVDATA.   1
AIPS 1: Telescope=MERLIN2            Receiver=
AIPS 1: Observer=                    User #=  890
AIPS 1: Observ. date=01-JAN-2000     Map date=25-JAN-2000
AIPS 1: # visibilities    226005     Sort order  TB
AIPS 1: Rand axes: UU-L  VV-L  WW-L  BASELINE  TIME1  SOURCE
AIPS 1: ----------------------------------------------------------
AIPS 1: Type    Pixels  Coord value  at Pixel     Coord incr   Rotat
AIPS 1: COMPLEX   3   0.0000000E+00    1.00  1.0000000E+00    0.00
3 axes of visibilities
AIPS 1: STOKES    4  -1.0000000E+00    1.00 -1.0000000E+00    0.00
4 polarisations (LL,(RR, LR, Rl)
AIPS 1: FREQ      1   1.4205000E+09    1.00  1.4000000E+07    0.00
One 14 MHz frequency channel centred at 1420.5 MHz
AIPS 1: IF        1   1.0000000E+00    1.00  1.0000000E+00    0.00
One Intermediate Frequency for MERLIN data
AIPS 1: RA        1    00 00 00.000    1.00       3600.000    0.00
AIPS 1: DEC       1    00 00 00.000    1.00       3600.000    0.00
No position as several sources in file
AIPS 1: ----------------------------------------------------------
AIPS 1: Coordinate equinox 1950.00
Extension tables
AIPS 1: Maximum version number of extension files of type HI is   1
History table; inspect using
go PRTHI

AIPS 1: Maximum version number of extension files of type AN is 1
Antenna table; inspect using
go PRTAN

AIPS 1: Maximum version number of extension files of type FQ is 1
Frequency table, like all other tables can be inspected with PRTAB but not very useful here.
AIPS 1: Maximum version number of extension files of type SU is   1
Lists sources and some parameters
inext 'SU'; go PRTAB
To index a uv file
INDXR creates index (NX) table and a blank calibration (CL) table to enter the calibration solutions in later. Usually 0.5 mins is a suitable minimum solution interval; short enough that the errors affecting the data do not change significantly, not so short the table is too big.
task 'INDXR'
INFILE ''
clears the old setting
CPARM 0 0 0.5 0
solution interval
GO INDXR
Check message server for
golum > INDXR1: Appears to have ended successfully
Possible errors and fixes will be covered later. To rename an AIPS file to identify it
getn 1
outname '00jan01_1'
inp RENAM
(check inputs)
RENAM
To list the contents of an AIPS uv file
Now look at what is in the data in more detail
task 'LISTR'
getn 1
inext 'NX'
opty 'SCAN'
This uses the index (NX) table to list each scan, usually between each source or configuration change.
inp LISTR
(check inputs)
go LISTR
If you have 'DOCRT 1' set, this will produce a list on your screen. It is useful to have a more permanent copy.
DOCRT -1
OUTPRINT 'print:00JAN01_1.LISTR'
go LISTR
DOCRT -1; OUTPRINT ''
In the message server you should see
golum >  LISTR1: ZTXOP2: using translated file name =
golum >  LISTR1: ZTPOPD: /scratch/golum_1/atac/00JAN01_1.LISTR
golum >  LISTR1: Appears to have ended successfully
If it fails, check the PRINT environment is set correctly and there are no ADVERBS set wrongly in LISTR (if in doubt, RESTORE 0) and start again).
You can then, outside AIPS, search it in 'emacs' etc, or print it using eg
% lp -dcaxton 00JAN01_1.LISTR
Check that it has all the sources at the times and the frequency you expect, by comparison with the dlists (you do not have to check every scan individually but make sure there are no long gaps without a reason and the start and finish times are correct).

Summary

MERLIN data from the correlator is converted into FITS files and the amplitudes are scaled in Jy using tdproc. The FITS files are loaded from disk into AIPS. AIPS files can also be stored on tape (from inside AIPS).

Radio astronomy data is stored by AIPS as binary files. Information about the data e.g. observing frequency is held in the header which can be read on the screen. More details such as time on each source, and all the calibration information, is held in extension tables which can also be read or plotted. The data itself is not modified. To start AIPS type aips and follow instructions. In AIPS,
PCAT tells you what files you have.
GETN (catalogue number from PCAT ) followed by
IMH shows you the header and extension tables present in a file
INP, HELP, or EXPLAIN (TASK name) tells you something, more, a lot, about a TASK.
ABOUT TASK lists all the tasks there are (useful if you half-remember its name!)