The dataset ftp://ftp.astro.umd.edu/pub/carma/data/SgrA.mir.tar.gz is used for this example2.1.
The commands you see below are all Unix shell commands, most of these are in fact MIRIAD programs. This is one of at least three ways to reduce your data using MIRIAD. It is the most compact form and probably the one most people will be familiar with.
Later we will explain the ways you get your data from the archive, but for now, lets assume you have the tar file in your current (ideally clean) working directory, you first untar this (usually compressed) file using the Unix tar command:
tar -zxf SgrA.mir.tar.gz
and you will see your observation is a directory (a MIRIAD dataset) with files in them. You should never manipulate these file directly, unless you really know what you are doing. MIRIAD program generally deal with these files.
Probably the next thing you do is make an observing summary log where you can check the names, frequency setup, LST ranges of the various sources in your observation etc.. The MIRIAD task ``listobs'' is used for this:
listobs vis=SgrA.mir log=listobs.log
Note that unlike the typical options in Unix commands, MIRIAD commands use a ``keyword=value'' command line syntax, but are otherwise implemented as Unix commands. In fact, they are simple Fortran programs that call libraries, and some astronomers are even known to make small modifications for themselves and recompile these programs.
Looking at the listobs.log file, and here is the example from SgrA:
Observed Sources Coordinates and Corr Freqs Source Purpose RA Decl Vlsr Corfs in MHz NOISE B 20 32 45.53 40 39 36.63 0.00E+00 0.0 MWC349 BF 20 32 45.53 40 39 36.63 0.00E+00 0.0 3C345 B 16 42 58.81 39 48 37.00 0.00E+00 0.0 1733-130 G 17 33 02.71 -13 04 49.54 0.00E+00 0.0 GCRING S 17 45 40.03 -29 00 27.87 0.00E+00 0.0
the dataset has several sources: a flux calibrator (F), a phase (gain) calibrator (G), a passband calibrator (B) and the science source (S) of interest. Sometimes some of the calibrators are actually the same. In particular, the phase calibrator will normally be observed alternatingly with your source every 10-20 mins. The flux and/or passband calibrator are normally stronger and observed for a short time (5-15 mins) before or after your observation. Sometimes a planet, if available, will be observed as well, for a more reliable flux calibration. In this simple example we will just use a passband and phase (gain) calibrator, 3C345 and 1733-130 resp.
For convenience, we first extract all the cross-correlations of all astronomical sources from this dataset, leaving out the NOISE source and the auto-correllations (more about those later). This is done with the powerful uvcat command:
uvcat vis=SgrA.mir select='-source(NOISE),-auto' out=all.vis
Now we are ready for a series of calibrations that can be applied to all the data. Line length and baseline calibration are the two we show:
First we apply a line length calibration. This corrects for any instrumental phase drifts that are due to changes in the length of the fibers, which are notably temperature sensitive and will expand and contract during the day, and especially can be abrubt during sunrise and sunset. Maybe give example with varplt how to look at these line length phases?
linecal vis=all.vis uvcat vis=all.vis out=all_1.vis
Next we can apply a baseline correction. Often during the course of an array configuration, better baselines become available, and they should be retro-actively applied to data from that array configuration. An option in the general purpose uvedit program accomplishes this, by feeding is a new antenna position file:
uvedit vis=all_1.vis out=all_2.vis apfile=$MIRCAT/baselines/carma/antpos.090331
Here you will need to find out which antpos file is the appropriate one for your observation. Check the output of listobs with available antpos files.
There are now two basic approaches to calibration. We either continue on the scheme described before: selecting a calibration type, and apply this to all the data, and continue this pipeline until ready to map. Although very elegant, some of the more complex calibration schemes are not easily implemented this way. Nonetheless, let us see how this scheme continues.
First we use a short 15 minute observation of a bright quasar (3C345 in this case) to calibrate the data such that the passband will then have zero phase and constant amplitude. The task mfcal does this by computing an antenna based frequency dependant solution, which we then apply to the whole observation.
mfcal vis=all_2.vis refant=2 interval=999 select="source(3C345)" uvcat vis=all_2.vis out=all_3.vis options=nocal
We now calculate the gains as a function of time using the selfcal program. This program can also lookup the last reported flux of the calibrator and thus give you properly calibrated fluxes in your source later on. After selfcal, just as before, we apply the gains and now obtaining a fully calibrated dataset!
mselfcal vis=all_3.vis refant=2 select="source(1733-130)" options=amp,apriori,noscale interval=5 puthd in=all_3.vis/interval value=0.1 uvcat vis=all_3.vis out=all_4.vis
After calibration, and before applying the gains, you will notice we have cheated and widened the validity interval (in units of days) to something big enough to safely interpolate into the source data. Use the output of listobs and your own judgement if this is a valid assumption.
In this particular example we have calibrated both amplitude and phase, another option would be to only calibrate the phases, and use a planet for amplitude scaling. This will be covered in later chapters.
Now we are ready for mapping and deconvolution. One of the standards tests is to map the calibrator and compare it to the beam:
invert vis=all_4.vis map=map0 beam=beam0 imsize=128 line=chan,1,1,2,2 select="source(1733-130)" clean map=map0 beam=beam0 out=model0 restor map=map0 beam=beam0 model=model0 out=clean0
Since CARMA is a heterogeous array, with different primary beams, we apply a mosaicing option to the mapping program, even if there is only one single pointing in the observation. Except when you want to detect or map a very small field of view, or a point source, this is essential. The current example observation of SgrA has 7 pointings, and because the source is extended, mosaicing is essential here:
invert vis=all_4.vis map=map1 beam=beam1 line=wide,1,1,2,2 "select=source($sname)" options=mosaic imsize=129 mossdi map=map1 beam=beam1 out=model1 restor map=map1 beam=beam1 model=model1 out=clean1
A last note before you might get your fingers wet: these commands are obviously tedious to type, and prone to typos. Of course in real life we use scripts (e.g. C-shell or python scripts), in such a way that you repeat your data reduction script, finetuning the various calibration schemes you apply.