AIPS-Simple-Self-Cal: Difference between revisions

From CASA Guides
Jump to navigationJump to search
Amiodusz (talk | contribs)
Amiodusz (talk | contribs)
Line 446: Line 446:


# default split
# default split
# getn 4
# getn 1
# freqid 0
# freqid 0
# docal 1; gainu 2 ➜ apply calibration; from CL#2.
# docal 1; gainu 7 ➜ apply calibration; from CL#2.
# sour 'AFGL2591' '20330+40003' 'J2007+4029' split out target and phase calibrators.
# sour '0851+202', '1828+487', '2200+420'
# doband 1; bpver 1
# aparm 2 0 0 0 1 1 aparm(1)=2 tells SPLIT to average all the channels in each IF, reducing the size of the data significantly.
# inp
# inp
# go
# go
Line 457: Line 459:
AIPS 1: Catalog on disk  1
AIPS 1: Catalog on disk  1
AIPS 1:  Cat  Usid Mapname      Class  Seq  Pt    Last access    Stat
AIPS 1:  Cat  Usid Mapname      Class  Seq  Pt    Last access    Stat
AIPS 1:    1 1099 BM272HC     .UVDATA.    1 UV 07-APR-17 20:18:29
AIPS 1:    1   193 BL193BG     .UVAVG .    1 UV 01-JUL-17 14:28:24
AIPS 1:    2 1099 BM272HC GEO .UVDATA.    1 UV 07-APR-17 15:36:29
AIPS 1:    2   193 BL193BG    .TASAV .    1 UV 03-JUL-17 15:01:55
AIPS 1:    3 1099 BM272HC    .TASAV .    1 UV 07-APR-17 16:22:12
AIPS 1:    3   193 2200+420    .SPLIT .    1 UV 03-JUL-17 15:12:12
AIPS 1:    4 1099 BM272HC    .SPLAT .    1 UV 07-APR-17 20:18:29
AIPS 1:    4   193 0851+202   .SPLIT .    1 UV 03-JUL-17 15:14:41
AIPS 1:    5  1099 AFGL2591   .SPLIT .    1 UV 07-APR-17 20:18:11
AIPS 1:    5  193 1828+487   .SPLIT .    1 UV 03-JUL-17 15:15:29
AIPS 1:    6  1099 J2007+4029  .SPLIT .   1 UV 07-APR-17 20:18:17
AIPS 1:    7  1099 20330+40003 .SPLIT .    1 UV 07-APR-17 20:18:29
</pre>
</pre>



Revision as of 21:37, 3 July 2017

Overview

A good resource for reducing basic VLBI data in AIPS can be found in Appendix C of the AIPS Cookbook. Chapter 9:Reducing VLBI Data in AIPS of the AIPS Cookbook contains much more detail, but is best used as a reference. So with this tutorial you will:

  • Calibrate the regular data all the way through imaging.
  • Perform self-calibration to improve the imaging

This guide only give the important inputs to task. The other inputs should be default. An easy way to set all the inputs to the default in a task is to type "default taskname".

AIPS

For a comprehensive overview of AIPS see the AIPS COOKBOOK, especially Chapter 3:Basic AIPS Utilities and Chapter 12:AIPS for the More Sophisticated Userfor the basics. Chapter 9:Reducing VLBI Data in AIPS is the chapter explaining VLBI data reduction, but it is rather overwhelming so Appendix C:A Step-by-Step Recipe for VLBA Data Calibration in AIPS is recommended as a first step. However, below I summarize some useful commands (in parenthesis are the short form of the command):

  • getname (getn) catalog #: get the name of catalog # and put in INNAME, INCLASS and INSEQ. Other similar: geton (get outname); get2n (get in2name); get3n (getin3name) etc..
  • input (inp) taskname: show the inputs of taskname.
  • tget taskname: get a task and fill in the inputs of the last time the task was run, one of the most useful commands in AIPS.
  • ucat (uc): list uvdata catalog.
  • mcat (mc): list map catalog.
  • tvlod (tvlo): load a map onto the TV.
  • tvinit (tvin): initialize and clear TV.
  • imhead (imh): Print the file header (this can be used on both uv data and images despite the name). This will list informative things like the date of observation and the number and types of tables attached to the data.

Getting the Data

To obtain the data, right click on these file below and select "Save Link As...":

If that doesn't work you can also ftp the data using anonymous ftp:

  • ftp ftp.aoc.nrao.edu
  • login as anonymous
  • cd pub/SIW
  • get bl193bg_3sour_avg.fits

The best place to put the data is in your $FITS area. This is an AIPS data area that should already have an environmental variable set up for it.

About the Data

This is part of an observation from the MOJAVE survey. MOJAVE is a large project that uses the VLBA to monitor Active Galactic Nuclei at 15 GHz in total and polarized flux. This project has been monitoring AGN for over a decade. The the observation we are using took place on 16 June 2016 and contained 22 sources. However in order to make the data a managable size for a data reduction tutorial, three sources have been copied out of this dataset and the frequencies channels and integration time have both been averaged by a factor of two. The sources in the the bl193bg_3sour_avg.fits dataset are as follows:

  • 0851+202 - BL Lac object, bright source with not a lot of structure, used as bandpass calibrator, aka OJ287. MOJAVE source page
  • 1828+487 - Quasar, bright source with a very extended defuse jet, aka 3C380. MOJAVE source page
  • 2200+420 - The original BL Lac object, bright source with extended curved jet, aka BL Lac. MOJAVE source page

We thank the MOJAVE team for maintaining the MOJAVE database and Matt Lister (Purdue) in particular for advice on the best data to select (Lister et al., 2009, AJ, 137, 3718).

Starting AIPS and Loading the Data

Starting AIPS

Start AIPS by typing aips or possibly aips tv=local:0.0 in a terminal window. Depending on your AIPS installation, you might be prompted to pick a printer, then you will be asked for an AIPS number, if you are not sharing disks with anyone pick any number other than 1. Remember that number because the data you load and work on will be under that number. It would be best for this tutorial for you to use a clean AIPS number, in other words, an AIPS number that you have not used for anything else and has no data loaded into it.

Loading Data Into AIPS

Load the data with FITLD. Note that I am forcing an outname, outclass and outseq, we are doing it here so it will be easy to take about specific files.

  • First load the target and calibrators
  1. default fitld
  2. clint 0.25 ➜ set CL table interval to 15 seconds.
  3. datain 'FITS:bl193bg_3sour_avg.fits ➜ Two things to note: 1) this assumes that the data is in the $FITS directory, you can use a full directory path (e.g., datain '/home/mydata/bl193bg_3sour_avg.fits) or another environmental variable if the data is elsewhere; 2) The lack of a close ' is not a typo, you must leave off the closing ' or AIPS will capitalize the everything within the ' ' and you will get an error because FITLD will not be able to find the data.
  4. outname 'bl193bg'
  5. outclass 'uvdata'
  6. outseq 1
  7. outdisk 1
  8. inp ➜ check the inputs
  9. go
  • Lets look at our uv data catalog
  1. uc

You should get something that looks similar to (with a different Usid and Last access):

AIPS 1: Catalog on disk  1
AIPS 1:   Cat  Usid Mapname      Class   Seq  Pt    Last access     Stat
AIPS 1:     1   194 BL193BG     .UVDATA.    1 UV 29-JUN-17 19:39:03

Note the data file, BL193BG.UVDATA.1, has a catalog number (Cat) which in this case 1. Catalog numbers can be, and usually are, used to fill in IN and OUTNAMES etc., using getn, geton etc..

Reducing the data

Preliminary Data Evaluation

Look at the structure of the data with LISTR. This will give you a listing of the scans as well as the sources and frequency structure in the observation. Note that even though this dataset contains only three sources, the SU (source) table still contains all the sources in the original dataset, so LISTR will list all the sources and show 0 visabilities for the sources with no data.

  1. default listr
  2. getn BL193BG.UVDATA.1 file; in other words getn 1
  3. optype 'scan'
  4. docrt 1
  5. inp
  6. go

This will give you a listing of the scans and frequencies in the observation.

Data Reduction Procedure

Load in the VLBA data reduction procedures: see EXPLAIN VLBAUTIL for full description of procedures.

Procedures are run by just typing their name, rather than using "go".

  1. run vlbautil

If you get a BLEW CORE or other similar error message, you have filled your procedure memory (VLBAUTIL is very large and loading it three times will do this). To fix it type "restore 0" then reload VLBAUTIL

Calibrate Ionospheric Delay and Fix Earth Orientation Parameters

Data observed at 8 GHz or lower frequencies may be effected by the dispersive delay caused by the ionosphere. This will distort images and is especially bad at very low frequencies. An ionospheric correction based on maps of the electron content of the ionosphere can be performed with VLBATECR. BL193BG is observed at 15 GHz so no ionospheric correction is needed.

Data using phase referencing can be effected by imprecise Earth Orientation Parameters (EOPs) used in correlation. Therefore all phase referenced data should have its EOPs corrected. This can be done with VLBAEOPS. BL193BG does not use phase referencing so no EOP correction is needed.

Apply Digital Sampling Correction to VLBA data

Correct sampler threshold errors from correlator by running VLBACCOR.

  1. default vlbaccor
  2. getn 1
  3. inp
  4. vlbaccor

VLBACCOR runs ACCOR which creates an soulution (SN) table then smooths the table with SNSMO then runs CLCAL to apply the solutions to the calibration (CL) table. When VLBACCOR is finished you should get messages like those below that tell you what SN tanle and CL table are created. It is a good idea to keep save these messages.

AIPS 1: 'SN #1 CONTAINS SAMPLER CORRECTIONS'
AIPS 1: 'CL #2 ADDS SAMPLER CORRECTIONS'

Plot Cross Power Spectrum

Figure 1
Plot of amplitudes (bottom) and phases (top) for source 0851+202.

Now lets take a look at the fringe finders by running VLBACRPL. VLBACRPL runs POSSM and displays the spectrum of each baseline (to Fort Davis (antenna 2)), with the amplitude on the bottom and the phases on the top.

  1. default vlbacrpl
  2. getn 1
  3. stokes 'half'
  4. refant 2
  5. gainuse 0
  6. solint -1
  7. dotv 1
  8. source '0851+202'
  9. inp
  10. vlbacrpl

As you can see from Figure 1, 0851+202 has very strong fringes. So we will use it as the calibrator to set the instrumental delays. Also look at your terminal for instructions on how to control POSSM:

POSSM1: Waiting 30 seconds:
POSSM1:    Hit TV button A to pause indefinitely.  Hit button
POSSM1:    B or C to continue sooner, button D to stop plotting

So hit A if you want to look at a plot longer than the 30 seconds, B or C to go to the next plot, D to exit.

Determine Delay Corrections

Find and remove instrumental delay by running VLBAPCOR.

Figure 2
Plots for source 0851+202 which show the amplitude (bottom panel) and corrected phases (top panel), for each IF in both polarizations.
  1. default vlbapcor
  2. getn 1
  3. calsour '0851+202'
  4. timer 0 19 26 33 0 19 36 38 ➜ scan with good fringes on all telescopes we found in POSSM plots.
  5. refant 2 ➜ choose reference antenna from in the middle of array, antenna 2 or FD (Fort Davis, TX) is a good choice.
  6. gainu 0 ➜ apply highest CL table.
  7. inp
  8. vlbapcor

At this point you should check on the calibration:

  • VLBAPCOR runs PCCOR which used the pulse cals to correct the intrumental phases and then runs CLCAL to apply the solutions to the CL (calbration table). The output from VLBAPCOR will look something like this:
AIPS 1: 'RUN PCCOR'
PCCOR1: Task PCCOR  (release of 31DEC17) begins
PCCOR1: Writing to SN table   2
PCCOR1: Appears to have ended successfully
PCCOR1: localhos 31DEC17 TST: Cpu=      0.9  Real=      2  IO=        93
AIPS 1: Resumes
AIPS 1: 'RUN CLCAL'
CLCAL1: Task CLCAL  (release of 31DEC17) begins
CLCAL1: Using interpolation mode SELF
CLCAL1: Copied CL file from vol/cno/vers  1  183   2 to  1  183   3
CLCAL1: CALSEL: Making room for new CL data by
CLCAL1: Deleting CL table no.    3
CLCAL1: Processing SN table    2
CLCAL1: SNMRG: Merging SN table
CLCAL1: SNMRG: Write    2974 merged records from    2974 input records
CLCAL1: SN2CL: Applying SN tables to CL table   2, writing CL table  3
CLCAL1: Appears to have ended successfully
CLCAL1: localhos 31DEC17 TST: Cpu=      0.3  Real=      1  IO=       138
AIPS 1: Resumes
AIPS 1: 'SN #2 CONTAINS PCAL INSTR. PHASE CORRECTIONS'
AIPS 1: 'CL #3 ADDS INSTR. PHASE CORRECTIONS'

Again, it is a good idea to make note of the last two lines that tell you which tables contain which corrections. Most VLBAUTIL calibration scripts produce such messages.

  • check solutions in POSSM, the jumps in phase between the IFs should be gone. The phases may also be flattened.
    1. tget possm ➜ to "get" all the inputs from the last run (it was run when we ran the procedure VLBACRPL).
    2. gainu 3
    3. inp
    4. go

As you can see from Figure 2, the phases for 0851+202 have been flattened and the phase jumps between the IFs are gone. For other sources farther away in time the phases may be different from 0 but there will still be no phase jumps.

Create BP Table and Calibrate Bandpass Shape

Figure 3
Plot of bandpass for source '0851+202' .

Calibrate bandpass shape with VLBABPSS.

  1. default vlbabpss
  2. getn 1
  3. calsour '0851+202' ➜ use both very strong sources as bandpass calibrators.
  4. refant 2
  5. inp
  6. vlbabpss

VLBABPSS will create a bandpass (BP) table:

AIPS 1: 'BP #1 BANDPASS TABLE'

Now check the bandpass solutions with POSSM.

  1. tget possm
  2. baseline=0
  3. aparm=0
  4. aparm(8)=2
  5. aparm(9)=1
  6. bpver=1; doband=1
  7. go

Figure 3 shows the plots generated by POSSM. The solutions should look like a reasonable fit of the bandpass shape.

Apply Amplitude Corrections

Perform amplitude calibration by running VLBAAMP.

  1. default vlbaamp
  2. getn 1
  3. inp
  4. vlbaamp

Again, the procedure should finish with the following lines:

AIPS 1: 'SN #3 CONTAINS SAMPLER CORRECTIONS'
AIPS 1: 'SN #4 CONTAINS GAIN CORRECTIONS'
AIPS 1: 'CL #4 ADDS SAMPLER CORRECTIONS'
AIPS 1: 'CL #5 ADDS GAIN CORRECTIONS'

which should be noted.

Examine Amplitude Calibration

Figure 4
Plot of amplitude gains vs. time with the different colors representing the different IF polarizations.

Examine amplitude calibration by running SNPLT.

  1. default snplt
  2. getn 1
  3. dotv 1
  4. inext 'cl'
  5. invers 0
  6. opty 'amp' ➜ Plot amplitudes.
  7. nplots 10
  8. opco 'alsi' ➜ Plot all IFs and Stokes.
  9. do3col 1 ➜ Use 3-color symbols.
  10. inp
  11. tvin ➜ tvinitialize clears the tv before plotting. Otherwise you will get a mess as the table is plotted over the bandpass plot from before.
  12. go

Figure 4 shows the amplitude gains change over time as the sources rise and set, with higher gains at lower elevations. The different IFs and polarizations (RR and LL in this case) are shown as different colors.

Correct Phases for Parallactic Angles

Correct phases for parallactic angle effects with VLBAPANG.

Figure 5
EDITR display showing all the baselines to antenna 10 for 2200+420. You can see for all the baselines the amplitude is low for the first scan and for baseline 01-10 the phases for this scan look like noise. We want to flag this data.
  1. default vlbapang
  2. getn 1
  3. inp
  4. vlbapang
AIPS 1: 'CL #6 ADDS PARALLACTIC ANGLE CORRECTIONS'

Manually Edit Data

Figure 6
To flag this data we click FLAG TIME RANGE and hit B, and a blue box appears in the 01-10 box on the bottom.
Figure 7
After moving the sides of the box to encompass the data that need to be flagged, hit C and the data is flagged and turns red.


Edit the data using EDITR on each source separately.

  1. default editr
  2. getn 1
  3. docal 1; gainuse 0 ➜ calibrate data with highest CL table.
  4. crowded 1 ➜ to plot all polarization and IFs on top of each other.
  5. do3col 1
  6. doband 1
  7. bpver 1
  8. flagver 1
  9. outfgver 1
  10. antuse 1 2 3 4 5 6 7 8 9 10 ➜ to plot all the baselines to one antenna at the same time.

Run on one source at a time:

  • 0851+202:
    1. source '0851+202''
    2. inp
    3. go

Again look in you terminal window for intructions:

 
EDITR1: Press buttons A, B, or C to choose an operation
EDITR1: Press button D for on-line help

EDITR plots both amplitudes and phases verses time, so this is a good way to just look at your data. For the inputs we chose all the polarizations and IFs are plotted on top of each other. The two boxes on the bottom plots these as different colors and shows the amplitude and phase for one baseline. The other boxes where the data is shown in green are the other baselines to that a single antenna. It is especially useful to look at the data this way because problems tend to be antenna based so all the baselines to an antenna will be effected. It you see potentially problematic data (especially high or low, or with bad phases (note that weak sources will have incoherent phases)) then you should wait to flag until you can see all the baselines to the other antenna in the baseline pair with the band data. That way you can flag once, telling EDITR to flag all the data to for one antenna (this is the default in EDITR, but can be changed). The data for this source looks great. Click "NEXT ANTENNA" found on the menu to the right and press "B" until you have looked at all the baselines on all the antenna for this source. At this point the data has been amplitude calibrated but the source amplitude changes from scan to scan, do you know the reason for this?

Now plot the other sources and inspect.

  • 1828+487:
    1. source '1828+487''
    2. go

1828+487 also looks pretty good, although there are some ratty amplitudes and phase on the last scan on baselines to antenna 10. We will just leave these for now because the final fringe fit and self-calibration might fix it.

  • 2200+420:
    1. source '2200+420''
    2. go

As you can see in Figure 5 this source the first scan on the baselines to antenna 10 looks bad. The amplitude is very low and the phases are noise. To flag this data click FLAG TIME RANGE and hit B (Figure 6), and a blue box appears in the 01-10 box on the bottom. By hitting A and moving the cursor move the sides of the box to encompass the data which needs to be flagged; then hit C. The data will be flagged on all the baselines to the antenna and will turn red in the display (Figure 7).


Fringe Fit the Data

Perform a global fringe fit with FRING. The following steps through imaging are not strictly necessary since we will have to redo them once the geodetic calibration is done, but is an excellent way to check the calibration up to this point is correct.

  1. default fring
  2. getn 1
  3. calsour '0851+202', '1828+487', '2200+420' ➜ do a global fringe fit on all sources.
  4. refant 2
  5. search 2 9 5 4 1 3 7 8 ➜ list of antennas to search if a solution is hard to find.
  6. solint 0.25
  7. doband 1
  8. bpver 1
  9. aparm(6) 2 ➜ print some information on solutions.
  10. aparm(9) 1 ➜ do exhaustive baseline search.
  11. docal 1; gainu 0
  12. inp
  13. go

You should look at the number of good and failed solutions:

FRING1: Found    97646 good solutions
FRING1: Failed on     1042 solutions
FRING1: Adjusting solutions to a common reference antenna

You should get something similar but not necessarily exactly the same numbers of good and failed solutions. A small percentage of failed solutions are fine at this point. FRING will have created SN table number 5.

Note that if a model is not used (we are not using a model), FRING assumes that the source it is solving for is a point source at the phase center. None of these sources are point sources, therefore the corrections FRING found will not perfectly correct the data and once we apply all the calibration it will be necessary to do self-calibration with source models to get the best images. Also note that I said "at the phase center" so no matter what the the true position of your target this fringe fit will move brightest spot of the source to the phase center (the position of the target in the correlation).

Apply FRING solutions

Note that the previous step and this step can be done in the single procedure VLBAFRNG. It is broken up here just both to show the steps explicitly but also because running the tasks individually allows for more control. Here the global fring fit which was done in the last step is interpolated and applied to the all the calibration that has gone before with CLCAL.

  1. default clcal
  2. getn 1
  3. gainv 6 ➜ CL table with all the calibration.
  4. gainu 7 ➜ CL table to write next step of calibration in.
  5. snver 5 ➜ global fringe fit solutions from FRING
  6. interpol 'SELF' ➜ use 2PT interpolation.
  7. refant 2
  8. sour '0851+202', '1828+487', '2200+420' ➜ sources to which to apply calibration.
  9. calsour sour ➜ set calibrator sources to the same sources in parameter sources
  10. inp
  11. go

So SN table #5 will be applied to CL table #6 and created CL table #7. CL table #7 now has all the calibration in it.

Backing up Your Calibration

We will want to save the calibration up to this point with TASAV. TASAV makes a new file with all your calibration tables, this is very useful because it contains everything you need to recalibrate your data in a very compact and portable form. It is also a good idea to do this before you do anything you are unsure about or will change important tables (AN, SU) in ways that are hard to change them back.

  1. default tasav
  2. getn 1
  3. outdisk 1
  4. inp
  5. go

Lets look at our catalog again:

  1. uc

You should get something that look similar to:

AIPS 1: Catalog on disk  1
AIPS 1:   Cat  Usid Mapname      Class   Seq  Pt    Last access     Stat
AIPS 1:     1   193 BL193BG     .UVAVG .    1 UV 01-JUL-17 14:28:24
AIPS 1:     2   193 BL193BG     .TASAV .    1 UV 27-JUN-17 11:52:14

Note that you now have a second catalog entry which TASAV automtically named BL193BG.TASAV.1. This uv data file has 1 visibility and all the tables attached to BM272HC.UVDATA.1. Lets look at the TASAVed file.:

  1. getn 2
  2. imh

You should get something that looks like:

AIPS 1: Image=MULTI     (UV)         Filename=BL193BG     .TASAV .   1
AIPS 1: Telescope=VLBA               Receiver=VLBA
AIPS 1: Observer=BL193BG             User #=  193
AIPS 1: Observ. date=16-JUN-2016     Map date=27-JUN-2017
AIPS 1: # visibilities         1     Sort order  TB
AIPS 1: Rand axes: UU-L-SIN  VV-L-SIN  WW-L-SIN  TIME1  SUBARRAY
AIPS 1:            SOURCE  REMOVED  INTTIM  GATEID  CORR-ID  ANTENNA1
AIPS 1:            ANTENNA2
AIPS 1: ----------------------------------------------------------------
AIPS 1: Type    Pixels   Coord value     at Pixel     Coord incr   Rotat
AIPS 1: COMPLEX      3   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        32   1.5240375E+10      17.00  1.0000000E+06    0.00
AIPS 1: IF           8   1.0000000E+00       1.00  1.0000000E+00    0.00
AIPS 1: RA           1    00 00 00.000       1.00       3600.000    0.00
AIPS 1: DEC          1    00 00 00.000       1.00       3600.000    0.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 AT is   1
AIPS 1: Maximum version number of extension files of type CT 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 AN is   1
AIPS 1: Maximum version number of extension files of type CL is   7
AIPS 1: Maximum version number of extension files of type CQ is   1
AIPS 1: Maximum version number of extension files of type GC is   1
AIPS 1: Maximum version number of extension files of type IM is   1
AIPS 1: Maximum version number of extension files of type MC is   1
AIPS 1: Maximum version number of extension files of type PC 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 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 SN is   5
AIPS 1: Maximum version number of extension files of type BP is   1
AIPS 1: Maximum version number of extension files of type FG is   1

Note that there is 1 visibility but 7 calibration (CL) tables and 5 solution (SN) tables. As well as numerous other tables with information about you data (history (HI), frequency (FQ), antenna (AN), system temperature (TY), bandpass (BP), flag (FG)...).

Apply Calibration and SPLIT the Data

Apply calibration and make single source data sets with SPLIT. I like to work with single source files, it's less confusing, especially when self-caling and imaging.

  1. default split
  2. getn 1
  3. freqid 0
  4. docal 1; gainu 7 ➜ apply calibration; from CL#2.
  5. sour '0851+202', '1828+487', '2200+420'
  6. doband 1; bpver 1
  7. aparm 2 0 0 0 1 1 ➜ aparm(1)=2 tells SPLIT to average all the channels in each IF, reducing the size of the data significantly.
  8. inp
  9. go

This will produce three files named sourcename.SPLIT.1, again type uc to look at the catalog.

AIPS 1: Catalog on disk  1
AIPS 1:   Cat  Usid Mapname      Class   Seq  Pt    Last access     Stat
AIPS 1:     1   193 BL193BG     .UVAVG .    1 UV 01-JUL-17 14:28:24
AIPS 1:     2   193 BL193BG     .TASAV .    1 UV 03-JUL-17 15:01:55
AIPS 1:     3   193 2200+420    .SPLIT .    1 UV 03-JUL-17 15:12:12
AIPS 1:     4   193 0851+202    .SPLIT .    1 UV 03-JUL-17 15:14:41
AIPS 1:     5   193 1828+487    .SPLIT .    1 UV 03-JUL-17 15:15:29

Create Image of AFGL 2591

Figure 9
A radio image of the maser AFGL 2591.

Image AFGL 2591 with IMAGR.

  1. default imagr
  2. getn 5
  3. bchan 125; echan 150; nchav 1; ➜ image channels 127-150.
  4. cell 3e-5; imsi 1024 ➜ cell size of 0.03 mas; image size of 1024x1024.
  5. dotv 1; niter 1000 ➜ do interactive clean; with 1000 iterations.
  6. im2parm 10 6 9 0.5 ➜ autoboxing, only do 10 boxes per major cycle; find islands with > 6*rms; box is accepted if peak > 9*rms; box is accepted if its peak brightness is >0.5*max residual.
  7. inp
  8. go

HINT: The first few channels will not have any masers, just hit "STOP CLEANING" (and "A" to select, again look in terminal for instructions) until you see some emission. Hit TVPSEUDO then "D" immediately to get color rather than grey scale. If you want to interactively clean, then click CONTINUE CLEAN (and "A"); if you want to add boxes use REBOX ("A"); when you are happy wit the cleaning you can go to the next channel by clicking STOP CLEANING ("A"). You can turn off interactive clean by clicking TURN OFF DOTV ("A"). Once IMAGR is done you can do a mcat (mc for short) to look at the maps in your catalog:

  1. mc
AIPS 1: Catalog on disk  1
AIPS 1:   Cat  Usid Mapname      Class   Seq  Pt    Last access     Stat
AIPS 1:     8  1099 AFGL2591    .IBM001.    1 MA 14-APR-17 10:58:28
AIPS 1:     9  1099 AFGL2591    .ICL001.    1 MA 14-APR-17 10:58:28

Note that you have made two file, a "dirty beam" (the IBM001 file) and a cleaned map (ICL001).

Look at cube with AFGL2591 TVMOVIE (getn 9; tvmovie) and use SQASH (default sqash; getn 9; bdrop 3; dparm 1 0;go) to collapse cube and then use TVLOD to look at the SQASH image. Figure 9 shows the end results after SQASH. SQASH will produce another map in you catalog:

  1. mc
AIPS 1: Catalog on disk  1
AIPS 1:   Cat  Usid Mapname      Class   Seq  Pt    Last access     Stat
AIPS 1:     8  1099 AFGL2591    .IBM001.    1 MA 14-APR-17 10:58:28
AIPS 1:     9  1099 AFGL2591    .ICL001.    1 MA 14-APR-17 11:02:50
AIPS 1:    10  1099 AFGL2591    .SQASH .    1 MA 14-APR-17 11:02:50

To look at it use TVLOD (getn 10; tvin; tvlo). Use TVPSEUDO to put it into color (tvps). You can either use your mouse to manipulate the colors, again look at your terminal for instructions. Hit "D" once it looks the way you want.

Create More Images

Image J2007+4029 and/or 20330+40003 with IMAGR to make sure phase referencing worked.

  1. default imagr
  2. getn 6 or 7
  3. bchan 0; echan 0; nchav 256; ➜ average all channels.
  4. cell 3e-5;imsi 2048 ➜ larger image size because sources might not be at center of field.
  5. im2parm 10 6 9 0.5 ➜ autoboxing again
  6. dotv 1; niter 1000 ➜ do interactive clean; with 1000 iterations.
  7. inp
  8. go

Here I would check that the autobox looks OK (It should just be around the the obvious emission) and then hit TURN OFF DOTV ("A"). Figure 10 shows the end result of running IMAGR.

Figure 10
A radio image of J2007+4029.

Now do an mcat to see the maps we have created:

  1. mc
AIPS 1: Catalog on disk  1
AIPS 1:   Cat  Usid Mapname      Class   Seq  Pt    Last access     Stat
AIPS 1:     8  1099 AFGL2591    .IBM001.    1 MA 14-APR-17 10:58:28
AIPS 1:     9  1099 AFGL2591    .ICL001.    1 MA 14-APR-17 11:02:50
AIPS 1:    10  1099 AFGL2591    .SQASH .    1 MA 14-APR-17 11:04:16
AIPS 1:    11  1099 J2007+4029  .IBM001.    1 MA 14-APR-17 11:14:05
AIPS 1:    12  1099 J2007+4029  .ICL001.    1 MA 14-APR-17 11:14:05

Then getn 12; tvin; tvlo; tvps.

Reducing geodetic-style data (BM272HC GEO.UVDATA.1)

Instructions geodetic-like calibration to improve astrometry (and phase referencing).

We start with the same steps 4-8 as above on the geodetic data. Its name should be something like "BM272HC GEO.UVDATA.1" if you followed the naming I suggested in the FITLD step above.


Calibrate Ionospheric Delay

Fix ionosphere contribution to the dispersive delay by running VLBATECR.

  1. default vlbatecr
  2. getn 2
  3. inp
  4. vlbatecr ➜ to run VLBATECR

Fix Earth Orientation Parameters

Fix earth orientation parameters by running VLBAEOPS.

  1. default vlbaeops
  2. getn 2
  3. inp
  4. vlbaeops

Apply Digital Sampling Correction to VLBA data

Correct sampler threshold errors from correlator by running VLBACCOR.

  1. default vlbaccor
  2. getn 2
  3. inp
  4. vlbaccor

Plot Cross Power Spectrum

Figure 11
Cross power spectrum plot of 1743-035 showing strong fringes.

Now find a scan that has good fringes on all the baselines by running VLBACRPL. VLBACRPL runs POSSM and displays the spectrum of each baseline (to Fort Davis (antenna 2)), with the amplitude on the bottom and the phases on the top.

  1. default vlbacrpl
  2. getn 2
  3. stokes 'half'
  4. refant 2
  5. gainuse 4
  6. solint -1
  7. dotv 1
  8. source ' '
  9. inp
  10. vlbacrpl

Hit "B" a few times to go through the scans. Although there are several sources/scans to choose from, I choose 1743-035, which has strong fringes on all baselines as seen in Figure 11.

Determine Delay Corrections

Figure 12
Cross power spectrum plot of 1743-035 showing phase corrections.

Find and remove instrumental delay by running VLBAMPCL.

  1. default vlbampcl
  2. getn 2
  3. calsour '1743-035
  4. timer 0 7 15 8 0 7 16 01 ➜ scan with good fringes we found in POSSM plots.
  5. refant 2 ➜ choose reference antenna from in the middle of array, FD (antenna 2) is a good choice.
  6. gainu 4 ➜ apply highest CL table. Please do an imh here to make sure the highest CL table is really 4.
  7. inp
  8. vlbampcl

At this point you should check on the calibration:

  • First check you have no failed solutions. At the end of the FRING run it should tell you how many "good" and "failed" solutions it has found. For this step there must be no failed solutions, failed solutions in this step mean that whatever antenna the failed solution was on is deleted from your data. For this data there should be "80 good solutions".
  • check solutions in POSSM, the jumps in phase between the IFs should be gone. The phases may also be flattened.
    1. tget possm➜ to "get" all the inputs from the last run (it was run when we ran the procedure VLBACRPL).
    2. gainu 5
    3. inp
    4. go

Again hit "B" a few times. As you can see from Figure 12, the phase jumps between the IF's are gone. Some sources will show a general phase slope across all the IF's. This is the multi-band delay that we will measure and fit for the zenith delay.

Determine Multi-Band Delay

Determine multi-band delay (MBD) by running FRING. This will take a few minutes.

  1. default fring
  2. getn 2
  3. refant 2
  4. docal 1; gainu 5
  5. aparm(5)=2 ➜ solve form the MBD.
  6. inp
  7. go

There will be a lot of failed solutions (~20%) here and that is O.K.. :

FRING1: Found     3448 good solutions
FRING1: Failed on      736 solutions
FRING1: Adjusting solutions to a common reference antenna
FRING1: Appears to have ended successfully

Plot the Multi-Band Delay

Figure 13
Multi-Band delay plot showing offset points that will need to be flagged.

Check MBD with SNPLT.

  1. default snplt
  2. getn 2
  3. inext 'sn'; invers 3
  4. nplots 10
  5. dotv 1
  6. opty 'mdel'➜ plot MBD.
  7. xaxis 2➜ plot verses elevation.
  8. tvin; go ➜ clear TV and run task

It is important that the MBD be correct because the fitting in DELZN can easily go wonky.

Figure 13 shows the resulting plot generated by SNPLT. Note that most MBD are between a fraction and a few ns. Large ones are probably wrong and should be clipped. There also should be a general trend from low to high elevations, although this is not always clear in the plot. The most obvious classic case is for SC as seen in Figure 13. Make note of the obviously bad points, one at BR (-3 ns), one at NL (-6 ns), two at PT (-3 ns), and one at SC (about 19 ns).

Flag Offset Data Points

Edit the MBD with SNEDT. SNEDT will only plot versus time, which is why we noted the bad points above.

  1. default snedt
  2. getn 2
  3. inext 'sn'; invers 3
  4. antuse 1 2 3 4 5 6 7 8 9 10
  5. dodelay 2
  6. go

Flag the points noted above. After having removed the bad points and exiting, a new solutions table (SN #4) should have been created.

Inspect the Corrected Multi-Band Delays

Check MBD again with SNPLT.

  1. tget snplt
  2. invers 4
  3. tvin
  4. go

Looks OK, maybe some more flagging needed (SC with a data point at -4 ns), but lets see how DELZN does.

Figure 14
Polynomial fit plot (PL 1) for the Brewster VLBA antenna, which is generated by running DELZN.
  • Solve for zenith and clock delays with DELZN.
  1. default delzn
  2. getn 2
  3. snver 4➜ SN table with edited MBD
  4. gainv 5➜ CL table to copy and correct.
  5. aparm 0 3 2 1 1 10➜ plot zenith atmos. delay; use 3 polynomial terms to fit atmosphere; use 2 polynomial terms to fit clock; create CL table; correct both atmosphere and clock; use 10 iterations of robust fitting.
  6. opty 'mdel'➜ fit MBD.
  7. outfi 'FITS:delzn.clor ➜ file to read in with CLCOR; note if you leave off the closing ' the outfi retains the case.
  8. dotv -1➜ don't plot to TV, only make PL files.
  9. inp
  10. go

The generated plot files can be viewed with TVPL.

  • Plot generated PL files with TVPL
  1. default tvpl
  2. getn 2
  3. for plver= 1 to 9; go tvpl; tvps; end

The plots should get displayed on the AIPSTV display (Figure 14). Hit "D" to scroll through the plots.

DELZN makes plots that I don't find particularly useful to evaluate the quality of the fit. The best way to evaluate this (other than applying it to the astrometric data and see if it improves things) is to apply the CL table that DELZN produces to the GEO data and see if it flattens the MBD across all the IF's.

  • Plot GEO data with CL table 5, and compare it to CL table 6 which was generated by DELZN
  1. tget possm
  2. getn 2
  3. gainuse 5
  4. go

After scrolling through the plots by pressing "B", or exiting with "D", generate plots with CL 6.

  1. gainuse 6
  2. go

In order to clearly see the phase improvements, scroll to 1751+093, for time 11:10:42-11:12:15 (CL 5), and compare the phases to the same source when applying CL 6. As you can see in Figure 15b, the results look quite good after applying CL 6.

Figure 15a
POSSM plot showing source 1751+093 after applying CL table 5, which shows a slight phase slope across IF's.
Figure 15b
POSSM plot showing source 1751+093 after applying CL table 6, which shows improved flattened phases across all IF's.

Now we transfer these solutions to the target dataset.

This is where it gets a little complicated (although not much). Now we must apply the solutions to the data with the target in it, with all the calibration except the final fringe fit. The calibrated data you have has the final fringe fit in it, so we can compare the DELZNed and non-DELZNed data. Use "imh" on the TARGET (SPLATed) data to see how many CL tables there are. We want to apply the DELZN solution to the CL table immediately before the final fringe fit we performed to that data.

Apply Delay Corrections

Apply the zenith delay correction with CLCOR.

  1. default clcor
  2. getn 4
  3. opco 'atmo'➜ read in a file of atmospheric and clock delay corrections and apply them to the given CL table.
  4. gainv 1; gainu 0➜ input CL#1; generate a new CL table (CL 3).
  5. infile 'FITS:delzn.clor➜ file with corrections we created earlier with the GEO data.
  6. inp
  7. go

CLCOR will say it has created CL table #3. Use this for further calibration, i.e. skip CL#2.

Fringe Fit Data

Do global fringe fit with FRING. This is where vput/vget come in handy, if you didn't do the vput, then repeat step previous FRING done on BM272HC.SPLAT.1 but change the gainuse parameter as shown below.

  1. vnum 1; vget fring
  2. gainu 3
  3. inp
  4. go

Apply Calibrations

Apply calibration to tables with CLCAL. Again either use vnum/vget or repeat CLCAL step from above changing parameters as shown below.

  1. vnum 1; vget clcal
  2. snver 2
  3. gainv 3
  4. gainu 4
  5. inp
  6. go

Split the Data

Apply calibration to data with SPLIT. Here we can use tget because SPLIT has not been used since the last time we ran it on this data. Again repeat step 20 if you can't do this.

  1. tget split
  2. gainu 4 ➜ apply CL#4 to the data
  3. outcl 'delzn'
  4. inp
  5. go

Image J2007+4029

Image J2007+4029 with IMAGR.

  1. tget imagr
  2. cell 3e-5
  3. imsi 512
  4. dotv 1
  5. niter 1000
  6. im2parm 10 6 9 0.5
  7. bchan 0; echan 0
  8. nchav 256
  9. inp
  10. go

Compare this image to the one made without the correction (Figure 16a).

Figure 16a
IMAGR screenshot showing source J2007+4029 before applying DELZN delay corrections and before applying fringe fitted calibrations.
Figure 16b
IMAGR screenshot showing source J2007+4029 after applying DELZN delay corrections and applying fringe fitted calibrations. Peak flux has increased and position has been corrected.

As you can see, the image after the correction (Figure 16b) has a lower noise level and a source with a higher peak. Bad phases spread the flux around the image and make the noise level higher and source flux lower as well as shifting the position of the source.