B.1 Editing and calibrating spectral-line data

B.1.1 Loading the data

(1)

Go to the VLA archive web page at

     https://data.nrao.edu/

log in wih your my.nrao.edu account and locate the desired data set using the basic retrieval tool. Use the observing date, program code, or observer’s name to locate the data. If the data are within the proprietary period (usually 6 months), you will be allowed access only if your login is recognized as an owner. Select the data file(s) desired and ask for them with AIPS-friendly names. Wait for the e-mail notification that the files are ready and then follow the supplied advice to copy the data files to your computer.

   

(2)

Before starting AIPS, create an environment variable pointing at the disk directory containing the data files. Use cd < data_area > followed by setenv MYDATA ‘pwd‘ if you use C-shell or its variants or export MYDATA=‘pwd‘ if you use the bash shell. (Note the back tick marks surrounding the pwd.) Then start AIPS.

   

(3)

Load the data from the archive file(s) to AIPS data areas. Use the defaults to load the data without further averaging. The m disk files will be named < program_name > _i   for i = n + 1,,n + m.

     VLAOBS < program_name >’ ; DOWEIGHT 1

     NFILES n ; NCOUNT m

     DATAIN ’MYDATA:< program_name > _

  FILLM

The data loaded to disk will normally be in two parts: One will have the class “CH0” and the other will have the class “LINE.” The names of the files are thus

     DATE.CH0

     DATE.LINE

where “DATE” is the date the observations began. Each file is a multi-source file, containing observations for all your sources: flux calibrators, phase calibrators, and target sources. Your spectral-line data are contained in the LINE file, while the CH0 file is a “pseudo-continuum” file; it is the average of the inner 75% of the bandpass and will be used for gain and phase calibration.

 

(4)

List the “scan summaries” from the CH0 data. Keep the output for future reference. Note that the frequency in the header of a multi-source file is always the sky frequency in the center of the band of the first scan of the observation (see §B.4).

     OPTYPE SCAN’ ; DOCRT -1 ; OUTPRINT ’ ’

to print on the line printer. To make a text file instead

     OUTPRINT ’MYDATA:< filename_in_all_caps >

  LISTR

(5)

Print the antenna configuration file. Keep the output for future reference.

  PRTAN

B.1.2 Inspecting and editing the data

There are a number of different ways to isolate and edit bad uv points from your data set. The method described below is typical. Other tasks of interest can be found by typing ABOUT EDITING and ABOUT UV and by consulting §4.3.5, §O.1.6, §4.3.11, §5.5.2, §10.2.2, and §4.3.13 in the AIPS CookBook.

(6)

Plot amplitude versus baseline length for your flux and phase calibrators. Inspect each source, Stokes, and IF separately. Set XINC so there are only a few thousand visibilities on the output plot (the total number of visibilities is listed on the scan summary sheets from Step 4). Use the TV to save trees.

     BPARM 0 ; DOTV 1

If there are anomalous amplitude points, continue to the next step. If your data points have a small scatter, you may not need to edit and can skip to calibration (Step 10).

  UVPLT

(7)

Determine if the anomalous data points are from a particular baseline, antenna, Stokes, or IF, inspecting each Stokes and IF separately. The output of this task will be all points that have anomalous amplitudes, based on your selection criteria.

     OPCODE CLIP’ ; APARM(1) < max_flux >

     APARM(3) < min_flux >

  UVFND

(8)

Once you have determined which data points to flag with UVFND, flag them with UVFLG. You can flag by time-range, baseline, or antenna and you can flag any or all of the Stokes parameters or IFs. To assist in undoing flags, set a REASON.

     OPCODE FLAG’ ; OUTFGVER 1

  UVFLG

(9)

Examine the uv data for your calibrators on the TV to check for any obvious problems which you might have missed; see §O.1.6. Check each IF and each Stokes separately and edit the data more carefully, if necessary, before continuing.

     DOCAL -1 ; CALCODE ’*’ ; FLAGVER 1

  TVFLG

B.1.3 Calibrating the data

Steps 10–15 should be applied to the CH0 data alone, not to the LINE data. To ensure that all inputs are set to their defaults before continuing, type

     RESTORE 0

Then, when you are satisfied with your editing, type

     RUN VLAPROCS

to set up VLA-specific parameters and procedures for calibration. You may turn all adverbs for a specific < task > to their default values with

     DEFAULT < task >

If you have multi-frequency data, each frequency must be calibrated separately; this can be done by specifying the FREQID parameter in each task (see §B.4). More information on calibrating your data can be found by typing ABOUT CALIBRAT and HELP CALIBRAT and consulting Chapter 4.

(10)

Calculate the flux of the primary flux calibrator for the channel zero (CH0) data.

     SOURCE < flux_calibrator >’ , ’ ’ ; OPTYPE CALC

  SETJY

(11)

Calculate gain and phase solutions for all of the calibrators. In this case, you must run this procedure once for each source. Check for the presence of an appropriate model with CALDIR. For those sources having a model

     DOCALIB 1 ; UVRANGE 0 ; ANTENNAS 0

     CALSOUR < flux_calibrator_1 >’ , ’ ’

For sources without a model, choose a UVRANGE according to the tables in the VLA Calibration Manual. You may do more than one source at a time, if they have the same UVRANGE. The output of this procedure is a solution (SN) extension table, which is printed automatically. Select a reference antenna (REFANT) which did not have any problems during the observing run and which is located near the center of the array.

     DOCALIB 1 ; UVRANGE < uv_min > , < uv_max >

     CALSOUR < calibrator_1 >’ , , ’< calibrator_n >

     DOPRINT 1; OUTPRINT < filename_in_all_caps >

The output from VLACALIB will include a list of closure errors. If there are too many large errors, edit your data carefully using UVFND, TVFLG, or LISTR as described above. Destroy old SN tables with EXTDEST and then re-run VLACALIB until the solutions are satisfactory. The output will include amplitudes and phases for each baseline; for each calibrator, the amplitudes should be approximately constant and the phases should vary smoothly over time.

  VLACALIB

(12)

Calculate the flux densities of the secondary (phase) calibrators from the primary (flux) calibrator, based upon the flux densities in the source (SU) table and the antenna gain solutions in the solution (SN) table. Destroy bad or redundant versions of the SN tables before using this task. Compare the computed fluxes with those listed in the VLA Calibration Manual.

     SOURCES < phase_cal_1 >’ , , ’< phase_cal_n >

     CALSOUR < flux_cal >’ , ’ ’

  GETJY

(13)

This procedure interpolates the solutions derived from the calibrators into the calibration (CL) table for all sources. Run this procedure once for each phase calibrator (which may be used to calibrate multiple sources).

     SOURCES < phase_cal >’ ,’< source_1 >’ , , < source_n >

     CALSOUR < phase_cal >’ , ’ ’

     OPCODE CALI’ ; INTERPOL ’2PT’

     OUTPRINT < filename_in_all_caps >

Note: if you are observing at low frequencies or there are gaps in your observations of phase calibrators, you may want to use SAMPTYPE BOXand review the other inputs carefully. They have changed.

  VLACLCAL

(14)

Apply the calibration to the phase calibrators and examine the amplitudes, which should be nearly constant, and the phases, which should be nearly zero.

     SOURCES ’ ’ ; CALCODE ’*’  print results for all calibrators

     OPTYPE ’MATX’ ; DOCALIB 2 ; GAINUSE 2; DPARM 5, 1, 0

     UVRANGE 0 ; DOCRT -1 ; OUTPRINT < filename_in_all_caps >

  LISTR

(15)

Examine the uv data for your sources on the TV to check for any obvious problems which you may have missed. Re-edit the data (Steps 6–9) if necessary.

     DOCAL 2 ; GAINUSE 2 ; CALCOD ’-CAL’

If you have too many visibilities to fit on the TV screen, you may want to set TIMERANG, SOURCES or DPARM(6) (the input averaging time) to limit the amount of data displayed. There are also interactive options to set the on-screen averaging time and the time range currently displayed.

  TVFLG

(16)

To calibrate the spectral-line data, simply copy the calibration (CL) table from the CH0 to the LINE data.

     INEXT ’CL’ ; NCOUNT 1 ; INVERS 2

Also be sure to copy the flagging (FG) table

     INEXT ’FG’ ; INVERS 1

  TACOP

Steps 17 and 18 should be applied to the LINE data alone, not to the CH0 data

(17)

Calibrate the bandpass for the LINE data using the primary (flux) calibrator. The output from this task is a table (BP) of the bandpass spectrum.

     GET3NAME < CH0data >

     CALSOUR < flux_cal >’ , ’ ’; CALCODE ’*’

     DOCALIB -1 ; FLAGVER 1

  BPASS

(18)

Examine the bandpass for each of the antennas on the TV.

     APARM(8) 2 ; DOTV 1 ; STOKES ’RR’

     ANTENNAS 0 ; NCOUNT 4 plot 4 antennas at a time

Then do the LL Stokes. After this, generate a plot (PL) file of the total bandpass for each Stokes.

     NCOUNT 0 ; DOTV -1

  POSSM

Plot the bandpass on the laser printer; specify PLVER for each Stokes.

  LWPLA

(19)

Now that the calibration is completed, write the calibrated CH0 and LINE data to tape.

  FITTP

Print the contents of the tape(s) for your data.

  PRTTP

(20)

Apply the calibration and editing tables, writing single-source uv files for imaging.

     CALCODE ’-CAL’ write uv for all non-calibrator sources

     DOCALIB 2; GAINVER 2 ; DOBAND 1; BPVER 1

  SPLIT