Spectral line calibration and imaging

pre-school link to data and its description

AMS Richards, R Beswick, HJ van Langevelde

These examples are taken from the MERLIN and EVN archives; mm data will be covered separately although there are many similarities.

  1. S Per water masers - MERLIN
    Total intensity 22 GHz data for a red supergiant star, and a flux/bandpass calibration source. If you are a beginner, this is the most straightforward and quickest data set and processes are introduced in most detail. These data are unpublished but similar observations at an earlier epoch are described in 1999MNRAS.306..954R.

  2. S Per hydroxyl masers - MERLIN
    1.6 GHz data in full polarization, phase referenced, and other calibration sources These data are unpublished but similar observations at an earlier epoch are described in 1999MNRAS.306..954R.

  3. HI absorption - MERLIN
    1.4 GHz HI absorption against a continuum background for 3C293.

  4. Methanol masers - EVN
    6 GHz unpolarized data, phase referenced, for the star-forming region source G23.657-0.127 .

Footnotes are used for non-essential information which might be of use for future reference.

You will not have time to work on more than one or two data sets in a single session so you should choose which is of most interest to you. Even so, you may not finish data reduction here, but we have tried to prepare the data so that the most important or unique steps are covered near the beginning of each process. These instructions assume that you already know how to perform basic AIPS tasks including how to select files, look at header and extension tables, select sources, antennas etc. and set other task parameters, and you have used the commonest tasks used to process continuum data. The same guidlines as for continuum data apply when it comes to deciding whether a source is bright enough for self-calibration but as the noise level in a single e.g. 1 kHz channel is ~125x the noise in 15 MHz, the minimum flux density suitable for even phase self-calibration in a 2 min interval is e.g. ~750 mJy instead of 6 mJy for MERLIN at 1.6 GHz.

We assume that each task starts with default/blank settings or those recently input and example inputs are given; check these for yourself and when you are satisfied, to run a task e.g CALIB, type
go CALIB

Use HELP (task) or EXPLAIN (task) to make sure that you know what parameters you are setting. Always check INP (task) before GO (task). You can inspect the data/solutions using LISTR, VPLOT, UVPLOT, SNPLT etc. as relevant at any time. If solutions are a mess but you press on regardless things will probably only get worse. After running each task look at the message server.

If you have more than one AIPS disc, set INDISK, OUTDISK etc. (not needed at ERIS).


The MERLIN User Guide gives more details of spectral line calibration and imaging and typical AIPS inputs for MERLIN.

S Per water masers

255 x 0.0156 MHz channels were recorded in LL and RR, in Jan 1999. Note that MERLIN data normally contain (2^n - 1) channels and the reference channel is (2^n)/2

SPER was observed at a rest frequency of 22235.079 MHz shifted to a constant Vlsr of -38.50 km/s in the radio convention.

3C84 was observed at a constant frequency of 22236.840 MHz (close to the effective observing frequency for S Per). Monitoring by H Tersranta (Metsahovi) gives a flux density of 16 Jy at this epoch.

We inspect and edit the data, identifying the brightest S Per channels. We assume that the bandpass/flux calibrator, 3C84, is point-like. This is not strictly true but S Per is bright enough to amplitude self calibrate, so we shall ignor this unless it produces differences >>10% between long and short baselines.

3C84 is calibrated and used to derive a bandpass table which is copied to S Per. A bright S Per channel is used for self-calibration and the solutions are applied to all data. Some experimental images are made to check for ringing and optimum imaging parameters and the data are reweighted to improve sensitivity (the Ca antenna is most sensitive at 22 GHz) before making the final cube.

Make a directory to work in (e.g. SPER22), change to it, link to the data and set an environment:

mkdir SPER22
cd SPER22
ln -s /home/user/datastore/SPER99_22.FITS .
ln -s /home/user/datastore/3C8499_22.FITS .
export WORK=/home/user/SPER22

Load and prepare the data

3C84

AIPS 1:task 'FITLD'
AIPS 1:DOUVCOMP -1
AIPS 1:INFIL 'WORK:3C8499_22.FITS'
AIPS 1:OUTN '3C84_99_22';OUTCL 'MULTTB'

S Per

AIPS 1:INFIL 'WORK:SPER99_22.FITS'
AIPS 1:OUTN 'SPER_99_22'

Use IMH, PRTAB etc. to check

Add index and CL tables

AIPS 1:task 'INDXR'
AIPS 1:INFIL ' '
AIPS 1:CPARM 0 0 8/60

Run on both files (this sets the minimum solution interval to the same as the integration time)

Set the flux density of 3C84 and the rest freq of S Per

AIPS 1:task 'SETJY'
AIPS 1:getn 1
AIPS 1:SOURCE '3C84' ' '
AIPS 1:ZEROSP 16 0

AIPS 1:getn 2
AIPS 1:source 'SPER' ' '
AIPS 1:ZEROSP 0
AIPS 1:SYSVEL = -38.5
AIPS 1:RESTFREQ 22.23e9 0.000791e9
AIPS 1:VELTYP 'LSR'
AIPS 1:VELDEF 'RADIO'
AIPS 1:APARM 128,0

Inspect and edit the 3C84 data

POSSM plots phase and amplitude as a function of channel for one or many baselines.

AIPS 1:task 'POSSM'
AIPS 1:getn 1; source '3C84' ' '
AIPS 1:BCH 0;ECH 0
AIPS 1:solint 0;aparm 0
AIPS 1:NPLOT 6; DOTV 1

Note the data on all baselines should be around 16 Jy but the end channels are often higher/lower. If there are no obvious spikes/troughs apart from the end channels, examine the good part of the spectrum in more detail, say just to one antenna:

AIPS 1:ANTEN 4 0; NPLOT 4
AIPS 1:BCH 21;ech 240

The mean amplitude on any one baseline is around 14.8 - 16.2 Jy and the scatter is ~0.5 Jy; < 10% deviation, OK at 22 GHz The phase has a large scatter but no systematic slope.

As the spectral profile is OK we now average in channels to inspect and edit as a function of time (setting time interval to a single integration). Make the TV as wide as the screen; you need to also see the message server and main xterm.

AIPS 1:task 'IBLED'
AIPS 1:getn 1; source '3C84' ' '
AIPS 1:BCH 21;ech 240;DPARM 0 0 0 8 8
AIPS 1:DOCAT -1;ANTEN 0;BASE 0

Once IBLED has started, look at the left-hand menu in the TV display and set STOKES FLAG to 1111 so that all flags apply to all polarizations.

For these bright sources you can flag quite strictly. Isolated low points are particularly damaging. Inspect both polarizations and phase as well as amplitude. 3C84 is (approximately) point-like with an accurate position so the phase wrapping is due to atmosphere, note the approximate period (here, ~40 mins on the longest Cambridge baselines).

Note the UNDO FLAGS switch, easy to use immediately after you realise you have made a mistake, hard to go back to after many more flags. This shows the use of IBLED to Flag Below.

Inspect and edit S Per

AIPS 1:TVINI
AIPS 1:tget POSSM
AIPS 1: solint 0;aparm 0
AIPS 1:getn 2; source 'SPER' ' '

If all looks OK, average all antennas and zoom in on the peak

AIPS 1:BCH 101; ECH 140
AIPS 1:ANTEN 0; NPLOT 0

Note the brightest channel (124).

Edit - cautiously at this point on uncalibrated target data. Many targets are too weak to edit like this. Select the brightest channel, but make sure the ALL-CHANNEL and STOKES=111 flags are set. FLAG AREA is useful for flagging deviant phase points

AIPS 1:tget IB
AIPS 1:getn 2; source 'SPER' ' '
AIPS 1:BCH 124;ECH 124

Note the difference between sudden jumps in data due to phase errors, and apparently isolated points where in fact the phase is wandering close to +/-180 deg. This shows the use of IBLED to Flag Area.

Calibrate 3C84

Bright source, so use short solution interval

We have set the flux density in the SU table so this is used as a model point source at the pointing centre. We use Mk 2 as refant; you should choose an antenna with good data near the centre of the array. Set this in all further tasks needed a refant. The default FLAGVER 0 uses the highest number flag table available

AIPS 1:task 'CALIB'
AIPS 1:getn 1;calsour '3C84' ' ';clro;cparm 0
AIPS 1:bch 21;ech 240;refant 4
AIPS 1:solint 0.25; aparm(1) 3; aparm(7) 3
AIPS 1:solmo 'p'

Look at the message server, at least 90% solutions should be good. If not, inspect using SNPLT

AIPS 1:task 'CLCAL'
AIPS 1:inver 0;snver 1;gainver 1;gainuse 2

AIPS 1:tget CALIB
AIPS 1:docal 1;gainuse 2
AIPS 1:solint 0.5;aparm(1) 4; solmo 'a&p'

Always inspect amplitude solutions
AIPS 1:tvini
AIPS 1:task 'SNPLT'
AIPS 1:inext 'sn';opty 'amp';nplot 5

Amplitude solutions should be flattish and close to 1 with no isolated high/low points. If there are problems, delete the SN table, re-edit and try again. Isolated high amplitude solutions in the SN table are especially damaging as they will probably amplify noise.

AIPS 1:tget CLCAL
AIPS 1:inver 0;snver 2;gainver 2;gainuse 3

Bandpass calibration

BPASS takes a model - in this case a point source at the phase centre with a flat spectrum - and derives corrections channel by channel to make the data conform to this. The data are averaged in time so we apply the phase and amplitude solutions derived using CALIB. 3C84 was observed at the start and end of the observations, averaged separately. Prior to writing the FITS file, a flux scale and a bandpass correction using uncalibrated averaging was applied, so we don't need to normalise the data and we don't usually apply any weighting to MERLIN data during calibration (BPASSPRMs). 1

AIPS 1:task 'BPASS'
AIPS 1:getn 1; calsour '3C84' ' '
AIPS 1:docal 1;gainuse 3; solint 200
AIPS 1:refant 4
AIPS 1:BPASSPRM (11) 1

Plot the BP table in POSSM

AIPS 1:tvini
AIPS 1:tget POSSM
AIPS 1:getn 1; source '3C84' ' '
AIPS 1:bch 21;ech 240; aparm(8) 2
AIPS 1:solint 200
AIPS 1:nplot 6

The solutions are all within phase 0(+/-2) deg, amp 1(+/-0.05) which is very acceptable.

Apply BP to 3C84, using DOBAND 5 as we have two time intervals in the BP table, and APARM(1) 1 to vector average now that the data are calibrated.

AIPS 1:tget POSSM
AIPS 1:docal 1; gainuse 3; doband 5;bpver 1
AIPS 1:aparm 0; aparm(1) 1
AIPS 1:solint 0

Check that it looks flat at the right flux and the phase is close to zero

Copy BP table to S Per

AIPS 1:task 'TACOP'
AIPS 1:getn 1;geto 2
AIPS 1:inext 'BP';inver 1;outver 1

Inspect and calibrate S Per.

AIPS 1:tget POSSM
AIPS 1:getn 2; source 'SPER' ' '
AIPS 1:docal -1; aparm 0
AIPS 1:doband 5; bpver 1
AIPS 1:anten 4 0;base 0;nplot 8

All the baselines look similar; some are noisier than others.

Phase calibration.

We have no phase reference source and no other model so we start with the default point model at the pointing centre. This means that the position will only be as good as the input position; this is obviously fairly good as the phase does not wrap very fast in IBLED but the brightest maser could be anywhere in the shell so the overall position uncertainty is around 100-200 mas at this stage.

We don't yet know if the brightest channel is a point so initially we use a fairly long solution interval, just good enough to allow us to make a map without forcing the data to be a perfect point. The data are quite good so we pass failed solutions as they are more probably due to deficiencies in the model than in the data. We use the brightest channel to derive the solutions but apply corrections to all channels.

AIPS 1:task 'CALIB'
AIPS 1:getn 2; calsour 'SPER' ' '
AIPS 1:bch 124; ech 124; refant 4
AIPS 1:anten 0; base 0; solint 10
AIPS 1:docal -1;doband 5; bpver 1
AIPS 1:aparm(1) 3; aparm(7) 2; aparm(9) 1
AIPS 1:solmo 'p'; cparm 0;snver 0

Check that most solutions are valid and plot

AIPS 1:tvini
AIPS 1:task 'SNPL'
AIPS 1:getn 2; opty ' ';nplot 5; inver 0

AIPS 1:task 'CLCAL'
AIPS 1:getn 2; 
AIPS 1:inver 0;snver 1; gainver 1; gainuse 2
AIPS 1:source ' '; calsou ' '

Inspect the calibrated phase and amplitude as a function of time

AIPS 1:task 'VPLOT'
AIPS 1:getn 2; sourc 'SPER' ' '
AIPS 1:doband 5;bpver 1
AIPS 1:docal 1;gainuse 2
AIPS 1:bch 124; ech 124; refant 4
AIPS 1:ncom 0;flux 0;bch 124;ech 124
AIPS 1:stokes 'i';anten 4 0;nplot 4
AIPS 1:solint 0.5
AIPS 1:aparm 0;bparm 0,-1

Regular undulation of the visibilities especially on the longer baselines shows that structure is present.

Now image the brightest channel, applying our calibration. At this stage we use completely natural weighting. The other parameters are suitable for a high-Dec source for MERLIN at 22 GHz. Box carefully while cleaning and don't clean too much, we just want to get a few CC for a model. We also use a priori knowledge that the water maser shell is probably not more than ~150 mas = 50 pixels in diameter, and the brightest masers are point-like to MERLIN although fainter ones may be slightly extended.

AIPS 1:task 'IMAGR'
AIPS 1:getn 2; source 'SPER' ' '; outn 'SPER_124'
AIPS 1:bch 124; ech 124;
AIPS 1:docal 1;gainuse 2;doband 5; bpver 1
AIPS 1:cellsiz 0.003 0.003; imsiz 512 512
AIPS 1:zerosp 0
AIPS 1:UVWTFN     'N'; robust 5
AIPS 1:niter 1000; dotv 1; minpatch 255

Get map file and inspect CC

AIPS 1:task 'CCMRG'
AIPS 1:inver 0;outver 0

AIPS 1:task 'PRTCC'
AIPS 1:docrt 1

A typical list may look like

   Comp        Delta X        Delta Y       Flux            Total
       #      Milliasec      Milliasec        Jy               Jy
       1           0.00           0.00      45.3009567       45.3009567
       2           6.00          -3.00      -4.0146446       41.2863121
       3          -6.00           3.00      -3.7528672       37.5334435
       4          -9.00           0.00      -1.7512995       35.7821426
       5           9.00           0.00      -1.4392179       34.3429260
       6          -3.00         -39.00       1.4138933       35.7568207
       7           0.00         -39.00       0.8262934       36.5831146

etc.

The components are in the selected boxes but some are negative; we edit these out. 2

AIPS 1:task 'CCSEL'
AIPS 1:SCALR1 0.002
AIPS 1:cutoff 1e-6

Check with PRTCC

Look at the naturally weighted dirty beam to show where artefacts due to sidelobes are most likely.

Run CALIB as before i.e. docal -1, but use get2n to use your map as a model and set NCOMP to the number of CC you want to use. in2se 0 means that the highest number map model will always be used, set it to the exact number if you want. Don't go fainter than 2-3 sigma. If you are confident in your model use a shorter solint e.g. 2 mins

AIPS 1:tget 'CALIB'
AIPS 1:getn 2; calsour 'SPER' ' '
AIPS 1:bch 124; ech 124; refant 4
AIPS 1:in2n 'SPER_124'; in2cl 'ICL001';in2se 0;ncom 3 0 
AIPS 1:anten 0; base 0; solint 2
AIPS 1:docal -1;doband 5; bpver 1
AIPS 1:aparm(1) 3; aparm(7) 2; aparm(9) 1
AIPS 1:solmo 'p'; cparm 0;snver 0

Now in CLCAL be careful to use the correct input tables: no input calibration, but write a new CL table - in other words, for calibration on the same source, the CALIB GAINUSE becomes the CLCAL GAINVER,
or if DOCAL -1 in CALIB, then in CLCAL use GAINVER 1

AIPS 1:tget 'CLCAL'
AIPS 1:inver 0;snver 2;gainver 1;gainuse 3

AIPS 1:tget IMAGR
AIPS 1:gainuse 3

Use CCMRG and PRTCC

Amplitude Calibration

If possible we need to get the phase calibration as good as possible before amplitude self-calibration, so that we can average over a longer time period (for good signal to noise) and have a good model. 3

This time apply the highest No CL table. Normalise the amp solutions in case not all the flux is in the model (cparm(2) =1)

AIPS 1:tget calib
AIPS 1:docal 1;gainuse 3
AIPS 1:solint 2
AIPS 1:aparm(1) 4;solmo 'a&p'; cparm 0 1
AIPS 1:ncomp 

Use SNPLOT and if necesary SNED to clip out too-high amp points

Set doblank 1 in CLCAL to smooth over blanked solutions

AIPS 1:tget CLCAL
AIPS 1:doblank 1
AIPS 1:inver 0;gainver 3;gainuse 4;snver 4

See if there are any wild points for editing in IBLED

Re-image with gainuse 4

The image may be much improved e.g. all +ive CC down to a noise level ~0.05 Jy

Use CCNTR to plot the +ive CCs above the noise on top of the image - example inputs below, the exact ones depend on your image. Use TVWIN to select an off-source part of an image and use IMSTAT to measure the rms noise. You can then use the task KNTR to make a contour plot. This illustrates the way you can enter expressions for AIPS to evaluate (HELP POPSY lists the allowed symbols) - PIXSTD is the noise from IMSTAT, *1.3535E-02 in this example.

AIPS 1:BLC =    66.00   49.00    1.00    1.00    1.00    1.00    1.00
AIPS 1:TRC =   471.00  188.00    1.00    1.00    1.00    1.00    1.00
AIPS 1:IMSTAT
AIPS 1:Mean=-2.1415E-04 rms= 1.3535E-02 JY/BEAM   over   56840. pixels

Note use of FOR loop to set levs. CTYPE(1) is the type of symbol and CTYPE(2) is the number of CC to plot. As in selecting NCOMP for calibration, go down to the first negative or to the 2 or 3 sigma noise in the image. After setting CLEV, use TVWIN to box your image area.

AIPS 1:task 'CCNTR'
AIPS 1:clev 3*pixstd
AIPS 1:lev(1)=-1;for i=2:15;lev(i)=2**(i-2);end
AIPS 1:inext 'cc';ctyp 0,19

The CCNTR plot shows how good your selected CC match the image.

CALIB again, use the select CC from the new map as a model, reduce the solint e.g. 0.5. Use the latest CL table as GAINUSE and inspect the resulting table with SNPLT.

If you have persistent isolated extreme amplitude solutions you can use task 'SNED' to edit the SN table.

CLCAL - take care to use the correct SN and CL tables If you have used SNED then set DOBLANK -1 so that blanked solutions will not appear in the data when that CL table is applied.

Repeat the cycle until the solutions and images show no improvement.

Try IMAGR without interactive boxing, you hope that you won't have to do this for all 255 channels...

Inspect the calibrated data

tget VPLOT and set the appropriate GAINUSE etc. and get2n your bset map and select the good CC as a model, as for CALIB.

The line derived from Fourier Transformation of the CCs follows the phase and amplitude showing that the model derived from the CC of this map is a good fit to the data.

Repeat POSSM applying the best calibration and averaging all baselines and polarizations.4

AIPS 1:tget POSSM
AIPS 1:docal 1;gainuse 0
AIPS 1:APARM(1) 1 
AIPS 1:anten 0;base 0
AIPS 1:stokes 'i';nplot 0

Select one of the faintest channels with signal and image that. The off-source noise (measured with IMSTAT) should be around 13-14 mJy/beam.

Now image 12 or so channels around the peak

AIPS 1:tget IMAGR
AIPS 1:gainuse 6
AIPS 1:bch 118;ech 130;outn '118-130'
AIPS 1:nchav 1;chinc 1
AIPS 1:dotv -1

This is to check for 'ringing'; for very bright lines the correlator may introduce artefacts such that the amplitude zig-zags from cahnel to channel. In this example the file 118-130.ICL001.1 has 13 channels, and 7 corresponds to the brightest channel. Load this

AIPS 1:tblc 0 0 7;ttrc 0 0 7

zoom in and box about 9 pixels around the peak. This will give e.g.

AIPS 1:BLC =   255.00  256.00    7.00
AIPS 1:TRC =   257.00  258.00    7.00

Plot the spectrum obtained by drilling through the cube in this region.

AIPS 1:task 'ISPEC'
AIPS 1:opty 'flux'
AIPS 1:dotv 1
AIPS 1:blc 255 256 1; trc 257 258 0
AIPS 1:tvini
AIPS 1:go ispec

This shows no ringing here.

If everything is OK, split out the source applying all calibration (*set appropriate GAINUSE No.)
Exclude the very end channels (set appropriate BCHAN and ECHAN) In the example here, the reference channel will be 108 in the SPLIT file which contains 220 channels (see its header)

AIPS 1:task 'SPLIT'
AIPS 1:source 'SPER' ' '
AIPS 1:stokes ' ';docal 1;gainuse 6*
AIPS 1:doband 5;bpver 1;flagver 1;douvcomp -1
AIPS 1:BCH 21;ECH 240;aparm 0

Reweight the antennas according to sensitivity (see the MERLIN User Guide table 4.3

Get the SPLIT file and run WTMOD. You might want to also rename the file e.g. SPER_99_22

AIPS 1:task 'WTMOD'
AIPS 1:antwt 1.64 1 1 1 1

AIPS 1:tget POSSM
AIPS 1:inn 'SPER_99_22';incl 'WTMOD'
AIPS 1:BCH 16;ech 240
AIPS 1:APARM 1 1 0 40,-200,200 2 0 0 1
AIPS 1:LTY -7

This total intensity plot shows the full spectrum (yellow) and the faintest emission 1 Jy (green, right-hand scale). You can use OUTFILE to write the spectrum to disc as ascii for your favourite plotting package, e.g. to plot the amplitudes on a logarithmic scale - the phase shows structure for almost the entire velocity range but this can't be seen using a linear amp scale on a single plot.

Setting up IMAGR to produce a datacube.

This is specific for this kind of maser, if you think that there is no very extended diffuse emission and you want to maximise the resolution and the signal to noise ratio.

SPLIT has written the calibration into the data so turn it off in IMAGR. Try moderately uniform weighting - too much, and the image becomes too noisy. UVBOX and UVBXFN are set to average over a small region to smooth values used for interpolation. AIPS sometimes fits very badly for sparse apertures/ragged beams. At the high Dec of S Per, a circular beam size of about 10-12 mas should be possible and we can force this.

We can use IMAGRPRM(5) to reduce the noise.

Use a medium-bright channel for tests using the WTMOD file e.g.:

AIPS 1:tget IMAGR
AIPS 1:docal -1;doband -1;bch 80;ech 80
AIPS 1:uvwtfn ' ';robust 0.6;uvbox 5;uvbxfn 4
AIPS 1:outn 'SPER_80_R0.6'
AIPS 1:bmaj 0.01;bmin 0.01
AIPS 1:imagrprm(5) 1

Note these messages

IMAGR1: UVWAIT: Noise is increased by a factor 1.077 due to weighting

- I usually try and keep it < 10%

IMAGR1: Field   1 fit FWHM =   10.106 x    8.536 Milliarcsec, PA=  -43.4   

- The size AIPS fits for the beam, quite close to what we want.Compare the partially uniformly weighted beam e.g. robust 0.6 with the naturally weighted beam.

Compare the final image with a naturally weighted image; the noise should be quite low but the source should not be missing bits, nor look artificially bobbly. Examples of weighting extremes on images: from left to right, the top row is letting IMAGR fit the beam with robust 5, 0, -5 the lower image is robust 0.6, 10 mas beam, scaled residuals

Finally, set a flux cutoff. This is so that IMAGR looks for clean components which might have sidelobes above the noise, but does not waste time cleaning noise

IMAGR1: Field   1 Beam min = -140.2 MilliJy, max =    1.0      Jy

- tells us the worst sidelobe is ~1/7 peak.
Thus, if the offsource noise in a channel with faint emission is 6.5 mJy/beam then set FLUX to 0.0065 * 7 You can then increase niter so that the brightest channels are well cleaned, although they may always be noisier due to dynamic range limitation.

These are typical final IMAGR settings at 22 GHz. See HELP or EXPLAIN IMAGR for more details and check all settings not given. In brief, uvbox 5;uvbxfn 4 uses a locally smoothed average in order to calculate the values used for extrapolation in the partial uniform weighting. imagrprm(5) scales the residuals in the ratio of the requested to the AIPS-fitted beam size5

If you set the rest frequency and velocity in the original UV data with SETJY, this is included in the output datacube header and if you want plots labelled in velocity use ALTSW

Plot the cube using KNTR - set appropriate CLEV. For a very large number of panes on one page I use widely-spaced contours

AIPS 1:DOCONT 1
AIPS 1:DOGRE -1;DOVEC -1
AIPS 1:blc 216 201 28
AIPS 1:trc 315 300 206
AIPS 1:levs 1 4 16 64
AIPS 1:label 1

To print the plot to disc, I used

AIPS 1:LWPL
AIPS 1:lpen 1;dparm 0 0 0 0 1 4 31 6

to make this crowded plot of the cube - select fewer planes to get the scale you want.

You can visualise the cube on-screen (see instructions on terminal once it has started)

AIPS 1:task 'TVCUBE'
AIPS 1:tblc 216 201 28
AIPS 1:ttrc 315 300 206
AIPS 1:functy 'lg';pixr 0
AIPS 1:ltype 3

To make a single image by simple summing:

AIPS 1:task  'SQASH'
AIPS 1:blc 216 201 28
AIPS 1:trc 315 300 206
AIPS 1:BDROP 3
AIPS 1:DPARM 1 0

Load the result into the TV using functy 'lg' and TVZOOM and TVPS. You will see that there are background sidelobes from the brightest channel. Using TRANS followed by MOMNT (see the HI tutorial) gives more control and can also produce a first moment weighted velocity image (blue is blue-shifted, red is red-shifted emission).

In either case choose the blc and trc and cutoffs carefully. For the example shown, I selected BLC 216 201 28; TRC 315 300 206 in TRANS and in MOMNT I used the whole resulting cube and

AIPS:task 'MOMNT'
AIPS 1:functy 'HB'
AIPS 1:flux 0.05;icut 0.05

For the 1st and second moments, remember not to use a log FUNCTYPE in TVLOD.

Further interpretation of the data is described in GaussianComponentFitting and other topics under ImageAnalysisandModelFitting - a full data cube (probably not as good as yours) is in /home/user/datastore/MERLIN_CUBES/SPER_99_22.ICL001.1.


S Per hydroxyl masers - MERLIN

S Per was observed in May 1999 in full polarization (LL RR LR RL). 511 x 1 kHz channels were recorded centred on the 1665.402 and 1667.359 MHz OH lines shifted to a constant Vlsr of -38.50 km/s in the radio convention. The phase reference source 0200+539 was observed in the maximum available bandwidth of 15 MHz for best signal to noise. 3C84 and 3C286 were observed in all 3 configurations. An exerpt from the raw data listings shows how the narrow and wide band data are interleaved. We have selected the narrow band data at around 1667 MHz only, plus the wide band calibration data.

3C84 has an estimated flux density of 26.4 Jy, found by comparing uncalibrated visibilities with 3C286, which has a stable flux density of 13.6 (Baars 1977) at this frequency.

Locate the data etc.

Make a directory to work in (e.g. SPEROH), change to it, copy the MERLIN procedure (the extension being your AIPS No in ehex, here 10 = 00A), link to the data and set environments. One data set has to be downloaded remotely, which is the wget command; this may take a little time.

mkdir SPEROH
cd SPEROH
cp /home/user/MERLIN.ehex MERLIN.00A
cp /home/user/MERLIN.HLP .
ln -s /home/user/datastore/0200+539.FITS .
ln -s /home/user/datastore/SPER99_1667.FITS .
ln -s /home/user/datastore/SPER99_1667_NCALS.FITS .
wget 'http://www.merlin.ac.uk/ERIS/SPER99_1667.FITS'

export WORK=/home/user/SPEROH
export RUNFIL=/home/user/SPEROH

One data set has to be downloaded:

FITS File

Sources

Centre freq

Nchan

Chan width

Vlsr

SPER99_1667.FITS

SPER

1667.359 MHz

511

0.977 kHz

-38.5

SPER99_1667_NCALS.FITS

3C84 3C286

1667.6 MHz

511

0.977 kHz

(fixed freq)

0200+539.FITS

0200+539 3C84 3C286

1661.2 MHz

1

13 MHz

(fixed freq)

Calibrate the wide-band continuum calibrators

First we will use the MERLIN procedure to calibrate the phase reference source and derive polarization corrections. We therefore pretend that 0200+539 is the target to begin with. This is self-calibrated in a wide field as there is a confusing source 3 arcmin to the south6.

0200+539.FITS contains the phase-reference source 0200+539, the bandpass and secondary flux calibrator (ACAL) 3C84, and the primary flux and polarization angle calibrator 3C286, all in a single 13-MHz channel centred on 1661 MHz.

Start AIPS and load the MERLIN procedure as described in GettingStartedonaDataset

Set INDISK and DIR.

The example inputs below use DOPLOT 2 and DOEDIT 1 to give you real-time display of plots and allows you to edit interactively.

In this instance we have the phase-reference source as target. The source will be images and self-calibrated automatically but DOTV 1 lets you see the imaging when it is being treated as a target. You can abort this if you want since it is a duplicate of the image which has just been made of the same source as a phase-ref.

Because of the large image size this runs quite slowly; if you know what you are doing you can set DOPLOT 3 and DOTV -1 so that after you have edited the data you can get on with something else.

AIPS 1:DOLOAD 2
AIPS 1:TARGET '0200+539'
AIPS 1:ACAL '3C84'
AIPS 1:AFLUX 26.4
AIPS 1:DOPLOT 2
AIPS 1:DOEDIT 1
AIPS 1:DOPHSC 2
AIPS 1:DOPLZN 1
AIPS 1:DOTGSC 0
AIPS 1:DOCHANS 0
AIPS 1:REFANT 0
AIPS 1:DOFLUX 1
AIPS 1:IMSIZ 2048   16384
AIPS 1:DOTV 1
AIPS 1:INP MERLIN
AIPS 1:tput MERLIN

Remember to SET STOKES FLAG to 1111 every time IBLED runs. Note any periods of bad data on 0200+539 longer than a single scan, as S Per might also be bad at this time. As the S Per data are in a separate file you will have to flag this separately. Whatever the SOURCE flag says, flagging by timerange will flag all sources, beware if the yellow time tick marks are close together as they can conceal sources which are not displayed.

When editing 0200+539, note the 'beating' on some baselines (long or short? what does this mean?). There is in fact a confusing source in the field, which is why we have selected DOPHSC 2 and such a large field; although 0200+539 is itself point-like the proccess builds up a model including the confusion. 0200+539 showing confusing source which is fainter but appears more extended, probably because of smearing as it is so far from the field centre. This could be avoided by retaining narrower channels.

When you see the plots of SN tables, note which antenna has zero phase solutions. The procedure picks a suitable reference antenna and you should use this for S Per as well.

The lowest contour level in the plots is set to 3 sigma rms noise, or 5 sigma rms for very large plots. The measured noise levels also flick past in the xterm. The signal to noise ratio should increase with each iteration.

0200+539 final plot and calibrated visibilities for 02200+359 showing structure on short baselines (beating too fast to resolve on long baselines in this plot).

Continuum results

After the procedure is finished, these are some of the things to note for use in the spectral line processing:

Make sure that you don't delete

0200+539.MULTTB
3C84.TASAV
0200+539.TASAV

Look at the source table for 0200+539.MULTTB7

AIPS 1:DOCRT 1; inver 0;inext 'su';go PRTAB

Make a note of the 3C84 flux density which has been calculated by comparison with 3C286 using calibrated data.

The L-R phase offset correction (necessary to set the polarization angle origin) is found from

PRTASK 'CLCOR';DOCRT 1;PRTHI

Make a note of CLPARM( 1) e.g. CLPARM( 1)=  84

3C84.TASAV SN 4 contains the time-constant amplitude correction which will be copied to the target data.

 0200+539.TASAV
For the MERLIN procedure settings given above,
SN 2 contains phase-only solutions
SN 3 contains additional phase solutions and amplitude solutions.
(in general, these are the second-highest and highest numbered SN tables) which will be applied to the target.

Look at the SN plots 0200+539TCAL1_1_P_SN_1 0200+539TCAL1_1_P_SN_2 to see which antenna has zero phase solutions - the procedure automatically selects the refant.8

Make sure you note the various visibility data file names, what sources they contain and the functions of their SN, CL and other extension tables. Flowcharts such as in the MERLIN User Guide Figs F5 and F6 (make your own, these processes here won't be exactly the same) might help.

Narrow-band multi-channel data

Load, inspect and edit the calibration sources

Load the narrow-band data (SPER99_1667.FITS, SPER99_1667_NCALS.FITS) into the same AIPS No. Type RESTORE 0 to initialise settings.

Use FITLD and make sure you set the outnames to something unique e.g. SP67 and SPCAL67, and use DOUVCOMP -1

Index the data as for the 22 GHz data but use a 0.5 min solution interval.

These are the inputs for SETJY for each file

SPCAL67.MULTTB
AIPS 1:task 'SETJY'
AIPS 1:SOURCE '3C84' ' '
AIPS 1:ZEROSP  (value of refined 3C84 flux from the continuum data)
AIPS 1:aparm 0

AIPS 1:SP67.MULTTB
AIPS 1:source 'SPER' ' '
AIPS 1:ZEROSP 0
AIPS 1:SYSVEL = -38.5
AIPS 1:RESTFREQ 1667e6 0.359e6
AIPS 1:VELTYP 'LSR'
AIPS 1:VELDEF 'RADIO'
AIPS 1:APARM 256,0

Use POSSM, VPLOT to inspect the data as at 22 GHz.

Use STOKES 'HALF' if you want to see both LL and RR

Edit 3C84 and 3C286. Don't try to edit S Per, it is too weak at 1.6 GHz in these narrow channels.

Correcting the Wide-band - Narrow band (multi channel) frequency offset

The multi-channel 3C84 was observed very close in frequency to S Per in the same spectral configuration (remember that the LSR correction includes components for the direction in the sky and the source velocity) but the wide-band single channel data cover a significantly different frequency range and there may be an offset in phase between the data which we have to correct for in order to apply the phase-reference source solutions to S Per. This shows up as a difference in phase solutions for 3C84.

Here I set refant to 5; use whatever antenna you have chosen; also make sure that you use the SN/CL table numbers appropriate to your data.

Using 0200+539.MULTTB

AIPS 1:task 'CALIB'
AIPS 1:calsou '3C84' ' ' ';docal -1;anten 0;base 0;refant 5
AIPS 1:aparm 3 0 0 0 0 0 3; solint 0.5; solmo 'p';snver 0

Using SPCAL67.MULTTB
Run CALIB as above with BCHAN and ECHAN as decided from POSSM e.g. BCHAN 31;ECHAN 480

Inspect SN 1 on each data set

tvini
AIPS 1:task 'SNPLT'
AIPS 1:PIXR -200 200; inext 'SN'; inver 0;NPLOT 12;dotv 1
AIPS 1:timer 0 14 0 0 0 15 30

0200+539.MULTTB

AIPS 1:GRCH 1; inext 'SN'; inver 1;go SNPL

SPCAL67.MULTTB

AIPS 1:GRCH 2; inext 'SN'; inver 1; go SNPL

Phase solutions superimposed for wide-band (yellow) and multi-channel (green) 3C84 data. The phase offset is mostly small (remember -180 = +180) and fairly constant in time (good). Note that on Knockin the phase in a single configuration jumps (bad); select a time between these jumps e.g. TIMERANG 0 14 25 0 0 14 40

Copy SN 1 from 0200+539.MULTTB to SPCAL67.MULTTB

AIPS 1:task 'TACOP'
AIPS 1:inn '0200+539';incl 'MULTTB'  
AIPS 1:outn 'SPCAL67'; 
AIPS 1:inext 'SN'; inver 1;outver 2;ncount 1

SN 2 on SPCAL67 (narrow band) now contains the phase solutions from the wide-band data for 3C84, which we write to CL2

AIPS 1:task 'CLCAL'
AIPS 1:inn 'SPCAL67'; incl 'MULTTB'  
AIPS 1:inver 0
AIPS 1:timer 0 14 25 0 0 14 40
AIPS 1:refant 5;gainver 1;gainuse 2; snver 2;
AIPS 1:source ' '

If we apply CL2 in CALIB, the resulting solutions will contain just the difference between the wide and narrow band phases (check other settings)

AIPS 1:tget 'CALIB'; 
AIPS 1:inn 'SPCAL67'; incl 'MULTTB'  
AIPS 1:timer 0 14 25 0 0 14 40
AIPS 1:refant 5;solint 5
AIPS 1:docal 1;gainuse 2
AIPS 1:snver 3

AIPS 1:tget SNPL
AIPS 1:inn 'SPCAL67'; incl 'MULTTB'  
AIPS 1:timer 0 14 25 0 0 14 40
AIPS 1:grch 0;pixr 0;inver 3

Now you should see that the phase solutions for each antenna in the SN table are close to the differences seen in our selected timerange in the original offset plot and represent the wide band - multi channel phase offset.

SPCAL67.MULTTB SN3 contains wide-narrow phase offset solutions

Hereafter, make sure that timerang is reset to 0 (i.e. all times) unless you want to make a selection.

Bandpass corrections

We need to calibrate the 3C84 multi-channel data; this is separate from having just used this source to estimate the phase offset Check that REFANT, BCHAN and ECHAN are set consistently and the SN and CL table Nos are correct for your data.

SPCAL67.MULTTB SN1 contains phase-only solutions for 3C84 narrow band. Apply these to create a new CL table

AIPS 1:task 'CLCAL'
AIPS 1:inver 0;timerang 0
AIPS 1:snver 1;gainver 1;gainuse 3

For amplitude and phase calibration, the flux density which you set in the SU table using SETJY is used as the intensity of a point source at the pointing centre.

AIPS 1:task 'CALIB'
AIPS 1:docal 1;gainuse 3;timerang 0
AIPS 1:calsour '3C84' ' '; solint 5
AIPS 1:aparm 4 0 0 0 0 0 3
AIPS 1:solmo 'a&p';snver 0;cparm 0

This makes SN 4. Check using SNPL

AIPS 1:tget 'CLCAL'
AIPS 1:inver 0;timerang 0
AIPS 1:snver 4;gainver 3;gainuse 4

CL 4 now contains amplitude and phase solutions for 3C84

Derive the bandpass corrections. This is similar to the procedure at 22 GHz but the atmospheric amplitude effects fluctuate less with time at 1.6 GHz and our channels are even narrower so we average all the data in time.

AIPS 1:task 'BPASS'
AIPS 1:calsour '3C84' ' '
AIPS 1:docal 1;gainuse 4; solint -1
AIPS 1:refant 5
AIPS 1:BPASSPRM (11) 1

Plot the BP table in POSSM

tvini
AIPS 1:tget POSSM
AIPS 1:source '3C84' ' '
AIPS 1:bch 31;ech 480; aparm(8) 2
AIPS 1:solint 200
AIPS 1:nplot 6

Polarization calibration

It is possible to copy the calibraton from the wide-band data, but experience has shown that better results are often obtained deriving corrections from 3C236 and 3C84 observed in the closest configuration to the spectral line target. 3C84 is unpolarized on these scales so only leakage corrections need to be solved for and the short run on this source is sufficient. Note that if a model with zero polarized flux is given, the task 'PCAL' tries to determine polarization, so we set a negligible but non-zero value. This can only be run on data squashed to a single channel, in an indexed file.

Split out calibrated 3C84 data from SPCAL67.MULTTB

AIPS 1:task 'SPLIT'
AIPS 1:source '3C84' ' ';stokes ' '
AIPS 1:bch 31;ech 480;docal 1;gainuse 4;doband 1;bpver 1
AIPS 1:aparm 2 0

AIPS 1:task 'MULTI'
AIPS 1:inn '3C84';incl 'SPLIT';aparm 0.5 0

AIPS 1:task 'INDXR'
AIPS 1:inn '3C84';incl 'MULTI';clr2n;cparm 0 

Inspect the antenna table using task 'PRTAN'

Use PCAL to derive the corrections

AIPS 1:task 'PCAL'
AIPS 1:inn '3C84';incl 'MULTI'
AIPS 1:calsour '3C84' ' ';docal -1;doband -1
AIPS 1:pmodel 24.86 1e-9  1e-9 1e-9
AIPS 1:solin 2;solty 'appr';refant 5

When the messages from PCAL appear, the amp corrections should be just a few percent - i.e. < 0.1, average <~0.05. The polarized flux density of 3C84 should be zero within reasonable errors.

Inspect the antenna table again to see the leakage solutions.

Delete the existing AN table on SP67.MULTTB and replace it with the corrected table from 3C84.MULTI

AIPS 1:inn 'SP67';incl 'MULTTB'
AIPS 1:inext 'AN';inver 0;extd

AIPS 1:task 'TACOP'
AIPS 1:inn '3C84';incl 'MULTTI'
AIPS 1:outn 'SPCAL67';outcl 'MULTTB'
AIPS 1:inext 'AN';inver 0;outver 0;ncount 1

Phase calibrate 3C286 - no prior time-dependent calibration

Using SPCAL67.MULTTB

AIPS 1:task 'CALIB'
AIPS 1:calsou '3C286' ' ';docal -1;doband 1;bpver 1
AIPS 1:anten 0;base 0;refant 5;bch 31;ech 480
AIPS 1:aparm 3 0 0 0 0 0 3 0 0; solint 1; solmo 'p';snver 0

Probably makes SN 5; write to a new CL table

AIPS 1:task 'CLCAL'
AIPS 1:refant 5;inver 0;snver 5;gainver 1;gainuse 5

List the apparent polarization angle

AIPS 1:task 'LISTR'
AIPS 1:docrt 1
AIPS 1:source '3C286' ' ';stokes 'POLC';opty 'MATX'
AIPS 1:inext ' ';docal 1; gainuse 0;doband 1;bpver 1;dopol 1
AIPS 1:bch 31;ech 480;dparm 1 1 4 1000

The output will look something like

Ant -- 1-- 2-- 3-- 4-- 5-- 6
 1|     -71 -60 -62 -49 -50
 2| -52     -58 -57 -52 -47
 3| -46 -57     -61 -77 -44
 4| -88 -64 -76     -51 -56
 5| -55 -73 -76 -63     -56
 6| -57 -64 -77 -68 -68
Ampscalar average of matrix    =-6.111E+01(8.782E-01) sigma = 4.734E+00

The scatter should not be much worse than this example. Here, the apparent angle is -61.11 deg. In the uv plane 3C286 should have a polarization angle of 66 deg. This is corrected using CLCOR. LISTR is the angle measured above, so in this example
CLCORPRM(1) = 127.11 Note this number.

AIPS 1:task 'CLCOR'
AIPS 1:source '3C286' ' ';stokes 'L'
AIPS 1:gainver 5;gainuse 5
AIPS 1:opcod 'POLR'
AIPS 1:CLCORPRM = (66-LISTR),0

Re-run LISTR.
You should now get something like9

Ampscalar average of matrix    = 6.600E+01(8.967E-01)

Calibration of S Per at 1.6 GHz

Transfer of reference source and other calibration

Copy the AN table from SPCAL67.MULTTB to the target data (having first deleted the latter's AN table)

AIPS 1:inn 'SPCAL67';incl 'MULTTB';inext 'AN';inver 0;extd

AIPS 1:task 'TACOP'
AIPS 1:inn 'SPCAL67';incl 'MULTTB'
AIPS 1:outn 'SP67';outcl 'MULTTB'
AIPS 1:inext 'AN';inver 0;outver 0;ncount 1

Copy the BP table from SPCAL67.MULTTB to SP67 using TACOP

Copy SPCAL67.MULTTB SN3, which contains wide-narrow phase offset solutions, to SP67.MULTTB using TACOP. SP67.MULTTB SN1 now contains wide-narrow phase offset solutions (you can check that you have copied the right table using SNPL)

Copy the SN table contaning the flux scale correction derived from the single-channel data to the target

AIPS 1:task 'TACOP'
AIPS 1:inn '3C84';incl 'TASAV'
AIPS 1:outn 'SP67';outcl 'MULTTB'
AIPS 1:inext 'SN';inver 0;outver 2

SP67.MULTTB now has two SN tables containing a time-constant correction for phase offset and for flux scale respectively. We write these sequentially to CL tables.

AIPS 1:task 'CLCAL'
AIPS 1:source ' '; calsour ' '
AIPS 1:bparm 1000 1000;DOBTWEEN  1;
AIPS 1:SAMPTYPE 'BOX';SMOTYPE 'FULL'
AIPS 1:inver 0;snver 1;gainver 1;gainuse 2

AIPS 1:snver 2;gainver 2;gainuse 3

Check the CL table

AIPS 1:tvini
AIPS 1:task 'SNPL'
AIPS 1:source 'SPER' '
AIPS 1:inext 'cl';inver 2
AIPS 1:nplot 12;opty 'phas'

Repeat for opty 'amp'.

CL 2 on SP67.MULTTB now contains the wide band - multi channel phase offset which should be the same as in the SN table first copied. The phase corrections in CL3 should look the same but the amplitude corrections are now present also, derived from 3C84 with respect to 3C286.

Now apply the polarization angle correction.

Above, you noted CLCORPRM(1) = (66-LISTR) = 127.11 (or whatever), which should be entered as below:

Using SP67.MULTTB

AIPS 1:task 'CLCOR'
AIPS 1:source 'SPER' ' ';stokes 'L';
AIPS 1:gainver 3;gainuse 3
AIPS 1:OPCODE  'PHAS'
AIPS 1:CLCORPRM  127.11  0

The cyan symbols shows the rotation of the L phase corrections in CL3 with respect to the original, violet, symbols from CL2; R is unchanged.

Copy the solutions from the phase reference source (check the SN table numbers are correct for your data; this will copy SN 2 and 3, containing phase and amp & phase solutions respectively)

AIPS 1:task 'TACOP'
AIPS 1:inn '0200+539';incl 'TASAV'
AIPS 1:outn 'SP67';outcl 'MULTTB'
AIPS 1:inext 'SN';inver 2;ncount 2;outver 0

On SP67.MULTTB, these become SN 3 and 4. Apply these sequentially using CLCAL, starting with the CL table containing the phase offset and other corrections.

AIPS 1:task 'CLCAL'
AIPS 1:source ' ';calsour ' '
AIPS 1:sampty ' ';bparm 0;smotype ' '
AIPS 1:snver 3;inver 0;gainver 3;gainuse 4

AIPS 1:snver 4;inver 0;gainver 4;gainuse 5

Check the CL tables in SNPL. They should contain the time-dependent phase and amplitude corrections from the phase-reference source. For other data sets, if the equivalent of CL 5 just contains flat values, see MERLIN User Guide 5.4.3.1 Time labels 10

Phase self-calibration of S Per - LL applied to RR also

Now apply CL5, which has accumulated all the calibration source corrections, to S Per, and examine its spectrum in various polarizations/Stokes. You can change the APARMs to see the difference between vector and scalar averaging and rescale the plots etc.

AIPS 1:task 'POSSM'
AIPS 1:source 'SPER' '
AIPS 1:anten 5 0
AIPS 1:docal 1;gainuse 5;doband 1;bpver 1;dopol 1
AIPS 1:aparm 1 1 0 18,-200,200
AIPS 1:solint 0;nplot 6
AIPS 1:bch 111;ech 400
AIPS 1:stokes 'll'

Vector averaged spectrum showing LL in yellow and RR in green, peaking in different channels. The flux density is similar on all baselines suggesting that the source is not very resolved.

Change BCHAN and ECHAN in POSSM to zoom in around the brightest channels in each polarization - I make these LL chan 332; RR chan 322.

Image the brightest channel/polarization

AIPS 1:task 'IMAGR'
AIPS 1:source 'SPER' ' '
AIPS 1:outn 'SP67_332';outse 0
AIPS 1:stokes 'll'
AIPS 1:bch 332;ech 332
AIPS 1:docal 1;gainuse 5;doband 1;bpver 0;dopol 1
AIPS 1:cells 0.04 0.04;imsiz 512 512;zerosp 0
AIPS 1:minpatch 255;uvwtfn 'n';niter 1000;imagrprm 0;dotv 1

Box carefully and don't clean too much - <100 iterations is enough. Plot the naturally weighted dirty beam to see where the sidelobes are.

This map gives the most accurate absolute position of this maser component, as discussed in the MERLIN User Guide 5.2.5 Position accuracy

After CCMRG I got

   Comp        Delta X        Delta Y       Flux            Total
       #      Milliasec      Milliasec        Jy               Jy
       1           0.00         -40.00       1.3502933        1.3502933
       2          40.00         -40.00       1.2744405        2.6247339
       3          80.00         -40.00       1.0709333        3.6956673
       4         -40.00         -40.00       0.5658752        4.2615423
       5         -40.00           0.00       0.5633522        4.8248944

As the phase solutions copied from the phase reference source are not likely to be perfect for S Per, it is possible that this channel is point-like and the apparent extension is due to phase errors.

Use just one or a few CC as a model (here I use NCOMP 5), e.g.

AIPS 1:task 'CALIB'
AIPS 1:inn 'SP67';incl 'MULTTB'
AIPS 1:calsour 'SPER' ' '
AIPS 1:in2n 'SP67_322';in2cl 'LCL001';in2se 0
AIPS 1:NCOMP 5 0
AIPS 1:bch 332;ech 332;solint 5;refant 5
AIPS 1:docal 1;gainuse 0;doband 1;bpver 1
AIPS 1:aparm 3 0 0 0 0 0 2 0 1;solmo 'p'
AIPS 1:snver 0;cparm 0

making SN 5. Check that most solutions passed.

The atmospheric errors should be independent of polarization and we have used the LL map CC as a model. The polarization angle correction (CLCOR) should have taken care of any phase offset between L and R. We therefore copy the LL solutions to RR by editing the SN table:

AIPS 1:task 'SNCOR'
AIPS 1:snver 5
AIPS 1:Stokes ' ';opcod 'PCOP'; SNCORPRM(1)=2

Write to a CL table (check all CLCAL inputs):

AIPS 1:task 'CLCAL'
AIPS 1:sampty '';bparm 0;smotype ''
AIPS 1:inn 'SP67';incl 'MULTTB'
AIPS 1:snver 5;inver 0;gainver 5;gainuse 6

Re-image, applying the new CL 6. My image looked much more point-like.

Merge and inspect CC I chose just the first one for a model for the next round of self-cal.

If you are confident that the model is good shorten the solution interval even more and reject failed solutions (aparm(9)=0).

AIPS 1:tget CALIB
AIPS 1:gainuse 0;in2se 0
AIPS 1:solint 1
AIPS 1:in2se 0;ncom 1 0
AIPS 1:aparm 3 0 0 0 0 0 3 0 0
AIPS 1:snver 0

SNPL should now show that the solutions are almost zero for L - a systematic residual ripple would suggest that the model is not quite right.

tget SNCOR and copy the LL solutions to RR for the new SN table 6

Write this to CL 7

AIPS 1:tget CLCAL
AIPS 1:snver 6;inver 0;gainver 6;gainuse 7

Image the data again applying the new CL table 711.

Amplitude self-calibration - LL applied to RR also

As we want to measure Stokes V (circular polarization) we have to be very careful to preserve any amplitude as well as phase differences between L and R. The polarization angle correction also cured any L-R instrumental phase offset, but is there an amplitude offset? Extragalactic sources like the phase reference are not usually circularly polarized on MERLIN scales and neither is 3C84. The ratio of amplitude solutions can be plotted:

AIPS 1:task 'SNPL'
AIPS 1:inn '0200+539';incl 'TASAV'
AIPS 1:inext 'sn';inver 0;stokes 'rato';nplot 6

This shows that the ratio between LL and RR is close to 1, so we can transfer amplitude solutions between polarizations. We want to normalise the gain solutions so that we keep an accurate flux scale. This complicates matters because for this to work properly we have to split out the relevant polarization from SP67.MULTTB.

AIPS 1:task 'SPLIT'
AIPS 1:Stokes 'll';outcl ''
AIPS 1:DOCAL 1;gainuse 7;doband 1;bpver 1;dopol 1;flagver 1
AIPS 1:BCH 332;ECH 332;aparm 0

The calibration has been written into the data so we don't need DOCAL nor DOBAND. Adjust the solint if necessary so that only a few solutions are rejected. CPARM(2) 1 normalises the gain and self-calibrate the SPLIT channel.

AIPS 1:tget CALIB
AIPS 1:inn 'SPER';incl 'SPLIT';inse 0
AIPS 1:docal -1;doband -1;in2se 0;clro
AIPS 1:solint 2
AIPS 1:ncom 1 0
AIPS 1:aparm 4 0 0 0 0 0 2 0 
AIPS 1:solmo 'a&p'
AIPS 1:snver 0;cparm 0 1

Check the L solutions carefully in SNPL - there should be no wild points and they should be around 1. As CALIB was run on single-polarization data there are no entries for R.

Copy the SN table back to SP67.MULTTB using a task which also duplicates the L entries for R.

Using SPER.SPLIT as the INFILE, enter the original SP67.MULTTB as the outname etc. (in this example it is catalogue No 13) e.g.

task 'SNDUP'
inver 0;outver 0
geto 13

This should produce a new SN table e.g. SN7 on SP67.MULTTB

Check again in SNPL on SP67.MULTTB - the L and R amp solutions for SN 7 should be indentical - and interpolate the solutions to a CL table

AIPS 1:tget CLCAL
AIPS 1:snver 7;inver 0;gainver 7;gainuse 8

Re-image the data for a check.

Check in POSSM that LL and RR still look different.

Phase self-calibration of RR

The calibration derived from LL channel 332 has been applied to all channels and all polarizations. If the bandpass corrections are good then there is no need to calibrate other channels further, but polarization leakage etc. means that we may be able to improve the RR calibration.

Image the brightest RR channel, 322, applying all calibration - in IMAGR change the STOKES, BCHAN, ECHAN and OUTNAME appropriately.

CCMRG the output map and choose one or a few CC for self-calibration as you did for LL - use the new RR map as GET2N

AIPS 1:tget CALIB
AIPS 1:docal 1;gainuse 0;doband 1;bpver 1;flagver 1
AIPS 1:in2n 'SP67_322';in2cl 'RCL001';in2se 0
AIPS 1:bch 322;ech 322;solint 5
AIPS 1:ncom 3 0
AIPS 1:aparm 3 0 0 0 0 0 2 0 1 
AIPS 1:solmo 'p'
AIPS 1:snver 0;cparm 0

I get SN 8 - you may be on a different iteration, check SN and CL table numbers. Check number of good solutions, use SNPL

Now, the signal to noise is less for RR so we don't want to apply the solutions to LL so we set the LL solutions to zero. This is the SN table for phase self-cal of RR, chan 322 before (straw-colour) and after (red) zeroing the LL solutions with SNCOR.

AIPS 1:tget 'SNCOR'
AIPS 1:SNVER 8
AIPS 1:opcod 'ZPHS'
AIPS 1:STOKES 'L';SNCORPRM  0

AIPS 1:tget CLCAL
AIPS 1:snver 8;inver 0;gainver 8;gainuse 9

Image again and CCMRG

      #      Milliasec      Milliasec        Jy               Jy
       1          40.00           0.00       1.5521096        1.5521096
       2          40.00         -80.00       0.1610361        1.7131457
       3          40.00         -40.00       0.1055163        1.8186619
       4          80.00         -80.00       0.0188955        1.8375574
       5           0.00         -40.00       0.0103750        1.8479325

It seems to be extended to me - I used the first 5 CC from the new map as a model for a further round of self-calibration

AIPS 1:tget CALIB
AIPS 1:gainuse 0;in2se 0
AIPS 1:solint 3
AIPS 1:ncom 5 0
AIPS 1:aparm 1 0 0 0 0 0 2 0 1
AIPS 1:solmo 'p'
AIPS 1:snver 0

AIPS 1:tget SNCOR
AIPS 1:snver 9

tget CLCAL
AIPS 1:snver 9;inver 0;gainver 9;gainuse 10

As RR is fainter than LL we can't use such a short solution interval and it is too weak for amplitude self-cal this is as far as we go.

Now check with POSSM that the spectra have improved - if you use ANTEN 0;BASE 0;NPLOT 0 you will get a single averaged spectrum. Compare applying e.g. CL 5 with applying the latest CL.

Imaging the OH data cube

Setting up the imaging

Check for ringing (see 22 GHz notes): Select ~10 channels around the brightest peak in the brightest polarization and run imagr (DOTV -1)

Examine small output cube and select peak position for ISPEC

AIPS 1:task 'ISPEC'
AIPS 1:blc 252 254 0; trc 258 260 0;dotv 1

Looks OK.

Split out S PER - apply your final CL table (10 in this example)

task 'SPLIT'
AIPS 1:source 'SPER' ' '
AIPS 1:stokes ' ';docal 1;gainuse 10
AIPS 1:dopol 1;doband 1;bpver 1;flagver 1;douvcomp -1
AIPS 1:outse 0;BCH 31;ECH 480;aparm 0

Run WTMOD on the split file (this is probably SPER.SPLIT.2) to reweight the antennas in proportion to their sensitivities (see MUG***)

task 'WTMOD'
AIPS 1:antwt 0.61 1.74 0.73 1.00 1.00 0.77
AIPS 1:outn 'SP67';outcl ' '

The WTMOD file was used to plot fully calibrated vector-averaged spectra in LL (yellow), RR (green), Stokes Q (pink) and U (red) polarizations.

AIPS 1:tget POSS
AIPS 1:BCH 101;ECH 390;APARM 1 1 0 8 0 0 2 0 0 1
AIPS 1:ANTEN 0;BASE 0;NPLOT 0;CODETYPE 'AMP'
AIPS 1:DOCAL -1;DOBAND -1;DOPOL -1;LTY -7;bparm 0

Check beamsize and weighting on a not-too-bright channel

AIPS 1:tget IMAGR
AIPS 1:inn 'SP67';incl 'WTMOD'
AIPS 1:docal -1;doband -1;dopol -1
AIPS 1:bchan 240;echan 240;stokes 'll'
AIPS 1:outn 'SP67_240'
AIPS 1:uvwtfn ' ';uvbox 4;uvbxfn 5;robust 2;
AIPS 1:bmaj 0.15;bmin 0.15;imagrprm(5) 1

See discussion of weighting in tutorial for 22 GHz masers. I chose ROBUST 1.5 and FLUX 0.05 giving this dirty beam with partial uniform weighting - compare with the naturally weighted dirty beam.

Imaging S Per at 1.6 GHz in full polarization

This may take 15-30 mins per cube so you might want to just do a few channels in order to have a quick look and leave the rest to run over lunch or use ready-made full cubes for later analysis. Remember to set DOTV -1!

Example of full final IMAGR inputs for Stokes 'I'

With the final cubes, this swaps the velocity into the header if it was correctly set with SETJY: GETN (a datacube image) and look at the header before and after ALTSW:

AIPS 1:IMH
AIPS 1:ALTSW
AIPS 1:IMH

To plot the cube, use the spectrum to pick a quiet channel, load it into the TV and get the noise using TVWIN and IMSTAT e.g. for SPER_99_67.ICL001

AIPS 1:TBLC(3) 121;FUNCTY 'LG';PIXRAN 0
AIPS 1:TVLO
AIPS 1:TVWIN
AIPS 1:IMSTAT

AIPS 2: Mean=-1.3364E-04 rms= 6.4344E-03 JY/BEAM   over   56259. pixels

These settings plot the whole region with signal, with very wide-spaced contours; set a smaller range of blc(3) to trc(3) to plot fewer channels. CLEV is set to close to 3 sigma rms noise.

AIPS 1:task 'KNTR'
AIPS 1:DOCONT 1;DOGRE -1;DOVECT -1
AIPS 1:blc 246 247 110;trc 266 267 347
AIPS 1:CLEV 0.02;LEVS 1 4 16 64
AIPS 1:CBPLOT  2;LABEL 1
AIPS 1:LTY -8

AIPS 1:task 'LWPL'
AIPS 1:lpen 1;dparm 0 0 0 0 1 4 31 6
AIPS 1:OUTF 'pwd:SPER_ICLN.PS'

This will write the total intensity cube map to disc. See HELP LWPL to change font size etc.

If you have already made the I cube and checked it and all the inputs in IMAGR are correctly set, you can tell AIPS to make the other cubes one afer another. You cannot interrupt the process easily so check carefully before entering this:

AIPS 1:dotv -1;dowait 1
AIPS 1:tget imagr; stokes 'Q';go imagr;stokes 'U';go imagr
AIPS 1:stokes 'V';go imagr;stokes 'LL';go imagr; stokes 'RR';go imagr
AIPS 1:dowait -1

This plots a section of the cube with linear polarization vectors:

AIPS 1:task 'KNTR'
AIPS 1:INN 'SPER_99_67';INCL 'ICL001'
AIPS 1:IN3CL 'QCL001';IN4CL 'UCL001'
AIPS 1:DOCONT 1;DOGRE -1;DOVECT 1
AIPS 1:blc 246 247 110;trc 266 267 347
AIPS 1:CLEV 0.02;LEVS 1 4 16 64
AIPS 1:XINC 2;YINC 2
AIPS 1:PCUT=CLEV;ICUT=CLEV
AIPS 1:CBPLOT  2;LABEL 1
AIPS 1:LTY -8
AIPS 1:DOTV -1

After the plot has finished use GO TKPL to send it to the screen or LWPL to make a disc plot of a total intensity sub-cube map with polarization vectors overlaid around the blue-shifted peak.

This uses greyscale to show Stokes V. You will have to use LWPL to print it to disc to see the grey in the Stokes V sub-cube map, negative emission paler, positive emission darker, around blue-shifted peak. Note that -ive contours are shown dashed.

AIPS 1:task 'KNTR'
AIPS 1:INN 'SPER_99_67';INCL 'VCL001'
AIPS 1:DOCONT 1;DOGRE 1;DOVECT -1
AIPS 1: FUNCTY ' ';PIXR 0
AIPS 1:CLEV 0.02;LEVS -64,-16,-4,-1,1,4,16,64

AIPS 1:tget LWPL
AIPS 1:INN 'SPER_99_67';INCL 'VCL001'
AIPS 1:lpen 1;dparm 0 0 0 0 1 4 31 8
AIPS 1:OUTF 'pwd:SPER_VCLN.PS'

Analysis of maser images

If you look closely at the KNTR plots you can see that the emission moves by a few pixels along the velocity range. The best way to analyse compact maser shells like this is by fitting 2-dimensional Gaussian components to each patch of emision in each channel. This is very accurate where the masers are unresolved or barely resolved, particularly because in the case of ~spherical clouds, an elliptical Gaussian component is a good model for maser emission. The position accuracy is approximately the [(dirty beam size)/(signal to noise ratio)] or e.g. [150/(200/6.6)]= 5 mas for a 200 mJy maser component.

Further interpretation of the data is described in GaussianComponentFitting and other topics under ImageAnalysisandModelFitting - cubes in all polarizations (probably not as good as yours) are in /home/user/datastore/MERLIN_CUBES/ called SPER_99_67.LCL001.1  SPER_99_67.RCL001.1 SPER_99_67.VCL001.1 SPER_99_67.ICL001.1  SPER_99_67.QCL001.1  SPER_99_67.UCL001.1


HI Absorption - MERLIN

At ERIS itself, the data will be provided locally in a subdirectory /home/user/datastore/MERLIN_HI. Make a soft link to the data and set a WORK environment as you have before.

The data links given in the tutorial and summarised here can be used for pre-school testing.

H1 absorption with MERLIN tutorial notes


Methanol masers - EVN

Methanol masers are used to probe the environment of young stellar objects; 6 such sources including G23.657-0.127 were observed by the EVN at a fixed frequency of 6666.218 MHz in channel 512, using 1024x1.953 kHz channels in a total 2 MHz bandwidth and 2-sec integrations. We will reduce another source from the same experiment, G23.389. We thank Ania Bartkiewicz, Huib van Langevelde and collaborators for providing the data.

As with most EVN experiments this century, the data have been pipelined, and the resulting data products, logs and diagnostic plots are available via the EVN Archive entry for EN003B. We retrieved the FITS files en003b_1_2.IDI* containing line mode data, and the accompanyingPipeline pass 2 products including the calibration tables generated by the pipeline.

The Station logfiles include en003b.key which gives the observing parameters e.g.

! The target we select (out of several in the run)
source = 'G23.389' ra=18:33:14.3299  dec=-08:23:57.420  equinox=j2000 vel=+97 /
! J1825-0737 - phas_cal, cal_vlba, Peak X = 0.120 Jy
source = 'J1825-0737' ra=18:25:37.60955 dec=-07:37:30.0128 equinox=j2000 /
! 3C345 (J1642+3948)- fringe finder, amp_cal, quasar, S_8.4GHz=5.182 Jy
!source = '3C345'  ra=16:42:58.8102  dec=39:48:36.9950   equinox=j2000 /

This tutorial concentrates on steps which are important or unique for spectral line data reduction. Most of these are not VLBI-specific but there are several factors to bear in mind including:

  1. The corrections for delay (phase errors across the band) should have been derived using continuum calibration sources. If self-calibration from one spectral channel cannot be applied successfully elsewhere in the band, or if there are diagonal stripes in different places from channel to channel, delay errors may be responsible.
  2. VLBI has intrinsically sparse uv coverage, exacerbated by imaging individual channels a few kHz or less wide. Most VLBI spectral line images which are bright enough to self-calibrate will also be dynamic-range-limited. Plot the dirty beam to avoid mistaking sidelobes for masers, and don't CLEAN too much. If it is possible to use an image size >> source size, this also helps (especially in the direction of beam elongation, i.e. N-S at low Dec.). On the other hand, it is counterproductive to CLEAN too large an area or too deeply; great care should be taken to set boxes and/or a FLUX cutoff.

  3. Inspect the phase rates before deciding what interval to average over in self-calibration. If you set a solution interval longer than the time taken for the phase to change by ~pi/2, this will be counter productive unless you are trying to remove superimposed long-term ripples (in which case be carefly to normalise amplitude solutions). If the high phase-rate is due to an off-centre source, consider shifting the data using UVFIX.
  4. The higher resolution means that you can very rarely assume anything is a point source (although sometimes you have to approximate), be it a calibration source or a maser target. If you calibrate a source consisting of 2 or more distinct compact objects, using a point model, you may get 'spurious symmetrization' - a point double has one component where you placed the model, the second component, and its reflection about the centre. Sometimes the only way out of this is to experiment with a double model incorporating one or other of the possible second components until you find which gives the best results after several rounds of self-calibration. Alternatively (or as well), symmetric artefacts can result from amplitude errors and may vanish if you calibrate the amplitudes using a point model.
  5. For a convenient image size of 512x512 pixels the field of view is very small, e.g. 0.25 arcsec for these data. The target position may not be known that accurately and the higher phase rates (especially if only a fringe finder and not a phase reference source was used) mean that the first image of the target may only show a blank field. If this is the case try using a larger IMSIZ or many fields, without cleaning. If there seem to be sidelobes, apply a shift in the direction of their origin. For un-phase-referenced data you might have to run FRING on the target first using a default point model.
  6. Always check that self-calibration of the brightest channel also improves the appearance of the other channels which appear to have signal. Excessive self-calibration on a point model can make other emisison vanish, whilst using a complex but wrong model can make all point sources in other channels take on the same extended appearance.

Many of these issues can also affect data from MERLIN or other interferometers, especially at high frequency.

Start as usual by linking to the data and setting an environment. One of the files is >2Gb and has to be reconstructed using cat. This will take 10-15 mins, probably.

mkdir EVNMETH
cd EVNMETH
cat /home/user/datastore/EVN_LINE/xa? > EN3B_LINE.SPLAT
ln -s /home/user/datastore/EVN_LINE/en003b_2.tasav.fits .
export WORK=/home/user/EVNMETH

Start the tutorial by loading EN3B_LINE.SPLAT into AIPS (as the data have already been concatenated, other FITLD settings should be default).

AIPS 1:task 'FITLD'
AIPS 1:inf 'WORK:EN3B_LINE.SPLAT'
AIPS 1:douvcomp -1

Reference source calibration

Most of these steps have already been done; processes in subsections marked (for reference) do not need to be repeated (although you are welcome to do so if you have time, first deleting the relevant tables).

In summary, we loaded the data, and inspected and edited the calibration sources and copy the calibration table generated by the pipeline which contains the amplitude scale and the parallactic angle corrections. We then derived solutions for:

The early stages of data reduction are described in the EVN Data Analysis Guide. Some of the AIPS task inputs specific to this data set are listed below but this is not a complete description of data reduction; if you were doing it for yourself you should inpect the data frequently and follow the Data Analysis Guide. You can also see the GettingStartedonaDataset EVN section here.

Original loading and editing of the data (for reference)

SpectralLineVLBILoadingData

Delay, rate and phase calibration (for reference)

DelayPhaseandRateCalibration

Bandpass calibration

In VLBI data reduction, bandpass calibration in AIPS is necessary even for continuum targets, but it is particularly important, of course, for spectral line sources. This is in order to transfer self-calibration solutions from the reference channel to the rest of the line data, as well as to ensure a good position and amplitude scale for individual channels. You should always check that the bandpass solutions are reasonable, that they do not change the flux scale drastically and that applying the corrections reduces the noise in the spectra (using POSSM) and in spectrally-averaged data (using VPLOT or after imaging).12

Derive bandpass corrections - select and average all times or good time interval, long enough to have good SNR. Interpolate over flagged channels (BPASSPRM(9)=1) and normalise the solutions (BPASSPRM(10)=1 or 2) to minimise the effect of amplitude errors.13 Make sure that you apply the correct CL table (4) as the tutorial data set contains higher numbered tables.

AIPS 1:task 'BPASS'
AIPS 1:CALSOUR    '3C345' ' '
AIPS 1:timeran 0 9 56 0 0 10 28 0;solint -1
AIPS 1:docal 2;gainuse 4       
AIPS 1:refant 3               
AIPS 1:BPASSPRM 0 1 0 0 0 0 0 0 1 2                      
AIPS 1:ICHANSEL 25, 800,1,1

Check in the BP table in POSSM and the effect on the spectral profile of 3C345 before (red) and after (yellow) applying the BP table.

Self-calibration of phase reference source (for reference)

PhaseReferenceSelfCal

Note that we prepared the data by deriving the BP table before this stage; in the data set you are given the BP table has been deleted to allow you to re-derive it.

The original data set contained 6 targets; for this tutorial, after all reference source calibration, we used SPLAT to extract G23.389, J1825-0737 and 3C345, to make EN3B_LINE.SPLAT. All extension tables were copied unapplied, and we re-indexed EN3B_LINE.SPLAT.

Spectral Line Calibration

On EN3B_LINE.SPLAT, CL 7 contains cumulative calibration:

  1. Initial amplitude scaling based on antenna Tsys measurements b. Parallactic angle correction c. Delay correction for instrumental clock errors d. Phase, rate and delay corrections derived as a function of time from the calibration sources e. Phase and amplitude corrections derived from the phase reference source.

a., b. and c. are applied across all sources; corrections d. and e. are derived from J1825-0737 for application to itself and to the target, G23.389.

EN3B_LINE.SPLAT also should have the BP table which you have derived and an FG table along with the usual index etc. If you mess up or delete a table in error, EN3B_LINE.TASAV.1 can be loaded and contains copies of all the extension tables generated up to this stage.

Transforming from fixed frequency to fixed velocity

Set the methanol rest frequency and Vlsr of the target in the SU table and header (see en003b.key above).

AIPS 1:SETJY
AIPS 1:source 'G23.389 '''
AIPS 1:sysvel 97
AIPS 1:RESTFREQ   6.668E+09   519000
AIPS 1:aparm 512 0
AIPS 1:VELTYP 'lsr'
AIPS 1:veldef 'radio'

The bandpass corrections are derived at the observing frequency so they should be applied to the target at fixed frequency. After this, the channel numbering is shifted with respect to the data of line sources in order to correct for the doppler effect due to the motion of the Earth with respect to the LSR. You can see how this differs in different directions on the sky by using the command-line Starlink package rv (enter EFFELSBERG as observatory; get the date from the Observ. date in the aips data header, get the sources' coordinates from the .key file (see link at start of this section) or the SU table. The end channels must be flagged first to prevent aliasing:

AIPS 1:inn 'G23.389';incl 'splat'
AIPS 1:task 'UVFL'
AIPS 1:bch 1;ech 20
AIPS 1:opcod 'FLAG

AIPS 1:bch 1000;ech 1024

When running CVEL the shifts should usually be <~10-20; much larger shifts suggest that either the observations were made at an inappropriate frequency, or more likely the wrong values (or none at all) have been entered in the SU table with SETJY.

AIPS 1:inn 'G23.389';incl 'SPLAT'
AIPS 1:task 'CVEL'
AIPS 1:source 'G23.389 '''
AIPS 1:doband 1;bpver 1;flagver 0;gainuse 0

Find the line

This shows inputs to POSSM for running on the CVEL output; the bandpass was written into the data.

AIPS 1:task 'POSSM'
AIPS 1:inn 'G23.389'; incl 'CVEL'
AIPS 1:source 'G23.389' ' '
AIPS 1:docal 2;gainuse 0;doband -1
AIPS 1:bch 51;ech 850
AIPS 1:aparm 1 0
AIPS 1:anten 3 0;base 0;nplot 9

Compare G23.389 before and after CVEL using POSSM.14

Repeat POSSM by zooming in on the line to find the G23.389 brightest channels (e.g. average all baselines to Ef(3)).

Spectral line self-calibration

Select the brightest channel or, if possible several bright channels with almost identical phase (suggesting that they are from the same, spatially compact. region). I used channels 763-768. See if they are bright enough to edit in IBLED. Apply any edits to all channels.

When you have a very sensitive antenna e.g. Ef (3) it can be useful to have a quick look at the data for all baselines to that antenna. If any bad points are not systematically associated with the same timeranges, that implies that they are due to bad data on the other antenna. The bad data will show up most clearly on the most sensitive baselines so you can probably use the Ef-XX baseline to flag all data to XX. However, check first on another XX baseline in case it is a correlator error which does not affect all baselines to any antenna. Here, look out especially for single-baseline bad data on Wb (9).

Image these channels averaged together:

AIPS 1:task 'IMAGR'
AIPS 1:inn 'G23.389';incl 'SPLAT'
AIPS 1:source 'G23.389' ' ';outn '763-768'
AIPS 1:doband -1;docal 2;gainuse 0;flagver 0
AIPS 1:bch 763;ech 768;nchav 6
AIPS 1:cellsiz 0.001,0.001;imsize 512 512
AIPS 1:UVWTFN 'N';niter 200;minpatch 255

Box carefully and don't clean too much. I found a bright point-like source slightly off-centre at about 18 33 14.325 -08 23 57.55 in the map of channels 763-768. With VLBI, even masers may be genuinely extended (especially averagiing several channels): I used these CC

    Comp        Delta X        Delta Y       Flux            Total
       #      Milliasec      Milliasec        Jy               Jy
       1         -44.00        -123.00       7.2727442        7.2727442
       2         -44.00        -125.00       1.6687992        8.9415436
       3         -43.00        -122.00       1.3730597       10.3146038
       4         -43.00        -119.00       1.3595167       11.6741209
       5         -43.00        -120.00       1.3375838       13.0117044
       6         -44.00        -126.00       0.6749998       13.6867046
       7         -43.00        -123.00       0.5597312       14.2464361
       8         -44.00        -122.00       0.5090292       14.7554655
       9         -44.00        -124.00       0.4698449       15.2253103
      10         -43.00        -124.00       0.3957705       15.6210804
      11         -44.00        -121.00       0.1939329       15.8150129

as a model in FRING. Average chans 763-768 and set DPARM(2)=-2 - no attempt to derive delay solutions - we do not want to force the phase to be the same across the band!15

AIPS 1:task 'FRING'
AIPS 1:inn 'G23.389'; incl 'CVEL'
AIPS 1:in2n '763-8';in2cl 'ICL001';in2se 0
AIPS 1:ncomp 11, 0
AIPS 1:calsour 'G23.389' ' '
AIPS 1:docal 2;gainuse 0;doband -1
AIPS 1:solint 10
AIPS 1:refant 3
AIPS 1:BCH 763;ECH 768
AIPS 1:APARM 3 0 0 0 0 2 3
AIPS 1:DPARM 1,-1,0,2

Check the results in SNPL; if the phase reference source solutions and the model are good the rate solutions should be a few mHz or less. The delays should be zero. Apply the resulting SN table (check what is the highest number) to CL7 to write a new CL table

AIPS 1:task 'CLCAL'
AIPS 1:inn 'G23.389'; incl 'CVEL'
AIPS 1:source ' ';calsou ''
AIPS 1:interpol 'AMBG'
AIPS 1:snver 6;gainver 7;gainuse 8
AIPS 1:REFANT 3

There should not be a big change in the phase solutions between CL7 (yellow) and CL8(green), given that CL7 produced a reasonable map.

The offset of the brightest CC (-0".044, -0".123) can be used as the origin of phase to investigate the effect on the spectrum, applying all calibration:

AIPS 1:task 'POSSM'
AIPS 1:inn 'G23.389'; incl 'CVEL'
AIPS 1:source 'G23.389' ' '
AIPS 1:docal 2;gainuse 0;doband -1
AIPS 1:bch 701;ech 830
AIPS 1:shift -0.044,-0.123
AIPS 1:aparm 1 0
AIPS 1:anten 3 0;base 0;nplot 0

Spectra made with/without shift/vector averaging show the effects of whether phase is including when the data are summed in time and of changing the origin of phase.

We try re-imaging just one channel, 766, with the appropriate shift in IMAGR. A second maser spot appears.

AIPS 1:tget imagr
AIPS 1:docal 2;gainuse 0
AIPS 1:BCH 766;ECH 766
AIPS 1:rashift=-0.044,0;decsh=-0.123,0
AIPS 1:outn '766'
AIPS 1:niter 1000;dotv 1

We use its good CC as a model. NCOMP -100 means go down to the 100th CC or the first -ive, whichever comes first, as a model - this automatic selection is safe to use if you have only cleaned in carefully drawn boxes.

AIPS 1:task 'CALIB'
AIPS 1:inn 'G23.389'; incl 'CVEL'
AIPS 1:in2n '766';in2cl 'icl001';in2se 0
AIPS 1:ncom -100, 0
AIPS 1:BCH 766;ECH 766
AIPS 1:docal 2;gainuse 0;doband -1
AIPS 1:solint 0.5
AIPS 1:refant 3
AIPS 1:aparm 3 0 0 0 0 0 1 0 1
AIPS 1:solmo 'p';solty '';snver 0

Check in SNPLT and apply (check your SN and CL table Nos at every stage).

AIPS 1:tget CLCAL
AIPS 1:snver 7;gainver 8;gainuse 9
AIPS 1:interpol '2pt'

Continue rounds of self-calibration until extra SN table solutions are close to zero and the maps don't improve.

When you have a good model you can start self-calibration of amplitude.

Note that, especially for VLBI data, using too long a solint in CALIB can give bad results if the target is off-centre or otherwise very structured.

AIPS 1:tget CALIB
AIPS 1:solmo 'a&p';solty 'l1';cparm 0 1
AIPS 1:bch 766;ech 766
AIPS 1:in2n  '766';in2se 0;ncom -100 0
AIPS 1:aparm(1) 4;cparm 0 1
AIPS 1:solint 0.5

If you notice a few very high or low amplitude solutions in SNPLT, check the phase of the data itself at that time. It may be that you have averaged too long when the phase rate is high - or it may be bad data. You can re-edit in IBLED or as a quick and dirty fix (especially if a high phase rate rather than bad data are the cause) you can edit the SN table using task SNED to flag amplitude solutions >>1.

When deciding which CC to use as a model, use CCNTR and PRTCC. The blue symbols show CC > 0.04 mJy/beam (approx 3 sigma); the red CC are <0.04 mJy/beam (including -ives).

You can use CCSEL on the CC table if there are -ives above good (>3sigma) positives in convincing positions.16

AIPS 1:task 'CCSEL' 
AIPS 1:inext 'cc';inver 0;outver 0
AIPS 1:SCALR1=0.001
AIPS 1:CUTOFF  0.04

produces 62 CC >0.04 mJy/beam (~3 sigma), although the original first negative was CC 32, in my data.

After you have finished amplitude self-calibration, use POSSM to check the spectrum, using scalar averaging (why?) to find a fainter channel at the other end of the spectrum from this source, and image it, to make sure that the solutions from the brightest channel have worked for all the bandpass. I used channel 743.

Making the datacube

SPLIT out chans 721-810 (or whatever looks like a range slightly wider than the apparent width of the maser spectrum), applying all calibration (keeping separate channels!)

Use a weaker channel (less dynamic-range-limited) to investigate the best settings for making the final datacube (see S Per maser notes). I used channel 23 (previously 743) and finally used these settings for the whole cube (note use of larger IMSIZ to ensure a good beam model is used for CLEANing, but we only search for emission in the inner quarter):

AIPS 1:task 'IMAGR'
AIPS 1:inn 'G23.389';incl 'SPLIT'
AIPS 1:bch 0;ech 0;outn 'G23.389'
AIPS 1:bch 0;ech 0;nchav 0;chinc 0
AIPS 1:flux 0.02
AIPS 1:robust 2
AIPS 1:uvwtfn ''
AIPS 1:uvbox 5;uvbxfn 4
AIPS 1:imsiz 1024 1024
AIPS 1:clbox 256,257,1024-256,1024-255,0
AIPS 1:bmaj 0.006;bmin 0.006
AIPS 1:imagrprm(5) 1

If you were looking for extended halo-type emission, then you might use completely natural weighting and a larger beam and possibly average every 3-10 channels to increase sensitivity. Examine the full-resolution image first to see what is the typical span in channels of emission at a given spot.

Use ALTSW on the output cube to put velocity in the header.

A lowest contour of 30 mJy was used for this plot of the datacube although in quiet channels the 3 sigma noise is half that value. You can use TRANS and MOMNT to produce a flux-weighted velocity map.

Further interpretation of the data is described in GaussianComponentFitting and other topics under ImageAnalysisandModelFitting - a data cube (probably not as good as yours) is in /home/user/datastore/EVN_LINE/G23.389.ICL001.1.


  • 1 Weighting can be inversely proportional to the rms per antenna per averaging time but this would mean that data from the less sensitive antennas would be poorly calibrated; weighting directly proportional to rms, however, makes solutions too noisy, in the case of most MERLIN data.

  • 2 Very negative areas of a map indicate a problem - an unsuitable calibration model, bad data or bad boxes/over-cleaning. Especially with a poorly-filled UV plane, you can produce artefacts easily with a bad model. However in the example here, the -ive components are close to the brightest positive ones and may just be due to over-cleaning.

  • 3 If you have problems getting a good map even for phase self-calibration try amp self-cal with a very long solution interval e.g. 30 mins, using cparm(2) =1 to normalise the solutions and then try more phase-self-calibration.

  • 4 Be careful that after self-calibrating one channel, any other lines which were visible in the spectrum before self-calibration are still there, especially for fainter sources.

  • 5 AIPS does not always fit the beam size accurately with messy beams from poorly filled apertures; plot the beam yourself to check

  • 6 Strictly speaking, we should therefore process the phase-reference source in wide field mode; however for speed we use this route and trust that as the target is bright enough to self-calibrate there will be no enduring errors. We avoid using a resolved model for the polarization calibration because we can use 3C84, which is unpolarized on these scales

  • 7 in most task inputs, INSE 0, INVER 0, GAINUSE 0 etc. will pick up the highest number file, CL table etc. The exception is the SNVER in CLCAL which should normally be given an explicit number - see HELP CLCAL.

  • 8 It is important to keep the same refant if you want good linear polarization.

  • 9 You can also check this by splitting out 3C286 applying all relevant calibration as you did for 3C84, and image it in I Q and U. When the map of 3C286 is plotted, the polarization vectors in the image plane should be at 33 degrees, the peak should be ~13.5 Jy and the length of the polarization vectors should correspond to ~10% polarizarion.

  • 10 When inspecting the data using LISTR or SNPLT, check that the first scan or solution for the phase reference source is close in time on the same day as for the target. Occasionally an observation starts just before midnight and the relative day numbers in AIPS are out of synch so after copying, the SN tables have to be edited to the correct time frame for the target.

  • 11 If you only have dual polarization (LL and RR) and cannot calibrate the L-R phase offset using the polarization angle, or if there is a significant amplitude offset, then see the MERLIN User Guide G.2.1 use of DIFRL.

  • 12 For some data, solutions have to be derived iteratively and/or using several sources or smoothing. In particular, beware the situation where the bandpass calibration source is too faint and/or there are too little good data; a simple one-channel-at-a-time bandpass table can actually add noise to the data in this case. Task CPASS as well as BPASS can be used.

  • 13 If there was very bad interference then BPASSPRM(11)=-2 weights down spiky channels.

  • 14 For un-phase-referenced line sources prior to phase self-calibration, you may have to look at just 10-60 mins of data at a time, if longer averaging becomes incoherent.

  • 15 Note that this is different from deriving solutions and then setting them to zero, as in the global delay solution for clock errors, when we do also solve for rate but set the rate solutions to zero before applying them to the data.

  • 16 This is frowned upon by some as it indicates that you have cleaned too large a region and/or too deeply, but it is a useful shortcut to build up a model; however don't select in CC <<3 sigma and make sure that subsequent self-cal iterations produce less prominent negative CC.

SpectralLineImaging (last edited 2007-04-02 09:17:30 by AntonSmit)