Preparing Your Data in AIPS

If you feel that you would rather load and flag your data within AIPS but calibrate within Miriad, a number of steps need to be performed:
  1. The AIPS task to load RPFITS data is ATLOD. Copious information on this is given in Neil Killeen's `Analysis of Australia Telescope Compact Array Data'. However, before loading your data into AIPS, if you have measured all four polarisation correlations, it is best to do a preliminary run of ATLOD using the optype ='sysc' option. This run writes a text file (XYPHS_xx, where xx is your AIPS number) containing the XY phase for each antenna into the FITS area (/DATA/FITS). Text files of system temperature are also written. Although the various selection parameters of ATLOD are still active, you probably want to see all the data. Most of the other ATLOD parameters are unimportant for this.

    optype = 'sysc' Load the data
    freqsel Select all data

    You should plot the phases (and the system temperatures) with the Unix program pltsys - which prompts you for the name of the text file to plot as well as other information. Examine these plots carefully to assess their quality. You should use these plots to choose your reference antenna (for calibration purposes). Choose the reference antenna to be the antenna having the cleanest, most stable XY phase measurements.

    Determine some mean value of the XY phase for each antenna from the plots. The command pltsys prints out both the average and median XY phase. As there are often outliers, the median is more likely to reflect the true XY phase value. Getting a good value is only important for the reference antenna. Do not be too concerned if there are large jumps in the XY phases on antennas other than the reference antenna.

  2. No XY Phase Correction in ATLOD: You are now confronted with the decision of where to correct the XY phase of the reference antenna. Your choice will depend on taste, circumstances and the quality of the XY phase measurements. There are three main options: There are a number of other possibilities, which will not be described here.

    If you are going to correct the XY phases in Miriad, or if you are not going to correct XY phase at all, then you should now load your data without applying any XY phase. It is probably worth your while to pretend that the polarisations are circular rather than linear with the usual fudges, as not all the AIPS software will recognise linears (most of the calibration software will). You must not convert to Stokes parameters. The appropriate ATLOD parameters are

    optype = 'load' Load the data
    aparm(1) =-1 Label as circular
    cparm(5) =0 Do not apply any XY phases.

  3. Correcting XY Phases with ATLOD: If you want to correct the XY phases with AIPS ATLOD, the XY phases on at least one antenna should be reasonably constant with time (vary by no more than a few degrees). In this case, give ATLOD the values of the XY phases that you determined from the plots discussed above. Input these values into ATLOD with the xyphase array. You must enter one value per antenna for each frequency. If you have more than one frequency, you must enter XY phases for all six antennas, even if you do not have antenna 6 in the array during the observation (the XY phase value is not important for this antenna, of course). Note that even if the values are close to zero, you still should apply them. Applying a value of zero is different from not applying anything. Again, you must not convert to Stokes parameters.

    optype = 'load' Load the data
    aparm(1) =-1 Label as circular
    cparm(4) =1 Use xyphase array and
      not the on-line values
    cparm(5) =1 Apply XY phase to Y gains
    xyphase Assign the XY phases here

  4. Now flag the data in the way you would normally do with the AIPS tasks SPFLG, TVFLG, IBLED, and UVFLG. Using SPFLG is highly recommended, particularly at 20 and 13 cm, to check for interference.

    For continuum work, to save disk space and to speed access to the data, you may consider averaging your channels together to form ``channel-0'' datasets, using task AVSPC. While this causes very little degradation for 3 cm observations, forming ``channel-0'' results in bandwidth smearing in 13 and 20 cm observations, and so is probably inadvisable for high dynamic range work there. For high dynamic range work at 6 cm, it is debatable whether averaging is detrimental. If in doubt, do not average. It is always possible to form a channel-0 dataset later anyway.

    One other consideration in determining whether or not to average is whether or not you are going to apply XY phase corrections with task atxy. For obscure reasons, if you used AIPS ATLOD, atxy needs to know the ``sideband indicator'' of the data. The sideband indicator, which is $\pm 1$, is copiously reported by ATLOD, both in its output to the terminal, and in the history file. The sideband indicator also happens to be the sign of the channel frequency increment. This is how atxy normally determines them. However, if you form a channel-0 dataset, the sign of the frequency increment is lost! So if you give atxy a channel-0 dataset, you will also have to tell it the sideband indicators. You must give it a sideband indicator for each IF. Provided the sideband indicator remains constant with time, this is little more than an annoyance. However if the sideband indicator varies with time, you are in some trouble. Overall it is best not to form channel-0 datasets if you used AIPS ATLOD and you are going to use atxy.

    After flagging (and possibly averaging), write your data as a FITS file using FITTP. It is probably most convenient to write out a multi-source file. At this stage you have no calibration - only flagging tables (which you can apply in Miriad later).

  5. Read the data into Miriad using fits. Task fits does not apply AIPS flagging tables (FG tables). Instead you have to use another task to do this - fgflag. Tasks fits and fgflag are discussed in Chapters 8 and 10 respectively, although they are usually fairly straight forward. An exception is for spectral line observations, where the velocity system should be defined with fits - see Chapter 16.

    in=MULTI.FITS FITS multi-source file to be loaded into Miriad
    op=uvin Read uv data in
    out=multi.uv The output Miriad dataset.

    vis=multi.uv Apply AIPS flagging table to the data.

    At this stage it is worth running uvindex. This produces a summary of your dataset, which you should probably save in a log file. Inspect this summary carefully, particularly the frequencies (especially in fits complained about inconsistent frequency definitions). If the frequency information looks incorrect, read Chapter 8 more carefully and/or seek help.

    vis=multi.uv Dataset to summarise.
    log=multi.log Output log file.

  6. Skip this step if you have only measured two polarisation products. Otherwise now is the time to apply your XY phases to the data if you have not already done so with AIPS ATLOD. As mentioned above, the task to do this is atxy. If you used AIPS ATLOD, you should also have XY phase text file that it produced. Let us discuss the various input parameters: Typical inputs to atxy are given below

    vis=multi.uv The input dataset.
    xyphase=XYPHS_56 The input AIPS ATLOD XY
      phase text file, or
    xyphase leave unset if Miriad atlod was used.
    refant=3 Correct antenna 3 in time varying way.
    interval=# Solution interval. Default is 30 min
    sideband Sideband indicator. Leave unset for
      multi-channel data.
    out=multi.uvxy Output XY phase corrected data.

Miriad manager