Sunday, May 27, 2007

WBR Step 5C. Flag Your Calibrators

Ok, 'C' stands for continuum. There are slightly different calibration steps for deep continuum data; I'm going to follow the tips for L-Band data reduction given at this VLA website. That means we won't be using the CH 0 data, we'll be making our own Channel 0 after we bandpass-calibrate the line data. But I'm getting ahead of myself. What we have to do first is flag our calibrators. I like to only flag the calibrators very lightly, then calibrate them, and then flag more heavily on the calibrated data.


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.

Fourthly, before you calibrate, I recommend you only flag on dramatically bad looking amplitudes. Don't get too selective yet.

So, as I mentioned above, let's run all of the below commands on the line data. This is more work for you, as you have to look at each channel, but it seems to be the more meticulous way of doing it. If you prefer, I guess you could flag on your CH 0 data, then just copy over the flag (FG) table (using TACOP) to the LINE data set. That might be faster. But you still should probable do a brief run through each channel to make sure there's nothing really glaring that you missed, when you averaged all the channels together.

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 'LINE' 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!

WBR Step 4. One File per Each Day of Observations

Sometimes, your data is taken over multiple days. You want to calibrate each day separately. You can do this by setting 'timerang' in calib, but that scares me a little bit and has lots of room for mistakes. What I prefer to do is SPLIT off each day of observing, so that you'll have a UV file for each day of data. After you've calibrated each file individually, you can combine all the data back together using DBCON.

So how do you split your data according to observation day?


Using SPLIT!
Well, first of all, check in that scan list you got from LISTR to see what days you observed on.
Then run split with 'timerang' set to only include one of those days. For example, only include data taken on day 1:
timerang = 1 0 0 0 1 23 0 0
will include all data take on day 1 between 0 hr and 23 hr.

Everything else in SPLIT you will probably want to leave as default. Except for maybe 'outclass', which you could change to something like, say, 'line_1' (so that you remenber this is the line data from day 1).

SPLIT will generate a new UV file. You need to run INDXR on it to generate a new NX table. The defaults of INDXR are just fine for these purposes.

Unfortunately, you are going to have to do each of the following flagging/calibration steps for each file individually. Sorry, dudes.

Read more!

Wednesday, May 23, 2007

I want a *$*%ing beam on my image

This should be easy, but I've totally forgotten how to do it. How do I get the beam displayed on the TV when I'm looking at my image?

On a non-aips note, we had a small earthquake in Socorro last night-- 3.3 mag! It was my first one and I'm very excited about it.

Read more!

Tuesday, May 22, 2007

CPARM(2) and Self Cal

Emily read in the GMRT documentation that, when doing A&P self calibration, you should set CPARM(2) = 1, which means you would 'normalize gains'. However, we didn't really understand what this meant, and didn't understand why we were doing it. Today I asked Miller Goss, who's visiting UW from NRAO, and he said...


You should set CPARM(2) = 1 only if you don't trust your amplitudes initially! If you think your original amplitude calibration is not so good, say in the case of VLBA data or certain frequencies at the GMRT, you might want to set it.

However, at the VLA, you should set CPARM(2) = 0 because your original amplitude calibration was really quite decent. (At least at L and C band, not sure about crazy other frequencies!)

Read more!

Monday, May 21, 2007

UVRANGEs contradict Calibrator Quality Ratings

What does it mean if your calibrator has a good ("P") rating in the calibrator manual for your array configuration whose longest baseline is ~50 kilolambda--- but then there's a uvrange limitation on it with a uvmin of 100 kilolambda? I'm trying to use calibrator 0841+708 at C band in C array.

5/23/07:
Resolution: After talking to Miller Goss, I think that this must be a typo in the manual. The amplitudes look fine, for the most part, and there is no obvious confusing source in the field. So, I guess this is just a word of caution about the manual, that it can make mistakes some times!

5/24/07:
More Resolution: Rick Perley had this to say about the current state of the VLA calibrator manual:

  Right you are!  The 'P' in that column/row should be an 'S', I think.  It's one of the 'core-dominated' source
types that make good high frequency, high resolution calibrators.
Nobody is keeping up the manual these days (Greg Taylor used to do this, but he's now gone to UNM). We'll
certainly get back on this after the EVLA settles in, and we'll be able to utilize far more sources as calibrators.
In the meantime, I'll make a note in my copy.

Read more!

Continuum Subtraction & POSSM

I'm reducing line (OH 1665/1667 MHz) VLA data for the first time, and I don't know if I should trust my continuum subtraction. When I make an image, it looks like most of my continuum structure is gone, but....when I look at the continuum-subtracted baseline-based spectra in POSSM, the spectra look pretty much exactly the same as they did before I subtracted the continuum.

I would expect that if the spectra had an average value of the continuum of say 2 originally, after the continuum subtraction the specta would have an average value of zero, with emission being positive and absorption negative. But it appears that they still have a value of 2.

What does this mean? Any ideas? Oh yeah, I'm using UVLIN.


Read more!

Thursday, May 17, 2007

WBR Step 3: Choosing a Reference Antenna

At several steps in your data calibration, AIPS is gonna ask you for a REFANT, a reference antenna. So we might as well choose one now!



First of all, run PRTAN to view your antenna setup. Really the only thing you need to do here is tell PRTAN to write to file (DOCRT = -1) and give it a file name (in OUTPRINT)


>tget prtan
>inp
AIPS 1: PRTAN: Task to print the Antenna (AN) extension of a uv file.
AIPS 1: Adverbs Values Comments
AIPS 1: ----------------------------------------------------------------
AIPS 1: USERID 0 Image owner ID number
AIPS 1: INNAME 'MULTI4.8' Image name (name)
AIPS 1: INCLASS 'CH0' Image name (class)
AIPS 1: INSEQ 1 Image name (seq. #)
AIPS 1: INDISK 1 Disk drive #
AIPS 1: INVERS 0 AN file ver. #
AIPS 1: NPRINT 0 No. records to print 0 => all
AIPS 1: DOCRT -1 > 0 => use terminal instead
AIPS 1: > 72 => terminal width
AIPS 1: OUTPRINT 'ANT.TXT'
AIPS 1: Printer disk file to save

In the outputted file, you'll get a cute little map of your antenna locations that looks like this:


Location Of VLA Antennas

N18 ( 1)
N16 (26)
N14 (24)
N12 ( 5)
N8 ( 9)
N4 ( 7)
N2 (27)
N1 (25)
(20) W2 E2 ( 3)
( 8) W4 E4 (15)
(23) W6 E6 (12)
( 6) W8 E8 (10)
( ) E10 ( 2)
(21) W12 E12 (17)
( 4) W14 ( )
(11) W16 E16 (19)
(22) W18 E18 (28)
VLA:OUT (13)
VLA:OUT (14)
VLA:OUT (16)
VLA:OUT (18)
VPT:OUT (29)

(Yeah, this is data during the EVLA upgrade so there are quite a few dishes missing). For your reference antenna, you are going to want to pick a dish near the center of the array, but not exactly at the center (the centermost ones suffer most from RFI). You are also going to want to choose a dish that never crashed during the course of your observations. A good way to see what dishes went down during your observations is to download the observing logs. See if there are any notes from the telescope operator about the dish you are considering using as your REFANT.

Finally, you can take a quick look at the amplitudes of the data using the 'MATX' mode of LISTR. This will spit out amplitudes of your data (on each baseline) averaged over a given time increment. Sometimes you will see really anomalous amplitudes for a given antenna over some timerange (like, an order of magnitude off). If you see something really fishy for the dish you are considering for your REFANT, don't use it. Find a different REFANT that does not have crazy amplitudes.

So, to create such a file of amplitudes, run LISTR setting these parameters:
OPTYPE = 'MATX'
DOCAL = 2 (apply weights)
DPARM(1) = 0 (list amplitudes)
DPARM(4) = 0 (will list amplitudes averaged over the entire scan. You can change this if you want.)
DOCRT = -1 (write to file)
OUTPRINT = 'CHK_ANT.TXT'
you could also specify a source, say your Phase Calibrator, if you want.

If an antenna passes all of these tests, than it's probably a decent REFANT!

Read more!

WBR Step 2. Looking at the Contents of Your Data

So you've loaded in your data and you have a nice CH 0 file and a LINE file. Now what? You probably want to know what frequency your data was taken at, how many channels it has, what sources were observed, etc. See below for how to extract this information from the AIPS maze.


First, let's look at the header of one of these data files. If you type "uc", you will have a list of all the uv files. The first column lists the catalog number of each data file. Like this:


>uc
AIPS 1: Catalog on disk 1
AIPS 1: Cat Usid Mapname Class Seq Pt Last access Stat
AIPS 1: 1 53 MULTI4.8 .CH0 . 1 UV 15-JUN-2006 14:16:14
AIPS 1: 2 53 MULTI4.8 .LINE . 1 UV 23-MAR-2007 00:32:51

If I want to access and screw around with the CH0 data set, I would type 'getn 1', because '1' is the CAT number for this data set. Then, to view the header, just type 'imh'.

#getn 1
AIPS 1: Got(1) disk= 1 user= 53 type=UV MULTI4.8.CH0.1
>imh
AIPS 1: Image=MULTI (UV) Filename=MULTI4.8 .CH0 . 1
AIPS 1: Telescope=VLA Receiver=VLA
AIPS 1: Observer=AW649 User #= 53
AIPS 1: Observ. date=15-MAY-2005 Map date=02-DEC-2005
AIPS 1: # visibilities 1009820 Sort order TB
AIPS 1: Rand axes: UU-L-SIN VV-L-SIN WW-L-SIN BASELINE TIME1
AIPS 1: SOURCE FREQSEL 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 .00
AIPS 1: FREQ 1 4.8851000E+09 1.00 1.5625000E+07 .00
AIPS 1: STOKES 2 -1.0000000E+00 1.00 -1.0000000E+00 .00
AIPS 1: IF 2 1.0000000E+00 1.00 1.0000000E+00 .00
AIPS 1: RA 1 00 00 0 .000 1.00 3600.000 .00
AIPS 1: DEC 1 00 00 0 .000 1.00 3600.000 .00
AIPS 1: ----------------------------------------------------------------
AIPS 1: Coordinate equinox 2000.00
AIPS 1: Maximum version number of extension files of type HI is 1
AIPS 1: Maximum version number of extension files of type AN is 1
AIPS 1: Maximum version number of extension files of type NX is 1
AIPS 1: Maximum version number of extension files of type SU is 1
AIPS 1: Maximum version number of extension files of type FQ is 1
AIPS 1: Maximum version number of extension files of type CL is 1
AIPS 1: Maximum version number of extension files of type TY is 1
AIPS 1: Maximum version number of extension files of type WX is 1
AIPS 1: Maximum version number of extension files of type OF is 1
AIPS 1: Keyword = 'OBSCHANS' value = 8
AIPS 1: Keyword = 'CORRMODE' value = '4 '
AIPS 1: Keyword = 'SELCHANS' value = 7
AIPS 1: Keyword = 'VLAIFS ' value = 'ABCD '

This header tells me all sorts of useful things, like that my data was taken at 4.8 GHz, and that there are 2 polarizations ('STOKES') and 2 IFs (What is an IF? Basically, if you observe at 2 IFs, it's like observing at 2 slightly different frequencies. So, for example, if I was observing the OH molecular lines at 1665 and 1667 MHz, I could put one IF down on each line. In continuum, you get twice the bandwidth if you have 2 IFs!). It also tells me that there is only 1 channel in this file (FREQ 1), which there should be because it's CH0! However, it does tell me further down that the observation was set up to have 7 channels ('SELCHANS' value = 7), so I can expect that in the LINE data.

Next up, you can see what sources were observed and when if you run LISTR. The important parameter to set here is:
OPTYPE = 'scan'
Also, you probably want LISTR to write out to a file, so set
DOCRT = -1
OUTPRINT = 'filename'
Most everything else can be left as default for now.

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 'MULTI4.8' UV data (name).
AIPS 1: INCLASS 'CH0' UV data (class).
AIPS 1: INSEQ 1 UV data (seq. #). 0 => high
AIPS 1: INDISK 1 Disk unit #. 0 => any
AIPS 1: OPTYPE 'SCAN' 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 *all ' ' Source list
AIPS 1: CALCODE ' ' Calibrator code ' '=>all
AIPS 1: TIMERANG *all 0 Time range to list
AIPS 1: STOKES 'HALF' Stokes type to list.
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: None selected => 1.
AIPS 1: BIF 1 Lowest IF number 0=1
AIPS 1: EIF 2 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 -1 If >0 calibrate data
AIPS 1: = 2 calibrate weights
AIPS 1: GAINUSE 0 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 'SCANS'
AIPS 1: Printer disk file to save
AIPS 1: BADDISK *all 0 Disk to avoid for scratch.

Now, if you look at the file 'SCANS', you should see a list of at least 3 sources. One source will be your flux calibrator; it is usually only observed once or twice per night. Another source will be your phase calibrator; it will be observed approximately every 30 minutes. And finally, there will be your target source(s)!

Look up your calibrators in the VLA Calibrator Manual . Copy to some convenient file or piece of paper the flux of your calibrators at your observing frequency, and the uvmin and uvmax.

Read more!

WBR Step 1. Loading in Your Data

Ok, I'm going to start writing an introduction and overview of how to reduce data in AIPS for our REU students this summer. I think the AIPS cookbook overview is vague and opaque, so maybe this will help fill in some gaps. Starting with...FILLM!



From the archive, you'll probably have several files with the observing code, an underscore, and a number. For example: AS755_1.
Move all of the files for your relevant observing program into a convenient directory. Start aips from there.

Now it is time to load these data into AIPS, using the task FILLM. The most important parameters to input here are:
INFILE: pwd will tell it to look for the files in the directory you just started aips from. give it the observing code and an underscore as a prefix.
VLAOBS: give it your observing code
OUTNAME: you can give your data some cute name when it is loaded into aips
DOWEIGHT = 1: you want to load in the data weights!! important!
most of the other parameters here i still don't really understand. I bet some of the time-averaging parameters under CPARM are quite useful, but I'm not sure which are most important to think about. The defaults are probably fine if you're just beginning.


AIPS 1: FILLM Task to read a VLA archive tape
AIPS 1: Adverbs Values Comments
AIPS 1: ----------------------------------------------------------------
AIPS 1: INTAPE 1 Tape drive number
AIPS 1: INFILE 'PWD:AS755_' Non-blank: disk file name
AIPS 1: NFILES 0 Number of files to advance
AIPS 1: Also applies to ON-LINE!
AIPS 1: BAND ' ' Freq. band (4,P,L,C,X,U,K,Q)
AIPS 1: QUAL -1 Source qualifier -1=>all
AIPS 1: CALCODE ' ' Calibrator code
AIPS 1: VLAOBS 'AS755' VLA obs. pgm. name ('AZ99')
AIPS 1: VLAMODE ' ' VLA obs. mode (' '=any)
AIPS 1: REFDATE ' ' Reference date. 'yyyymmdd'
AIPS 1: TIMERANG *all 0 Timerange selected
AIPS 1: BCHAN 1 First spectral channel
AIPS 1: ECHAN 0 Highest spectral channel
AIPS 1: OUTNAME ' ' Output UV file name (name)
AIPS 1: OUTSEQ 0 Output UV file name (seq. #)
AIPS 1: OUTDISK 1 Output UV file disk unit #.
AIPS 1: DOUVCOMP 1 1 (T) => compressed data
AIPS 1: DOALL -1 1 (T) => write all data.
AIPS 1: DOCONCAT -1 1 (T) => append data to old
AIPS 1: files
AIPS 1: NCOUNT 0 Number of files to read
AIPS 1: DOWEIGHT 1 Use nominal sensitivity to
AIPS 1: scale weights?
AIPS 1: = 10, use Memo 108 weights
AIPS 1: DOACOR -1 Load autocorrelation data?
AIPS 1: CPARM 0 0 User options.
AIPS 1: 0 0 1 => Avg. time (seconds)
AIPS 1: 0 0 2 => bitmap (see help)
AIPS 1: 0 1 = 16 for planets & Sun
AIPS 1: 1 0 3 => Max. OK IF status
AIPS 1: <=3 => 3
AIPS 1: 4 => Control dropping of
AIPS 1: shadowed data
AIPS 1: < 0 => no shadow check
AIPS 1: 0 => 25 m limit
AIPS 1: > 0 => Shadow limit is
AIPS 1: CPARM(4) in meters
AIPS 1: 5 = channel code (see HELP)
AIPS 1: 6 => Subarray number-see HELP
AIPS 1: 7 => FQ entry tolerance (kHz)
AIPS 1: (see HELP)
AIPS 1: 8 => CL table time incr. min
AIPS 1: 9 => TY table time incr. min
AIPS 1: 10=> Calibrator avg. time
AIPS 1: DPARM *all 0 Selection by Frequency
AIPS 1: 1+2 => A Frequency (Hz)
AIPS 1: 3+4 => B Frequency (Hz)
AIPS 1: 5+6 => C Frequency (Hz)
AIPS 1: 7+8 => D Frequency (Hz)
AIPS 1: 9 => tolerance for A&C
AIPS 1: 10 => tolerance for B&D
AIPS 1: BPARM *all 0 Opacity and Gain curve
AIPS 1: control (see help)
AIPS 1: IN2FILE *all ' ' Antenna gains file


Watch the output and make sure AIPS read in the data from all of your files. After FILLM successfully runs, if you type "uc", you should see two files: one CH 0 and one LINE. The CH 0 data is basically the line data with the channels averaged together (well, the central 75% of channels). CH 0 data may be useful for calibration.

Read more!

Wednesday, May 16, 2007

cleaning up your catalog

this is a cool trick I learned recently. You know how catalogs become a mess, especially if you're dealing with data from multiple nights and/or multiple sources? I like to group my files to keep them straight (like putting all the CVEL or SPLIT files together), but sometimes due to timing the catalog gets messy. Renumbering items in the catalog can be a huge pain in the rear if you have to move everything up 1 to make room for a file, the trick I learned removes this frustration.

For example, if you have 200 files and you want to move file #140 to slot #40, you'd have to first make slot #40 empty. You can do this by moving 200 to 201, 199 to 200, etc, until you move 40 to 41 and slot 40 is available:

getn 200; slot 201; renum
getn 199; slot 199; renum
...
getn 40; slot 41; renum

Then,

getn 141 (since you moved 140 up to 141!) ; slot 40; renum; recat (to get rid of any new gaps in the catalog)

the painful part is moving up all the files, but never fear! Use this instead:

for i=200:40 by -1;getn i;slot i+1;renum;end;

and it will move files 200 to 40 up one entry in the catalog. Obviously, the first number has to be the highest numbered file in the catalog to work. Also, the slot i+1 part can be modified depending on how many spaces you want to create.

Read more!

Help with continuum subtraction?

I have 23GHz spectral line data with a weak continuum source, and need help making the continuum go away so I can measure the strength of the line emission... for a couple subtle reasons, UVLSF won't do the trick in this case. Any ideas for other ways to remove continuum? More details below.



The source itself is a weak point source. The problem with UVLSF is that spectral line structure is found across much of the spectral window, making it really hard to find line-free channels to average together to use as a model for the continuum. UVSUB uses clean component models, and honestly, I'm not sure how to use it or indeed if this is really what I want.

An additional twist-- I have a higher S/N image of the continuum source taken in an image of the same field at a slightly different central freq (~1.5 GHz offset). I have a feeling I can use this continuum emission as a better S/N image to subtract from the original image, but I'm not sure how to do this...

Ideas? Thanks...

Read more!

Tuesday, May 1, 2007

Dealing with Long Posts

As you may have noted, I write long posts. To avoid clogging up the main page, I've set it up so that you can display only a portion of your post on the main page and then have the reader click on a link to read mode. To do this, add the following code to your post


The start of a really long post
<span class="fullpost">
blah, blah, blah, blah
</span>


Then only the words "The start of a really long post" will appear on the front page. The reader will have to click a link that says "Read More" in order to see the words "blah, blah, blah, blah".

Read more!