Saturday, June 30, 2007

self-calibration subtleties : 2 questions


  • i have a dataset which shows significantly different structure depending on the weighting (robust value) used when i image it. should i self-cal using maps with a natural weighting that show the diffuse emission or maps with a more uniform weighting which emphasize the point sources? i'm inclined to use a robust value around 0 because i feel like the point sources are more reliable self-cal targets (and contribute more flux) even though what i really care about is the diffuse stuff and the maps i make for the analysis will use a robust > 0.


  • do i always need to self-cal using clean components from the entire primary beam even if the source i care about is only in the inner 15%? since it does seem true that "the best self-cal model is the one that contains the most flux" i think i am obligated to image the entire primary beam during self-calibration.



Read more!

Wednesday, June 20, 2007

Reference Frequencies (Center v. Edge?)

I've come to the conclusion that for 1-channel continuum data coming from the VLA, the frequency that you see in the header and in your LISTR 'scans' ouput is the center of your bandwidth (not the beginning).

I come to this conclusion mostly because the L-band observing guide on the VLA web page says that "The two recommended center frequencies are 1365 and 1435 MHz." I used the defaults when I made my observe files, and now my LISTR output lists these two frequencies.

EDIT: June 21 2007
And these words from Eric Greisen

In FITS coordinates, the stated coordinate is at the center of each
voxel. It may be moved by having a non-integer reference pixel. In
normal VLA data we do not do that, so these frequencies are nominally
at the center of your band. I say nominally, because if the bandshape
is not symmetric about the center, then the effective frequency will
diverge from the one stated. True astrometry should never be done
with wide, asymmetric bandshapes (and the VLA at 50 MHz is
asymmetric).

Read more!

Tuesday, June 19, 2007

Where did R go?

Ok, this is kind of a strange thing. I'm working with Pband data. I've gone through initial flagging, and then I run CALIB. But for some reason it's not finding my R data... so I get 1/2 good solutions and 1/2 failed solutions (because it finds the L just fine). But I look at the data (and when I flagged it too) and it's *there*. Has anyone encountered this? What's going on and how to I fix it? I'm using pretty standard inputs...

Read more!

Thursday, June 14, 2007

Reference Frequencies (AIPS v. Miriad)

I went back and reviewed my early post; this is an update, with a few more details.

I've been working with GMRT data reduced in AIPS, and ATCA data reduced in MIRIAD.
It turns out that (at least for GMRT observations) AIPS gives the reference frequency (in imhead or prtan) as the frequency in the middle of the first channel, whereas Miriad gives the reference frequency (in prthd or uvlist, options=spectral) as that measured at the end of the first channel. But don't freak out yet--the channels still contain the same data, they are just identified differently in AIPS vs Miriad. See "read more" for details.


It's relatively easy to see from reading the headers, so I'm not sure why this caused me trouble when I first posted it (notice the "at Pixel" in the AIPS header):

From AIPS:


AIPS 1: Image=NGC2997 (UV) Filename=15JAN .UVLIN . 1
AIPS 1: Telescope=GMRT Receiver=GMRT
AIPS 1: Observer=PISANO User #= 43
AIPS 1: Observ. date=14-JAN-2007 Map date=18-APR-2007
AIPS 1: # visibilities 325734 Sort order TB
AIPS 1: Rand axes: UU-L-SIN VV-L-SIN WW-L-SIN BASELINE TIME1
AIPS 1: WEIGHT SCALE
AIPS 1: ----------------------------------------------------------------
AIPS 1: Type Pixels Coord value at Pixel Coord incr Rotat
AIPS 1: COMPLEX 1 1.0000000E+00 1.00 1.0000000E+00 0.00
AIPS 1: STOKES 2 -1.0000000E+00 1.00 -1.0000000E+00 0.00
AIPS 1: FREQ 128 1.4129999E+09 0.50 3.1250000E+04 0.00
AIPS 1: IF 1 1.0000000E+00 1.00 1.0000000E+00 0.00
AIPS 1: RA 1 09 45 38.811 1.00 3600.000 0.00
AIPS 1: DEC 1 -31 09 27.768 1.00 3600.000 0.00
AIPS 1: ----------------------------------------------------------------
AIPS 1: Coordinate equinox 2000.00
AIPS 1: Rest freq 0.000 Vel type: RADIO wrt YOU
AIPS 1: Alt ref. value 0.00000E+00 wrt pixel 1.00
AIPS 1: Max version number of extension files type HI is 1
AIPS 1: Max version number of extension files type FQ is 1
AIPS 1: Max version number of extension files type AN is 1


From MIRIAD:


****************************************************************
Filename: 15jan.uvlin/
Telescope: GMRT
Object: ngc2997 Observer: PISANO
First time: 07JAN15:18:31:06.8
Number of antennae: 30
Polarisations Present: RR,LL
Type of correlations present: crosscorrelation
----------------------------------------------------------------
Spectral Correlations:
Spectrum Channels Freq(chan=1) Increment Restfreq
1 128 1.41302 0.000031 1.42041 GHz
Total number of correlations: 83387904
Correlations are stored in 16-bit form
----------------------------------------------------------------
J2000 Source RA: 9:45:38.811 Dec: -31:09:27.76
Apparent Source RA: 9:45:58.554 Dec: -31:11:18.61


As a side note, when checking the reference freq in AIPS check the outputs of both imhead and prtan--an AIPS bug is that occassionally they don't match!
From Chapter 8 of the AIPS cookbook:
"Another, more serious, problem is that two locations in the FITS file give the "reference frequency" -- the header and the antenna table. In principle these should agree. However there are instances when they will differ. Task FITS will issue a warning when this happens, and will use the antenna table reference frequency as the true reference frequency. In some cases this will be the correct frequency. In others it will not."...pg 8-7

**Note, this is now consistent with one of Laura's later posts (Edited by KMH 9/6/07).

Read more!

Tuesday, June 12, 2007

Tricky, Tricky FOR Loops

I was just trying to write a FOR loop which would run UVCOP many times. When I ran

for i = 1 to 10; bchan i; echan i; go uvcop; end

AIPS would set bchan and echan to 1, then it would run UVCOP once, then it would set bchan and echan to 2, and end the FOR loop. I really didn't know what the problem was-- this loop should work. Then Eric told me this trick: put WAIT before the END, so that now your loop looks like this:

for i = 1 to 10; bchan i; echan i; go uvcop; wait; end

I guess what was happening was that the loop was continuing on before uvcop had finished running, and the loop was getting all confused. It worked with a WAIT!


Read more!

Monday, June 11, 2007

XYZ

What does AIPS consider the x, y, and z axes? For example, XSMTH smoothes your data along the x axis. What on earth does this mean? I would think the z axis would be velocity.


Read more!

Tarballs?

Is there a way to read out a whole bunch of files from AIPS at once? My hard drive on my laptop is getting full, so I wanted to tar up all the files from a reduction of one of my galaxies, read it out to a fits file, and scp it over to my work computer. Is there a way to do this, or do i have to run FITTP on each file individually?


Read more!

Friday, June 8, 2007

File Sizes

Anybody know how to figure out how much hard drive space each aips file is taking up? I can look in the DATA directory, but all the names are written in code there. It would be so much nice if there was an actual aips command.


Read more!

Monday, June 4, 2007

WBR Step 6L: Calibration

Calibration is usually a somewhat iterative process. I will lightly flag my calibrator, then calibrate the calibrator, then see if any new funky looking data points have appeared. If they have, I will flag again and calibrate again. Wash, rinse, repeat until no funky data points show up.

So how do you calibrate your data anyway?


Assuming you've lightly flagged your phase and flux calibrators, according to Step 5, now we're ready to run SETJY. SETJY basically just writes to your data the most accurate flux for your flux calibrator. Important parameters to consider here:
--SOURCES '1331+305', '0137+331', or '0542+498' (whichever one you used. sometimes you will have two different flux calibrators, and you can enter them both here.
--OPTYPE 'CALC'


AIPS 1: SETJY Task to enter source info into source (SU) table.
AIPS 1: Adverbs Values Comments
AIPS 1: ----------------------------------------------------------------
AIPS 1: INNAME 'AC825_FQ1' Input image name (name)
AIPS 1: INCLASS 'CH 0' Input image name (class)
AIPS 1: INSEQ 1 Input image name (seq. #)
AIPS 1: INDISK 1 Input image disk unit #
AIPS 1: SOURCES '1331+305' Sources to modify.
AIPS 1: *rest ' '
AIPS 1: QUAL -1 Source qualifier -1=>all
AIPS 1: BIF 0 Low IF # for flux density
AIPS 1: EIF 0 High IF # for flux density
AIPS 1: ZEROSP *all 0 I,Q,U,V flux density (Jy)
AIPS 1: OPTYPE 'CALC' ' ' => use other adverbs
AIPS 1: for required operation
AIPS 1: 'CALC' => determine
AIPS 1: 3C286/3C48/1934 fluxes from
AIPS 1: standard formulae
AIPS 1: 'REJY' => reset source
AIPS 1: fluxes to zero.
AIPS 1: 'REVL' => reset velocity
AIPS 1: to zero
AIPS 1: 'RESE' => reset fluxes &
AIPS 1: velocities to zero.
AIPS 1: CALCODE ' ' New calibrator code:
AIPS 1: '----' => change to blank
AIPS 1: SYSVEL 0 Velocity of source (km/s)
AIPS 1: RESTFREQ 0 0 Line rest frequency (Hz)
AIPS 1: VELTYP ' ' Velocity type 'LSR,'HELIO'
AIPS 1: VELDEF ' ' Velocity definition 'RADIO',
AIPS 1: 'OPTICAL'
AIPS 1: FREQID 0 FQ table entry to use for
AIPS 1: velocity information and
AIPS 1: 'CALC' option
AIPS 1: APARM *all 0 (1): Pixel to which SYSVEL
AIPS 1: refers ( 0=>1)
AIPS 1: (2): Only for 'CALC' option:
AIPS 1: <= 0 => use latest VLA
AIPS 1: values (1999.2) or,
AIPS 1: for 1934-638, the
AIPS 1: ATCA value of 30Jul94.
AIPS 1: 1 => use Baars values
AIPS 1: or old ATCA/PKS values
AIPS 1: for 1934-638
AIPS 1: 2 => use VLA 1995.2
AIPS 1: values or for 1934-638
AIPS 1: the ATCA value of
AIPS 1: 30Jul94.
AIPS 1: >= 3 => use oldest VLA
AIPS 1: values (1990) or,
AIPS 1: for 1934-638, the
AIPS 1: ATCA value of 30Jul94.
AIPS 1: (3): Only for 'CALC' option:
AIPS 1: multiply the calculated
AIPS 1: fluxes by APARM(3) with
AIPS 1: 0 -> 1


Now it's time to run calib!
(I wouldn't use VLACALIB (like the AIPS cookbook tells you too) because some parts of VLACALIB are a bit of a black box, and can set certain parameters quite mysteriously (I've had it use SOLINT = 400 before, for no good reason).

Run calib on your flux calibrator first. Here are some parameters you should definitely worry about and set:
CALSOUR '1331+305' (name of flux calibrator)
UVRANGE (find this in the VLA calibrator manual. the best calibrators are ones where you don't have to set this.)
DOCALIB 2 (apply weights)
REFANT 6 (you chose a refant in step 3, use it!)
SOLINT 1 (this is how often to solve for a calibration solution. 1 seems to work well often.)
SOLMODE 'A&P' (calibrate amplitudes and phases)

AIPS 1: CALIB: Task to determine calibration for data.
AIPS 1: Adverbs Values Comments
AIPS 1: ----------------------------------------------------------------
AIPS 1: Input uv data.
AIPS 1: INNAME 'AC825_FQ1' UV file name (name)
AIPS 1: INCLASS 'CH 0' UV file name (class)
AIPS 1: INSEQ 1 UV file name (seq. #)
AIPS 1: INDISK 1 UV file disk drive #
AIPS 1: Data selection (multisource):
AIPS 1: CALSOUR '1331+305' Calibrator sources
AIPS 1: *rest ' '
AIPS 1: QUAL -1 Calibrator qualifier -1=>all
AIPS 1: CALCODE ' ' Calibrator code ' '=>all
AIPS 1: SELBAND -1 Bandwidth to select (kHz)
AIPS 1: SELFREQ -1 Frequency to select (MHz)
AIPS 1: FREQID 1 Freq. ID to select.
AIPS 1: TIMERANG *all 0 Time range to use.
AIPS 1: BCHAN 0 Lowest channel number 0=>all
AIPS 1: ECHAN 0 Highest channel number
AIPS 1: ANTENNAS *all 0 Antennas to select. 0=all
AIPS 1: DOFIT *all 0 Subset of ANTENNAS list for
AIPS 1: which solns are desired.
AIPS 1: ANTUSE *all 0 Mean gain is calculated
AIPS 1: (CPARM(2)>0) using only the
AIPS 1: listed antennas. See explain.
AIPS 1: SUBARRAY 0 Subarray, 0=>all
AIPS 1: UVRANGE 0 0 Range of uv distance for full
AIPS 1: weight
AIPS 1: WTUV 0 Weight outside UVRANGE 0=0.
AIPS 1: WEIGHTIT 0 Modify data weights function
AIPS 1: Cal. info for input:
AIPS 1: DOCALIB 2 If >0 calibrate data
AIPS 1: = 2 calibrate weights
AIPS 1: GAINUSE 0 CL table to apply.
AIPS 1: DOPOL -1 If >0 correct polarization.
AIPS 1: BLVER -1 BL table to apply.
AIPS 1: FLAGVER 1 Flag table version
AIPS 1: DOBAND -1 If >0 apply bandpass cal.
AIPS 1: Method used depends on value
AIPS 1: of DOBAND (see HELP file).
AIPS 1: BPVER 1 Bandpass table version
AIPS 1: SMOOTH *all 0 Smoothing function. See
AIPS 1: HELP SMOOTH for details.
AIPS 1:
AIPS 1: CLEAN map. See HELP.
AIPS 1: IN2NAME ' ' Cleaned map name (name)
AIPS 1: IN2CLASS ' ' Cleaned map name (class)
AIPS 1: IN2SEQ 0 Cleaned map name (seq. #)
AIPS 1: IN2DISK 0 Cleaned map disk unit #
AIPS 1: INVERS 0 CC file version #.
AIPS 1: NCOMP *all 0 # comps to use for model.
AIPS 1: 1 value per field
AIPS 1: FLUX 0 Lowest CC component used.
AIPS 1: NMAPS 0 No. Clean map files
AIPS 1: CMETHOD ' ' Modeling method:
AIPS 1: 'DFT','GRID',' '
AIPS 1: CMODEL ' ' Model type: 'COMP','IMAG'
AIPS 1: SMODEL *all 0 Source model, 1=flux,2=x,3=y
AIPS 1: See HELP SMODEL for models.
AIPS 1:
AIPS 1: Output uv data file.
AIPS 1: OUTNAME ' ' UV file name (name)
AIPS 1: OUTCLASS ' ' UV file name (class)
AIPS 1: OUTSEQ 0 UV file name (seq. #)
AIPS 1: OUTDISK 0 UV file disk drive #
AIPS 1:
AIPS 1: Solution control adverbs:
AIPS 1: REFANT 6 Reference antenna
AIPS 1: SOLINT 1 Solution interval (min)
AIPS 1: SOLSUB 0 Solution subinterval
AIPS 1: SOLMIN 0 Min solution interval
AIPS 1: APARM *all 0 General parameters
AIPS 1: 1=min. no. antennas
AIPS 1: 2 > 0 => data divided
AIPS 1: 3 > 0 => avg. RR,LL
AIPS 1: 5 > 0 => avg. IFs.
AIPS 1: 6=print level, 1=good,
AIPS 1: 2 closure, 3 SNR
AIPS 1: 7=SNR cutoff (0=>5)
AIPS 1: 8=max. ant. # (no AN)
AIPS 1: 9 > 0 => pass failed soln
AIPS 1: Phase-amplitude Parameters:
AIPS 1: DOFLAG 0 Flag on closure error?
AIPS 1: SOLTYPE ' ' Soln type,' ','L1','GCON',
AIPS 1: 'R', 'L1R', 'GCOR'
AIPS 1: SOLMODE 'A&P' Soln. mode: 'A&P','P','P!A',
AIPS 1: 'GCON',
AIPS 1: SOLCON 0 Gain constraint factor.
AIPS 1: MINAMPER 0 Amplitude closure error
AIPS 1: regarded as excessive in %
AIPS 1: MINPHSER 0 Phase closure error regarded
AIPS 1: as excessive in degrees
AIPS 1: CPARM *all 0 Phase-amp. parameters
AIPS 1: 1 = Min el for gain
AIPS 1: normalization (deg)
AIPS 1: 2 >0 => normalize gain
AIPS 1: 3 avg. amp. closure err
AIPS 1: 4 avg. ph. closure err
AIPS 1: 5 >0 => scalar average
AIPS 1: 6 limit clipping in robust
AIPS 1: SNVER 0 Output SN table, 0=>new table
AIPS 1: ANTWT *all 0 Ant. weights (0=>1.0)
AIPS 1: GAINERR *all 0 Std. Dev. of antenna gains.
AIPS 1: BADDISK *all 0 Disk no. not to use for
AIPS 1: scratch files.

You will get some output that looks like this:

localh> CALIB1: Writing SN table 1
localh> CALIB1: RPOL, IF= 1 The average gain over these antennas is 3.080E+00
localh> CALIB1: RPOL, IF= 2 The average gain over these antennas is 3.088E+00
localh> CALIB1: LPOL, IF= 1 The average gain over these antennas is 3.033E+00
localh> CALIB1: LPOL, IF= 2 The average gain over these antennas is 3.086E+00
localh> CALIB1: Found 2321 good solutions
localh> CALIB1: Failed on 7 solutions

Some ways to tell if your data is really acting up is if you have tons of bad solutions (if you do, you might want to consider increasing your solint). Additionally, for some telescopes (not really for the VLA), if you have lots of bad solutions, you might have to tell CALIB to accept points of lower quality.
aparm(1) = 4 (CALIB default is a minimum of 6 antennas for a good solution, you could decrease it to 4.)
aparm(7) = 3 (CALIB default is a signal-to-noise in your solutions of 5. This is a bit high for some telescopes, and can reasonably be decreased to 3.)
soltype = 'L1' (this should be a more robust method for finding solutions (robust against outlying points). However, AIPS wants you to know that you will "lose some statistical efficiency". You could try other robust soltypes, too, but be warned they might be slow.)

Additionally, in my experience, it's a good thing that those 4 numbers (one for each polarization and IF) are all about the same (around 3.08). If one is really different than the others, than it might imply that their is bad data in that if/polarization.

All CALIB does is spit out a 'SN' table. The way we have it right now (SNVER = 0), every time you run CALIB it will spit out a new SN table. If you set SNVER = 1, every time you run CALIB, it would just append new information to this table.

Let's see if this calibration brought up any new bad data that needs to be flagged. If we want to apply calibration to our data in tasks like UVPLT and TVFLG, the calibration needs to be in a 'CL' table, not a "SN' table (yeah, stupid AIPS rule). To copy our 'SN' table to a 'CL' table, use VLACLCAL. First, you will need to type:

run vlaprocs

to load up the task VLACLCAL. Then set three important parameters. In this case, we'll use:
SOURCES = '1331+305' (the name of your flux cal)
CALSOUR = '1331+305' (the name of your flux cal)
REFANT = 6 (your reference antenna)

AIPS 1: VLACLCAL Procedure to run CLCAL and LISTR for VLA data.
AIPS 1: Adverbs Values Comments
AIPS 1: ----------------------------------------------------------------
AIPS 1: Use RUN VLAPROCS first
AIPS 1: INNAME 'AC825_FQ1' Input UV file name (name)
AIPS 1: INCLASS 'CH 0' Input UV file name (class)
AIPS 1: INSEQ 1 Input UV file name (seq. #)
AIPS 1: INDISK 1 Input UV file disk unit #
AIPS 1: SOURCES '1331+305' Source list to calibrate
AIPS 1: *rest ' '
AIPS 1: SOUCODE ' ' Source "Cal codes"
AIPS 1: CALSOUR '1331+305' Cal sources for calibration
AIPS 1: *rest ' '
AIPS 1: QUAL -1 Source qualifier -1=>all
AIPS 1: CALCODE ' ' Calibrator code ' '=>all
AIPS 1: FREQID 1 Unique frequency code
AIPS 1: TIMERANG *all 0 Time range to calibrate
AIPS 1: SUBARRAY 0 Subarray, 0=>all
AIPS 1: INTERPOL ' ' Interpolation function
AIPS 1: SAMPTYPE ' ' Smoothing function
AIPS 1: DOBLANK 0 Blanked value interpolation
AIPS 1: DOBTWEEN 1 > 0 -> smooth all sources
AIPS 1: together; else separate them
AIPS 1: SMOTYPE ' ' Data to smooth
AIPS 1: BPARM *all 0 Smoothing parameters
AIPS 1: ICUT .1 Cutoff for functional forms
AIPS 1: GAINVER 0 Input Cal table 0=>1
AIPS 1: GAINUSE 0 Output CAL table 0=>2
AIPS 1: REFANT 6 Reference antenna 0=>pick.
AIPS 1: DOPRINT 1 >0 Print messages to a file
AIPS 1: or to the printer.
AIPS 1: OUTPRINT *all ' ' Printer disk file to save
AIPS 1: BADDISK *all 0 Disks to avoid for scratch

This should write out a CL table 2. If you want to apply this caibration in, say, TVFLG, you would just use
DOCAL = 2
GAINUSE = 2
and that applies the CL table 2.

At this point, I also like to flag on phase. I've had a few data sets where amplitudes looks ok for the calibrators, but there are still some quite aberrant points in phase. In general, any points with phases > +/-10 degrees are probably bad (for your calibrators, which are point sources!!! unfortunately, you won't be able to flag on phase at all for your target source, because your target source will not be a point source and will therefore have phases running the whole gamut from -180 to +180 degrees.)

If you want to 'undo' the calibration (let's say because you flagged some data, and now you want to do a new and improved calibration and no longer need your old one), just delete your SN tables, and all CL tables which are greater than 1. BUT DON'T DELETE CL TABLE 1!!! This has important basic information in it.

When you think you have the very best calibration for your flux calibrator, I like to then repeat this same process for my phase calibrator. Iterate by running CALIB and VLACLCAL on your phase calibrator, and then flagging it until in uvplt there are very no aberrant points left in amplitude or phase. (Make sure you check each IF and each polarization!)

Now, when you trust your calibration/flagging for both your calibrators, Delete your SN tables and CL table #2. Let's do final runs of CALIB. At this point I set SNVER = 1 so that CALIB will write out solutions for both calibrators to the same SN table.
--Run CALIB on your flux calibrator.
--Run CALIB on your phase calibrator.

Now, run GETJY to get a flux for your phase calibrator. Parametrs to set:
SOURCES = your phase calibrator
CALSOUR = your flux calibrator

AIPS 1: GETJY Task to determine source flux densities.
AIPS 1: Adverbs Values Comments
AIPS 1: ----------------------------------------------------------------
AIPS 1: INNAME 'AC825' Input UV file name (name)
AIPS 1: INCLASS 'CH 0' Input UV file name (class)
AIPS 1: INSEQ 1 Input UV file name (seq. #)
AIPS 1: INDISK 1 Input UV file disk unit #
AIPS 1: SOURCES '1033+395' Source list to find fluxes
AIPS 1: *rest ' '
AIPS 1: SOUCODE ' ' Source "Cal codes"
AIPS 1: CALSOUR '1331+305' Cal sources for calibration
AIPS 1: *rest ' '
AIPS 1: QUAL -1 Source qualifier -1=>all
AIPS 1: CALCODE ' ' Calibrator code ' '=>all
AIPS 1: BIF 0 Lowest IF number 0=1
AIPS 1: EIF 0 Highest IF number
AIPS 1: TIMERANG *all 0 Time range of solutions.
AIPS 1: ANTENNAS *all 0 Antennas to use
AIPS 1: SUBARRAY 0 Subarray, 0=>all
AIPS 1: SELBAND -1 Bandwidth to select (kHz)
AIPS 1: SELFREQ -1 Frequency to select (MHz)
AIPS 1: FREQID 2 Freq. ID to select.
AIPS 1: SNVER 2 Input SN table, 0=>all.

You will get some output that looks like this:

localh> GETJY1: Task GETJY (release of 31DEC05) begins
localh> GETJY1: Source:Qual CALCODE IF Flux (Jy)
localh> GETJY1: 1033+395 : 0 A 1 .40437 +/- .00091
localh> GETJY1: 2 .39109 +/- .00074
localh> GETJY1: Appears to have ended successfully
localh> GETJY1: localhost 31DEC05 TST: Cpu= .0 Real= 0

At this point, what you want to worry about is the errors in the fluxes determined for your phase cal. If they are big, something has gone awry. What you do NOT need to worry about is if the fluxes are significantly different from those in the VLA calibrator manual. Remember that these calibrators are AGN-- they vary in flux!! Flux calibrators have been chosen because their fluxes are hopefully quite steady, but phase calibrators have only been chosen to be pointy. Their fluxes may vary. That's why you are comparing them with the flux calibrator, to get the best flux determination for them at the time of your observations!

A fun exercise is to look up your phase calibrator using this Java applet. It will show you how the flux of your calibrator has changed over time (their are only data points here when someone has actually used your phase calibrator for their VLA observations).

Finally, do final runs of VLACLCAL.
Do one run with
SOURCES = your phase cal, your target sources
CALSOUR = your phase cal
Do one more run with
SOURCES = your flux cal
CALSOUR = your flux cal
The defaults on VLACLCAL are smart enough to always output to CL table #2 (even if it already exists).

A good way to do a final check of your calibration (although it should be quite good if you have done it the iterative way I suggest!) is to run LISTR in 'MATX' mode.
OPTYPE = 'MATX'
SOURCES = your phase cal
DOCAL = 2
GAINUSE = 2
DPARM(1) = 5
DOCRT = -1
OUTPRINT = a file name

AIPS 1: LISTR: Task to print UV data and calibration tables.
AIPS 1: Adverbs Values Comments
AIPS 1: ----------------------------------------------------------------
AIPS 1: USERID 0 User number.
AIPS 1: INNAME 'AC825' UV data (name).
AIPS 1: INCLASS 'CH 0' UV data (class).
AIPS 1: INSEQ 1 UV data (seq. #). 0 => high
AIPS 1: INDISK 1 Disk unit #. 0 => any
AIPS 1: OPTYPE 'MATX' List type:
AIPS 1: 'MATX','LIST','GAIN','SCAN'
AIPS 1: INEXT 'CL' CL, SN or TY table for 'GAIN'
AIPS 1: INVER 0 CL, Sn or TY table version
AIPS 1: SOURCES '1033+395' Source list
AIPS 1: *rest ' '
AIPS 1: CALCODE ' ' Calibrator code ' '=>all
AIPS 1: TIMERANG *all 0 Time range to list
AIPS 1: STOKES ' ' Stokes type to list.
AIPS 1: SELBAND -1 Bandwidth to select (kHz)
AIPS 1: SELFREQ -1 Frequency to select (MHz)
AIPS 1: FREQID 0 Freq. ID to select.
AIPS 1: None selected => 1.
AIPS 1: BIF 1 Lowest IF number 0=1
AIPS 1: EIF 1 Highest IF number
AIPS 1: BCHAN 1 Low channel number 0=>1
AIPS 1: ECHAN 0 High channel number
AIPS 1: ANTENNAS *all 0 Antennas to list
AIPS 1: BASELINE *all 0 Baselines with ANTENNAS
AIPS 1: UVRANGE 0 0 UV range in kilolambda
AIPS 1: SUBARRAY 0 Subarray, 0=>1
AIPS 1: Cal. info for input:
AIPS 1: DOCALIB 2 If >0 calibrate data
AIPS 1: = 2 calibrate weights
AIPS 1: GAINUSE 2 CAL (CL or SN) table to apply
AIPS 1: DOPOL -1 If >0 correct polarization.
AIPS 1: BLVER -1 BL table to apply.
AIPS 1: FLAGVER 0 Flag table version
AIPS 1: DOBAND -1 If >0 apply bandpass cal.
AIPS 1: Method used depends on value
AIPS 1: of DOBAND (see HELP file).
AIPS 1: BPVER -1 Bandpass table version
AIPS 1: SMOOTH *all 0 Smoothing function. See
AIPS 1: HELP SMOOTH for details.
AIPS 1: DPARM 5 1 Control info:
AIPS 1: *rest 0 (1) 0=amp, 1=phase, 2=rms
AIPS 1: 3=amp+rms, 4=phase+rms
AIPS 1: 5=amp+phase, 6=delay,
AIPS 1: 7=rate, 8=SNR, 9=par. ang
AIPS 1: 10 = Tsys, 11=elev,
AIPS 1: 12 = multiband delay
AIPS 1: 13 = Tant 14 = weights
AIPS 1: N.B. Options 3 and 4 only
AIPS 1: valid for OPTYPE = 'MATX'
AIPS 1: (2) 0=vec avg, 1=scalar
AIPS 1: (3) No. col (4-10) def=4.
AIPS 1: (4) avg. time min (MATX,LIST)
AIPS 1: *** significant
AIPS 1: (5) Type of gain listings:
AIPS 1: 0 => all with same scale
AIPS 1: like DEC-10 listings;
AIPS 1: 1 => scan/source info at
AIPS 1: source/scan boundaries.
AIPS 1: (6) Matrix scaling control:
AIPS 1: 0 => plot amp & rms
AIPS 1: matrices with same scale;
AIPS 1: 1 => self-scale each
AIPS 1: separately.
AIPS 1: (7) > 0 self-scale phase
AIPS 1: displays, else degrees.
AIPS 1: DOACOR -1 > 0 include autocorrelations
AIPS 1: FACTOR 0 When DPARM(5)=0 Multiply
AIPS 1: gain listings by FACTOR,
AIPS 1: 0=> use scale factor from
AIPS 1: first record printed.
AIPS 1: DOCRT -1 > 0 -> use the terminal,
AIPS 1: else use the line printer
AIPS 1: > 72 => terminal width
AIPS 1: OUTPRINT 'MATX_CAL1'
AIPS 1: Printer disk file to save
AIPS 1: BADDISK *all 0 Disk to avoid for scratch.

When you look at this list of numbers, amplitudes should be near constant between baselines and in time. Phases should be around zero. Lots of 0's and 1's are good! Teens and 20's are bad! If you have nice phases that are mostly small numbers, then...

Congratulations! You have calibrated your data!!!

Read more!

WBR Step 5L: Flag Your Calibrators

Ok, 'L' stands for Line data. Most of the steps for reducing line data can also be found in Appendix B of the AIPS cookbook. What we have to do first is flag the Channel 0 data for our calibrators.


First, you should know that flagging is really a matter of personal taste. This is the way I like to do it, but you might find something that you like a whole lot more.

Secondly, don't be surprised when flagging is by far the most time consuming aspect of interferometric data reduction. Especially if you're screwing around with data from the VLA as it is transitioning to the EVLA.

Thirdly, at least at this stage, only flag on amplitude. After some calibration, you might consider flagging on phase, but not yet.

A good place to start flagging is QUACK. QUACK flags the beginning of each scan of data, because often times the first little bit of time on an object is bad. QUACK from the 31Dec05 release of AIPS was really quite transparent, with parameters looking like this:


AIPS 1: QUACK Flags specified portion of scans of UV data
AIPS 1: Adverbs Values Comments
AIPS 1: ----------------------------------------------------------------
AIPS 1: INNAME 'AC825_FQ1' Input UV file name (name)
AIPS 1: INCLASS 'CH 0' Input UV file name (class)
AIPS 1: INSEQ 1 Input UV file name (seq. #)
AIPS 1: INDISK 1 Input UV file disk unit #
AIPS 1: SOURCES *all ' ' Sources selected/deselected
AIPS 1: SUBARRAY 0 Subarray number 0=>all.
AIPS 1: SELBAND -1 Bandwidth to flag (kHz)
AIPS 1: SELFREQ -1 Frequency to flag (MHz)
AIPS 1: FREQID 1 Freq. ID to flag. -1=>all.
AIPS 1: 0=> first Freq. ID.
AIPS 1: TIMERANG *all 0 Time: start day,hr,min,sec
AIPS 1: stop day,hr,min,sec.
AIPS 1: ANTENNAS *all 0 Antennas to flag
AIPS 1: FLAGVER 0 Flag table version number
AIPS 1: OPCODE 'ENDB' 'END ', 'BEG ', 'ENDB'
AIPS 1: 'TAIL'; ' ' => 'BEG '
AIPS 1: REASON *all ' ' Reason (24 char.)
AIPS 1: APARM 0 .33 (1) => Cutting time (min)
AIPS 1: *rest 0 from end (ENDG) 0 => 2
AIPS 1: (2) => Cutting time (min)
AIPS 1: from beg/end (BEGB/ENDB)
AIPS 1: 0 => 0.1
AIPS 1: (3) Back start of flagging
AIPS 1: <0 => no padding (0 seconds)
AIPS 1: 0 => 5 seconds [default]
AIPS 1: >0 => APARM(3) seconds


In this case, I'm flagging the last third of a minute in each scan. If you wanted to flag the first part of a scan, you would set
OPCODE = 'BEG'. The Dec07 version of QUACK is really different and I don't understand it yet. Maybe someone can write in with pointers about it?

Good. Next, I like to look at my data in TVFLG and give it a quick flag. Here are some important parameters to consider before your run TVFLG.
SOURCES-- only look at one calibrator at a time in TVFLG. Otherwise your scale will be all messed up and you'll be confused.
TIMERANG-- You really really want all of your data to be able to fit with a smooth time of 10 seconds. What will happen is that if there is too much time spent on your source, AIPS will force you to average your data for multiples of 10s, and this is bad. Because you will flag your data, and think you got rid of the really bright points, but then you will look at all the visibilities in UVPLT and still see lots of bright points. You will be in for far fewer nasty surprises if you make sure smooth time is 10s (In the TVFLG window, it should say AVG 1). Therefore, if you're getting AVG > 1, you should probably break your data up and view it several times in TVFLG with different timeranges. You probably won't know if you need to set a timerange until you load up TVFLG once, and see how much data there is.
DOCAL = 2-- apply weights to your data before you view them in TVFLG.

AIPS 1: TVFLG: Task to edit UV data using the TV display and cursor
AIPS 1: Adverbs Values Comments
AIPS 1: ----------------------------------------------------------------
AIPS 1: USERID 0 User number.
AIPS 1: INNAME 'AC825_FQ1' UV data (name).
AIPS 1: INCLASS 'CH 0' UV data (class).
AIPS 1: INSEQ 1 UV data (seq. #). 0 => high
AIPS 1: INDISK 1 Disk unit #. 0 => any
AIPS 1: DOCAT 0 Catalog work file ?
AIPS 1: IN2SEQ 1 Sequence number of work file
AIPS 1: IN2DISK 1 Disk number of work file
AIPS 1: DOHIST -1 Record flags in history file
AIPS 1: SOURCES '1331+305' Source list
AIPS 1: *rest ' '
AIPS 1: CALCODE ' ' Calibrator code ' '=>all
AIPS 1: TIMERANG *all 0 Time range to include
AIPS 1: STOKES ' ' Stokes type to display
AIPS 1: SELBAND -1 Bandwidth to select (kHz)
AIPS 1: SELFREQ -1 Frequency to select (MHz)
AIPS 1: FREQID 0 Freq. ID to select.
AIPS 1: BIF 0 Lowest IF number 0=1
AIPS 1: EIF 0 Highest IF number
AIPS 1: BCHAN 0 Lowest channel number 0=>1
AIPS 1: ECHAN 0 Highest channel number
AIPS 1: ANTENNAS *all 0 Antennas to include
AIPS 1: BASELINE *all 0 Baselines with ANTENNAS
AIPS 1: UVRANGE 0 0 UV range in kilolambda
AIPS 1: SUBARRAY 0 Subarray, 0 => all, but the
AIPS 1: task is more efficient doing
AIPS 1: one at a time
AIPS 1: Cal. info for input:
AIPS 1: DOCALIB 2 If >0 calibrate data
AIPS 1: = 2 calibrate weights
AIPS 1: GAINUSE 1 CAL (CL or SN) table to apply
AIPS 1: DOPOL -1 If >0 correct polarization.
AIPS 1: BLVER -1 BL table to apply.
AIPS 1: FLAGVER 1 Flag table version 0 => high
AIPS 1: < 0 no flagging on input
AIPS 1: Used w single-source too
AIPS 1: DOBAND -1 If >0 apply bandpass cal.
AIPS 1: Method used depends on value
AIPS 1: of DOBAND (see HELP file).
AIPS 1: BPVER 0 Bandpass table version
AIPS 1: SMOOTH *all 0 Smoothing function. See
AIPS 1: HELP SMOOTH for details.
AIPS 1: DPARM 0 0 Control info:
AIPS 1: 0 0 (1) 0=amp, 1=phase, 2=rms,
AIPS 1: 10 10 3=rms/mean for initial
AIPS 1: *rest 0 display, can choose any
AIPS 1: interactively later
AIPS 1: (2) > 0 include autocorr data
AIPS 1: (3) >0 = baseline as ant pair
AIPS 1: for B as x-axis only
AIPS 1: (4) >0 => divide by source
AIPS 1: IPOL flux
AIPS 1: (5) Expand time ranges by
AIPS 1: DPARM(5) in sec
AIPS 1: (6) y-axis interval: give the
AIPS 1: sample time in seconds.
AIPS 1: default = 10 seconds.
AIPS 1: (7) initial IF displayed, 0
AIPS 1: => BIF, can choose BIF -
AIPS 1: EIF interactively
AIPS 1: (8) initial channel displayed
AIPS 1: 0 => BCHAN, can choose
AIPS 1: BCHAN - ECHAN later
AIPS 1: interactively
AIPS 1: (9,10) pixrange for initial
AIPS 1: TV load - can reset later
AIPS 1: interactively
AIPS 1: BADDISK *all 0 Disks to avoid for scratch
AIPS 1: and for master grid file.


Make sure that you look at all your channels, polarizations, and IFs. I like the 'clip interactively' command a lot for getting rid of high or low points.

I recently (finally!) figured out how to invert the scale in TVFLG, so that low points appear bright. Use the 'tvtransf' option, type an 'a' to get an option to change the contrast/brightness of the image. A little square will pop up. Type 'c' now to invert the image, and then move your mouse around with the button held down to get an image stretch you like. Tah Dah!

One useful note: You have to set the Stokes Flag in terms of 0's and 1's, and this is what the binary code means:
1000-- flag only right polarization
0100--flag only left polarization
1111--flag both polarizations

NOTE: TVFLG can take a long time to load if you have lots of channels or data. It's usually pretty fast for the calibrators, because you don't usually spend much time on them. But while TVFLG is loading up your target data (no, we're not there yet), you might want to go eat lunch. Depending on the data set.

Finally, double check everything in UVPLT. Beware, UVPLT likes to plot data in terms of Stokes I, which is quite confusing. Choose to plot STOKES = 'RR' or 'LL' for more clarity. BPARM is the important set of parameters which mostly determine what you're plotting. BPARM = 0 is a good place to start, as this plots amplitude against the length of your baselines.


Read more!