8.1 Data preparation and assessment

In the following sections, it is assumed that the uv data are on disk and that the basic calibrations have been applied to them. If your data are not currently on disk, you will need to read them in from magnetic tape or FITS disk files. For tape, mount the tape in hardware and software (3.9) and then position the tape to the desired data files:

> NFILES n ; AVFILE  C R

to advance n files.

> TPHEAD  C R

to check that the tape is correctly positioned.

Use FITLD to read in the data:

> TASK FITLD’ ; INP  C R

to review the inputs.

> OUTCL  ’ ; OUTN    C R

to use the file names recorded on tape (the default).

> NFILES 0  C R

to read the current file on tape.

> NCOUNT 2  C R

to load two files (if desired).

> GO  C R

to run FITLD.

For FITS disk files, set DATAIN appropriately and the run FITLD. Examine the uv data set header with IMHEAD after FITLD finishes. It should show multiple pixels on the FREQ axis, like the uv header illustrated in 3.3.4.

If your data are not yet calibrated, consult Chapter 4, especially 4.7. When the CL, BP, and other calibration tables are complete, apply them to the line data with SPLIT:

> TASK SPLIT  C R

> SOURCE sou1’ , ’sou2’ ,  C R

to select sources, ’ ’ means all.

> TIMERANG 0  C R

to keep all times.

> BIF 1 ; EIF 0  C R

to keep all IFs.

> BCHAN 1 ; ECHAN 0  C R

to keep all spectral channels.

> FREQID 1  C R

to set the one FQ value to use.

> DOCALIB TRUE  C R

to apply calibration.

> GAINUSE 0  C R

to use the highest numbered CL table.

> FLAGVER 1  C R

to apply the flag table.

> DOPOL TRUE  C R

to correct for feed polarization.

> DOBAND 1  C R

to correct bandpass.

> BPVER 1  C R

to select BP table to apply.

> STOKES ’ ’  C R

to write the input Stokes type.

> DOUVCOMP TRUE  C R

to write visibilities in compressed format.

> APARM 0  C R

to clear VLBA options, including the one to calibrate the data weights.

> INP  C R

to review the inputs.

> GO  C R

to run the program when inputs set correctly.

The uv data produced by this process should have applied to them the full calibration and editing determined from the calibration sources. Whether these are adequate or will need to be enhanced from the source data themselves is now to be determined.

Your data may need to be edited further at this point. If your calibrator data were almost free of problems, save for simple matters like dead antennas, then your source data are not likely to need much editing either. If your calibrator data required detailed and erratic data flagging, then your source data will also need attention. All of the considerations of 4.4 apply here too. In either case, the first step is to check for narrow-band interference which is a fairly common problem at some wavelengths. The best task for this is SPFLG (10.2.2), a spectral-line version of TVFLG (4.4.3). SPFLG displays spectral channels for all IFs along the horizontal axis and time along the vertical axis, one baseline at a time. This is tedious to use for editing all of the data from a large interferometer. Instead, select a few of the shorter baselines (with the ANTENNAS and BASELINE adverbs) and do a quick check for interference. If your data has sufficient signal-to-noise, then this quick examination should let you check which channels have signal and whether the Galaxy, for example, has contributed unwanted signal to your data. If you find significant terrestrial interference, you may flag the bad data with SPFLG (consider using the “ALL-BL” option to avoid looking at hundreds of baselines) or with UVFLG (entering “by hand” what you find with SPFLG). Tasks UVLIN and UVLSF (below and 8.3) both offer the option to flag all channels of a particular sample if any one channel in the continuum-fitting portion of the spectrum has excessive flux after the fit. UVLSF also offers the option to flag when the rms of the continuum fit is excessive. The task CLIP (5.5.1) works in a channel-dependent way on line data. It can be instructed to flag a full spectrum if more than a user-specified number of channels are flagged in that spectrum. FLGIT is designed to work on line data sets that have a great deal of interference, generating channel-dependent flagging in the output file or in a flag table. UVMLN may also be used to generate flag tables for multi- and single-source files to flag seriously deviant data. FLAGR uses multi-channel data to estimate rms and flags any times having excessive rms, amplitude, weight, etc. RFLAG will flag data in detailed ways based on excessive variablility in time and/or frequency. REFLG will compress the large flag table made by RFLAG. UVCOP will apply even a very large flag table if so instructed. These tasks will eliminate certain classes of problems without bothering you with the details, which may — or may not — be a good thing.

To do serious editing of a non-spectral nature and to do self-calibration, you will need to create a single-channel data set that represents your multi-channel data in some fashion. If your data contains little continuum signal, but does have a strong spectral-line signal, then use UVCOP to copy the data for the channel with the strongest signal to a single-channel data set. Alternatively, the task AVSPC may be used to average a few adjacent channels together to create the single-channel data. If, on the other hand, your data set contains a useful level of continuum emission — and most do — then your single channel should be some estimate of this continuum. If your line signal is weak and you have done no frequency-dependent editing, then you can use the so-called “channel-0” data set created by FILLM when you first loaded your VLA data to disk. This data set is the vector average of the center 3/4 of the selected spectral channels, but remains useful only if you have applied all of the same calibration, editing and SPLITing to it that you applied to the line data. It may be safest to create a new continuum estimate from the line data in any case. The classical method for doing this is the task AVSPC:

> TASK AVSPC’ ; INP  C R

to review the inputs needed.

> IND m ; GETN n  C R

to specify the input uv file.

> CLRONAME  C R

to use the default output names and disk.

> AVOPT  ’  C R

to average channels only within IFs.

> ICHANSEL b1 , e1 , i1 , if1 , b2 , e2 , i2 , if2 ,  C R

  to average every i1 channel from b1 through e1 in IF if1, plus every i2 channel from b2 through e2 in IF if2, etc.

> ICHANSEL 10 , 50 , 1, 0, 81 , 119 , 1  C R

e.g., average channels 10 through 50 and 81 through 119 in each IF, omitting the band edges and the channels with line signal.

> INP  C R

to review the inputs.

> GO  C R

to run the program when you’re satisfied with inputs.

A non-classical method for estimating the continuum is provided by the task UVLSF It fits a linear “spectral baseline” in the real and imaginary parts of each visibility spectrum. By adding a slope to the channel-independent bias found in AVSPC, it allows for small changes in the continuum visibility with frequency and spatial resolution across the observed band, as well as small, time-variable changes in the spectral passband not fully removed by BPASS. The option to fit even higher order baselines was added. These are seldom useful and can run into problems since they are not constrained by data in the channel ranges containing the line signals. The principal output of UVLSF is a multi-channel data set with this baseline subtracted, i.e., a continuum-free line data set. However, the user may also get a single-channel “continuum” data set evaluated at any one channel from the fit baselines. Thus:

> TASK UVLSF’ ; INP  C R

to review the inputs needed.

> IND m ; GETN n  C R

to specify the input uv file.

> CLRONAME  C R

to use the default output names and disk.

> BCHAN 0 ; ECHAN 0  C R

to include all channels.

> ICHANSEL b1 , e1 , i1 , if1 , b2 , e2 , i2 , if2 ,  C R

  to average every i1 channel from b1 through e1 in IF if1, plus every i2 channel from b2 through e2 in IF if2, etc.

> DOOUTPUT TRUE  C R

to get the continuum data set.

> CHANNEL 0  C R

to select the channel at which the baseline is evaluated — in this case, the default which is the reference channel. Choose one near the center of the band.

> INP  C R

to review the inputs.

> GO  C R

to run the program when you’re satisfied with inputs.

The continuum data set will have AIPS class BASFIT and be on the same disk as the output line data set. You may also use UVLSF to flag data with excessive residual flux and rms in the channels used for the fitting. You may apply the usual data selection and calibration and flag tables to the input data, meaning that SPLIT need not have been run on the data previously. Note that neither AVSPC nor UVLSF should be used if the continuum visibility changes substantially across the passband, due to large bandwidth and complexity in the continuum source. If the phase of the continuum changes substantially across the passband due to the centroid of the continuum being considerably separated from the pointing center, you should instruct UVLSF to shift the phase reference position before fitting the linear function and then to shift the phases back afterwards.

Your spectral-line data may need further modification and preparation. If you did not observe with “Doppler tracking” (and even the VLA changes frequency only on a scan-by-scan basis), then your data channels are not at the same velocity through the data set. Task CVEL may be used to convert the data to full Doppler tracked form, or simply to shift the center velocity of your reference channel to, for example, the velocity used in another data set. CVEL works on multi-source as well as single-source data sets. It applies any flagging and bandpass calibration to the data before shifting the velocity (which it does by a carefully correct Fourier transform method). Note, the use of Fourier-transforms means that one must not use CVEL an data with channel separations comparable to the widths of some of the spectral features.

Three other tasks allow you to change the number of spectral channels in your data set. The simplest, AVSPC, allows you to average every n adjacent channels together, producing a data set one nth as large. The wsecond, called SPECR, uses Fourier transform methods to increase or decrease the number of channels with a corresponding change in channel spacing. In 31DEC14, SPECR can also use simple interpolation methods in case the Fourier methods produce undesirable results (such as ringing when a feature is very narrow in the input data set). The third task, new in 31DEC15 is called UVFRE and it attempts to convolve the data from one frequency structure onto another frequency structure defined in a second data set (the uv equivalent of HGEOM). These tasks, along with CVEL may be required to convert one data set to the same channel velocity and separation as another data set, before the two can be concatenated (task DBCON) and used together in imaging. If simple frequency smoothing is needed, the calibration routines will apply various convolutions to the spectrum under control of the adverb SMOOTH. IMAGR, allows you to “average” channels together by gridding them into the correct (channel-dependent) locations in the uv plane. This is seldom important to narrow-band observations, but is critical in wide “bandwidth synthesis” observations. Nonetheless, it allows you to keep full spectral resolution in the uv data set, but abandon it for some or all of the imaging.