Guide to VLBA Astrometry Tutorial

The VLBA spectral line/phase referencing tutorial can be found here.

Please note before you start:

Instructions for reducing the data

  1. Load the data with FITLD
    default 'fitld'
    clint 0.25
    ➜ set CL table interval to 15 seconds.
    ➜ run once for each dataset:
    outcl 'geo'➜ set outclass to GEO so you know what file you are working with.
    datain '/var/nrao/vlba/BL118.GEO.FITS➜ this is not a typo, you must leave off the close ' or AIPS will capitalize the everything within the ' ' and you will get an error because FITLD will not be able to find the directory.
    inp
    go
    outcl 'target'
    ➜ set outclass to TARGET so you know what file you are working with.
    datain '/var/nrao/vlba/BL118.TARGET.CAL.FITS➜ again remember to leave off the close '.
    inp
    go
    outcl ''
    ➜ reset outclass, image file will load in with appropriate name.
    datain '/var/nrao/vlba/TTAUSB.IMAGE.FITS ➜ again remember to leave off the close '.
    inp
    go

  2. 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".
    run vlbautil

  3. 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

  4. Fix ionosphere contribution to the dispersive delay by running VLBATECR.
    default vlbatecr
    getn GEO file
    inp
    vlbatecr
    ➜ to run VLBATECR

  5. Fix earth orientation parameters by running VLBAEOPS.
    default vlbaeops
    getn GEO file
    inp
    vlbaeops

  6. Fix parallactic angle by running VLBAPANG.
    default vlbapang
    getn GEO file
    inp
    vlbapang

  7. Perform amplitude calibration by running VLBACALA.
    default vlbacala
    getn GEO file
    inp
    vlbacala

  8. Find scan with good fringes on all baselines by running POSSM.
    default possm
    getn GEO file
    baseline 9 0
    ➜ to plot all baseline to one antenna
    docal 1; gainuse 0 ➜ calibrate data with highest CL table.
    aparm(9) 3➜ plot all IFs and polarizations together.
    nplot 9➜ plot 9 baselines per page (i.e., all the baselines to one antenna).
    solint -1➜ plot one scan at a time.
    dotv 1➜ plot to the TV.
    inp
    go

  9. Use pulse cals to remove instrumental delay by running VLBAPCOR.
    default vlbapcor
    getn GEO file
    calsour '0149+370''
    ➜ strong source.
    timer 0 5 0 0 0 5 3 ➜ scan with good fringes we found in POSSM plots.
    refant 9➜ choose reference antenna from in the middle of array, PT (antenna 9) is a good choice.
    gainu 0➜ apply highest CL table.
    inp
    vlbapcor

    At this point you should check on the calibration:
    • First check you have no failed/missing solutions. PCCOR (which VLBAPCOR runs) will tell you if there are any antennas "missing" pulse cals. If this is the case you must find another scan that has pulse cals for all the antennas. If this is impossible there is a way to run VLBAPCOR so it will do a manual phase cal on the antennas that have missing pulse cals , see the VLBAPCOR help file.
    • check solutions in POSSM.
      tget possm➜ to "get" all the inputs from the last run.
      aparm 0, 1, 0, 0, -180, 180, 0, 0, 3➜ set a fixed scale of -180 to 180 degrees for phase, and plot all IFs and polarizations together.
      inp
      go

      There may still be phase jumps between the IFs but that is because they are widely spaced in frequency. The overall phase slope across the IFs left over after the calibration is the MBD and is caused by clock and atmospheric errors. You will also note that sometimes the IF#2 on MK looks bad, also sometimes the fringes to MK and SC are weak. MK (Mauna Kea, Hawaii) and SC (St. Croix, US Virgin Islands) have the longest baselines, so those particular sources are being resolved out on these long baselines. The occasionally bad IF#2 on MK will probably not be a problem, but we may get fewer or more noisy solutions to MK and SC.

  10. Determine the MBD with FRING.
    default fring
    getn GEO file
    refant 9
    aparm(5) 1
    ➜ solve for MBD.
    docal 1; gainu 7➜ calibrate data with highest CL table. Again, do an imh here to make sure the highest CL table is really 7.
    inp
    go

    There will be some failed solutions (~5%) here and that is O.K..

  11. Check MBD with SNPLT.
    default snplt
    getn GEO file
    inext 'sn'
    nplots 8
    dotv 1
    opty 'mdel'
    ➜ plot MBD.
    xaxis 2➜ plot verses elevation.
    tvin➜ clear TV.
    go

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

    Note that most MBD are smaller than a ns. Large ones are probably wrong and should be clipped. You should note some big delays for LA, MK, NL, OV and SC. The |MBD| should increase with lowering elevation. Here the high LA, NL, OV and MK MBD look bad, but the SC MBD look O.K., because they occur at very low elevations.

  12. Edit the MBD with TABED.
    default tabed
    getn GEO file
    inext 'sn'
    ➜ edit SN table produced by FRING.
    invers 4;outvers 5➜ look in SN#4; produce SN#5
    opty 'clip'➜ flag row when values out of range.
    aparm 9 0➜ check column 9 which contains the MBD.
    keyval -5e-9, 5e-9➜ flag entries outside ±5 nsec.
    inp
    go

    Note the below is rather specific. Changes in FRING or editing of the data can make the solutions slightly different. But it is a good guide.
    Check in SNPLT (tget snplt;go) that all the bad points are clipped. One bad NL (ante# 7) point remains, use PRTAB (default prtab; getn GEO file; inext 'sn'; invers 0; docrt 73; box 1 4 9; to find it, take note of the row number. Then use a TABED to delete that row:
    tget tabed
    invers 5; outvers 5
    ➜ delete rows in situ from SN table from last run of TABED
    bcount 27; ecount 27➜ bad MBD is in row 27.
    opty 'DELE'➜ delete row(s) specified from bcount to ecount.
    aparm 9 0TABED insists on a column even though for opty='DELE' it doesn't really need one.
    keyval 0➜ since tget was used need to reset some inputs that were set in last run of TABED.
    inp
    go

    If you want you can check one last time: tget snplt; go .

  13. Solve for zenith and clock delays with DELZN.
    default delzn
    getn GEO file
    snver 5
    ➜ SN table with edited MBD
    gainv 7➜ CL table to copy and correct.
    aparm 0 3 2 1 1➜ 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 clocks.
    opty 'mdel'➜ fit MBD.
    outfi 'FITS:delzn.clor➜ file to read in with CLCOR; note if you leave of the closing ' the outfi retains the case.
    dotv -1➜ don't plot to TV make PL files.
    inp
    go

    Apply the CL table produced with POSSM (tvin; tget possm; go) and note that most of the MBD have been flattened. So we declare victory. If this was not the case then DELZN went wrong somewhere, and you should edit the MBD more or play with the DELZN inputs (particularly APARM which controls the number of terms in the polynomial fit etc.).

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. So use "imh" on the TARGET 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. Look in my text aips log, and see the CL table before the final fring fit is #7 (and #8 contains the final fringe fit). So we will apply the DELZN corrections to CL table #7.

  1. Apply the zenith and clock delay correction with CLCOR.
    default clcor
    getn TARGET file
    opco 'atmo'
    ➜ read in a file of atmospheric and clock delay corrections and apply them to the given CL table.
    clcorprm 1 0➜ correct both the atmosphere and clocks.
    gainv 7; gainu 0➜ input CL#7; create a new CL table.
    infile 'FITS:delzn.clor➜ file with corrections.
    inp
    go

    CLCOR will say it have created CL table #9. Use this for further calibration, i.e. skip CL#8..

  2. Do global fringe fit with FRING.
    default fring
    getn TARGET file
    calsour '-ttausb''
    ➜ find solutions for all sources except ttausb (too weak, and need phase referencing for astrometry).
    docal 1; gainuse 9➜ apply CL table out of CLCOR.
    refant 9➜ reference antenna PT.
    aparm(9) 1➜ do a extended baseline search.
    search 9 4 5 2 1 3 7 8➜ search these possible reference antennas in this order (PT, KP, LA, FD, BR, HN, NL, OV).
    inp
    go

    Will have a few failed solutions (~4%) but not many, that is O.K..

  3. Interpolate the fringe solutions, and apply calibration from phase calibrator (J0428+1732) to target (ttausb) with CLCAL.
    default clcal
    getn TARGET file
    sour 'ttausb''
    ➜ target.
    calsour 'J0428+1732''➜ phase calibrator.
    interpol '2pt'➜ 2PT interpolation.
    snver 5; gainv 9; gainu 10➜ apply SN#5 to CL#9 and produce CL#10.
    refant 9➜ reference PT.
    inp
    go
    sour 'J0431+1731''
    ➜ also phase reference check source (J0431+1731) to phase reference source.
    go
    sour calsour
    ➜ now calibrate phase reference source.
    go

  4. Make single source data sets with SPLIT. I like to work with single source files, its less confusing, especially when self-caling.
    default split
    getn TARGET file
    docal 1; gainu 10
    ➜ calibrate the date with CL table out of CLCAL.
    aparm 2 0 0 1 1 1➜ average frequencies in IFs, but don't average IFs; 0; 0; calibrate weights; pass cross and autocorrelations; add full source name to header.
    outcl 'delzn'➜ use outclass DELZN so we know these SPLIT files are different than ones that might exist.
    inp
    go

  5. Image with IMAGR.
    default imagr
    getn SPLIT file
    cell 0.00025; imsi 512
    ➜ use pixel size of 0.25 mas; image size of 512x512 pixels.
    niter 1000➜ use 1000 clean iterations.
    dotv 1➜ do interactive clean.
    go

    Compare to non-DELZNed image. The DELZN image should be better, have a higher peak and be less spread out. The best way to compare is with TVALL, TVLOD and TVBLINK:
    getn non-DELZNed image
    tblc 276 150; ttrc 376 249
    ➜ set bottom left corner and top right corner of box to display.
    pixange -3.00E-04 0.001 ➜ set the range of image intensity.
    tvall➜ load the image on the TV; click in the middle of the image and fit "b" a couple times, this will expend the image, then hit "d".
    tvps➜ use psuedocolor; hit "d" in the TV immediately.

    getn DELZNed image
    tvch 2
    ➜ set tvchannel to 2.
    tvlo➜ load image to 2nd channel of TV, you will not see it yet.
    tvbl ➜ blink between two images, because you set pixrange they are on the same scale and the improvement should be pretty obvious.
    tvch 1 ➜ set tvchannel to 1. I always to this immediately because if you don't, you will forget it is set to 2 and you will wonder why nothing is displaying to your TV.

    I usually do this second step in one line: getn DELZNed image; tvch 2; tvlo; tvbl;tvch 1.

If you finish early you might want to make an attempt to reduce the target dataset from the beginning. Just take the TARGET.CAL file and remove all the SN table and all but the first CL table with EXTDEST. I do not have a linked page with lots of explanations like this one for the data reduction but I do have a text aips log, which can be followed. A annotated/linked page could be made if it was thought to be useful.

If you have any question please contact Amy Mioduszewski. Last updated 06-May-2014.