diff --git a/.gitattributes b/.gitattributes
index 68f6ba6b90c979b8fc3642b62cf2584274ee05f6..a79db8b0948a760c947035fbd21654b76516c688 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -169,6 +169,12 @@ CEP/BB/MWControl/test/tMWControl.in_mpi_out4 -text
 CEP/BB/MWControl/test/tMWControl.in_ms -text
 CEP/BB/MWImager/bootstrap -text
 CEP/BB/MWImager/src/mwimager -text
+CEP/BB/MWImager/src/mwimager-part -text
+CEP/BB/MWImager/test/tmwimager.in_cd -text
+CEP/BB/MWImager/test/tmwimager.in_ms0.vds -text
+CEP/BB/MWImager/test/tmwimager.in_ms1.vds -text
+CEP/BB/MWImager/test/tmwimager.in_ms2.vds -text
+CEP/BB/MWImager/test/tmwimager.in_vd -text
 CEP/BB/SourceDB/bootstrap -text
 CEP/CPA/PSS3/CAL/src/TEST.MEP/InitialValues/table.dat -text svneol=unset#unset
 CEP/CPA/PSS3/CAL/src/TEST.MEP/InitialValues/table.f0 -text svneol=unset#unset
diff --git a/CEP/BB/MWImager/configure.in b/CEP/BB/MWImager/configure.in
index 0c90906f8fc3d20bb97fdebf006c10880d186ba6..ec957438f4304c5b9d1eeb062ceb79fc7c96dcdf 100644
--- a/CEP/BB/MWImager/configure.in
+++ b/CEP/BB/MWImager/configure.in
@@ -53,6 +53,7 @@ dnl
 lofar_GENERAL
 lofar_INTERNAL(LCS/Common,Common,,1,Common/LofarTypedefs.h,,)
 lofar_INTERNAL(LCS/ACC/APS,APS,,1,APS/ParameterSet.h,,)
+lofar_INTERNAL(CEP/BB/MWCommon,MWCommon,,1,MWCommon/ClusterDesc.h,,)
 
 dnl
 dnl Output Makefiles
diff --git a/CEP/BB/MWImager/src/ConvertParset.cc b/CEP/BB/MWImager/src/ConvertParset.cc
index 34909d9e69b15ce11d096de9ca4d915561b983e5..66c35fb5f965eeb48c9b35acd50c532ffaddd98a 100644
--- a/CEP/BB/MWImager/src/ConvertParset.cc
+++ b/CEP/BB/MWImager/src/ConvertParset.cc
@@ -32,13 +32,13 @@ using namespace std;
 namespace LOFAR {
 
   ACC::APS::ParameterSet MWImager::convertParset (const string& nameIn,
-						const string& nameOut)
+						  const string& nameOut)
   {
     return convertParset (ACC::APS::ParameterSet(nameIn), nameOut);
   }
 
   ACC::APS::ParameterSet MWImager::convertParset (const ACC::APS::ParameterSet& in,
-						const string& nameOut)
+						  const string& nameOut)
   {
     ACC::APS::ParameterSet out;
     string outname;
@@ -72,20 +72,22 @@ namespace LOFAR {
     }
     {
       ACC::APS::ParameterSet grin = in.makeSubset ("Gridder.");
-      string cutoff     = grin.getString ("cutoff");
-      string nfacets    = grin.getString ("nfacets");
-      string nwplanes   = grin.getString ("nwplanes");
-      string oversample = grin.getString ("oversample");
-      string wmax       = grin.getString ("wmax");
-      string maxsupport = grin.getString ("maxsupport");
-      string type       = grin.getString ("type");
+      string cutoff       = grin.getString ("cutoff");
+      string nfacets      = grin.getString ("nfacets");
+      string nwplanes     = grin.getString ("nwplanes");
+      string oversample   = grin.getString ("oversample");
+      string wmax         = grin.getString ("wmax");
+      string maxsupport   = grin.getString ("maxsupport");
+      string limitsupport = grin.getString ("limitsupport", "0");
+      string type         = grin.getString ("type");
       string name = "Cimager.gridder." + type;
-      out.add ("Cimager.gridder",    type);
-      out.add (name + ".wmax",       wmax);
-      out.add (name + ".nwplanes",   nwplanes);
-      out.add (name + ".oversample", oversample);
-      out.add (name + ".cutoff",     cutoff);
-      out.add (name + ".maxsupport", maxsupport);
+      out.add ("Cimager.gridder",      type);
+      out.add (name + ".wmax",         wmax);
+      out.add (name + ".nwplanes",     nwplanes);
+      out.add (name + ".oversample",   oversample);
+      out.add (name + ".cutoff",       cutoff);
+      out.add (name + ".maxsupport",   maxsupport);
+      out.add (name + ".limitsupport", limitsupport);
     }
     {
       ACC::APS::ParameterSet soin = in.makeSubset ("Solver.");
@@ -105,8 +107,8 @@ namespace LOFAR {
     }
     {
       ACC::APS::ParameterSet imin = in.makeSubset ("Images.");
-      string angle1    = imin.getString ("angle1");
-      string angle2    = imin.getString ("angle2");
+      string angle1    = imin.getString ("ra");
+      string angle2    = imin.getString ("dec");
       string dirType   = imin.getString ("directionType");
       string nchan     = imin.getString ("nchan");
       string shape     = imin.getString ("shape");
@@ -128,7 +130,9 @@ namespace LOFAR {
       }
       ostringstream namesStr;
       namesStr << names;
-      out.add ("Cimager.Images.Names", namesStr.str());
+      out.add ("Cimager.Images.Names",    namesStr.str());
+      out.add ("Cimager.Images.shape",    shape);
+      out.add ("Cimager.Images.cellsize", cellSizeStr.str());
       vector<string> dirVec(3);
       dirVec[0] = angle1;
       dirVec[1] = angle2;
@@ -137,8 +141,6 @@ namespace LOFAR {
       dirVecStr << dirVec;
       for (unsigned i=0; i<stokes.size(); ++i) {
 	string name = "Cimager.Images.image." + stokes[i] + '.' + outname + '.';
-	out.add (name+"shape",     shape);
-	out.add (name+"cellsize",  cellSizeStr.str());
 	out.add (name+"frequency", frequency);
 	out.add (name+"nchan",     nchan);
 	out.add (name+"direction", dirVecStr.str());
diff --git a/CEP/BB/MWImager/src/mwimager b/CEP/BB/MWImager/src/mwimager
index f77f940f443cb2814f228414ca9fa6493ca409d4..11f5b730706edf5b7d314124c7197086165949ca 100755
--- a/CEP/BB/MWImager/src/mwimager
+++ b/CEP/BB/MWImager/src/mwimager
@@ -1,15 +1,97 @@
 #!/bin/sh
 
-if test $# != 1; then
-  echo "run as:   mwimager parset-file"
+# mwimager.cc: Script to start a distributed cimager process
+#
+# Copyright (C) 2008
+# ASTRON (Netherlands Foundation for Research in Astronomy)
+# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+# $Id$
+
+
+# Find the path used to start the script.
+pgmpath=`dirname $0`
+pgmpath=`cd $pgmpath > /dev/null 2>&1  &&  pwd`
+
+# Check if LOFARROOT is set.
+if test "$LOFARROOT" = ""; then
+  echo "LOFARROT is undefined; source lofarinit.(c)sh first"
+  exit 1
+fi
+
+# First argument must be ms-name.
+# Second one is optional clusterdesc name.
+# Third one is optional dry run (0=normal, 1=dry).
+if test $# = 0; then
+  echo "run as:   mwimager parset-file [clusterdesc] [wd] [logfile] [dry] [hfn]"
+  echo "       parset-file   name of parset file"
+  echo "       clusterdesc   name of clusterdesc file"
+  echo "                     default is $HOME/CEP.cl;usterdesc"
+  echo "       wd            working directory in subprocesses"
+  echo "       logfile       root name of logfile of each subprocess"
+  echo "                     A sequence number gets appended to it"
+  echo "                     default is mwimager.log"
+  echo "       dry           dry = do a dry run, i.e. only print commands"
+  echo "       hfn           name of the hostfile (machinefile) created"
+  echo "                     by startdistproc"
+  echo "                     Only needed for test purposes"
   exit 1
+else
+  psn=$1
+  shift
+fi
+cdn=$HOME/CEP.clusterdesc
+if test $# != 0; then
+  cdn=$1
+  shift
+fi
+wd=0
+if test $# != 0; then
+  wd=$1
+  shift
+fi
+logfile=
+if test $# != 0; then
+  logfile=$1
+  shift
+fi
+dry=0
+if test $# != 0; then
+  dry=$1
+  shift
+fi
+hfn=
+if test $# != 0; then
+  hfn=$1
+  shift
 fi
 
-# Convert parset file from SAS format to cimager format.
-convertimagerparset $1 $1.cvt
+# Prepend parset with pwd if it has a relative file name.
+case "$psn" in
+    /*)
+	;;
+    *)
+	psn=$wd/$psn
+	;;
+esac
 
-# Run the imager.
-~/askapsoft/Code/Components/Synthesis/synthesis/trunk/apps/cimager.sh -inputs $1.cvt
+# Get dataset name from the parset.
+msname=`getparsetvalue $psn dataset` || exit 1
 
-# Convert to FITS.
-## image2fits 
+# Start the imager processes on the various machines.
+echo "startdistproc -mode 0 -nomasterhost -dsn $msname -hfn "$hfn" -cdn $cdn -logfile "$logfile" $pgmpath/mwimager-part $LOFARROOT $psn $wd $dry"
+startdistproc -mode 0 -nomasterhost -dsn $msname -hfn "$hfn" -cdn $cdn -logfile "$logfile" $pgmpath/mwimager-part $LOFARROOT $psn $wd $dry
diff --git a/CEP/BB/MWImager/src/mwimager-part b/CEP/BB/MWImager/src/mwimager-part
new file mode 100755
index 0000000000000000000000000000000000000000..452fed9e368c96c271f5f5fa158b070e208fb69b
--- /dev/null
+++ b/CEP/BB/MWImager/src/mwimager-part
@@ -0,0 +1,81 @@
+#!/bin/sh
+
+# mwimager-part.cc: A distributed part of mwimager
+#
+# Copyright (C) 2008
+# ASTRON (Netherlands Foundation for Research in Astronomy)
+# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+# $Id$
+
+
+# Find the path used to start the script.
+pgmpath=`dirname $0`
+pgmpath=`cd $pgmpath > /dev/null 2>&1  &&  pwd`
+
+if test $# != 10; then
+  echo "run as:   mwimager-part dummy dummy dummy dummy rank ms-part"
+  echo "                        lofarroot parset-file wd dry"
+  exit 1
+fi
+
+shift
+shift
+shift
+shift
+seqnr=$1
+msn=$2
+lroot=$3
+psn=$4
+wd=$5
+dry=$6
+
+# Initialize lofar environment.
+. $lroot/lofarinit.sh
+# Set to working directory.
+cd $wd
+
+# Add channel info to the parset file.
+cp $psn $psn.part$seqnr
+schan=`getparsetvalue $psn.part$seqnr firstchan 2>/dev/null` || schan=0
+echan=`getparsetvalue $psn.part$seqnr lastchan  2>/dev/null` || echan=-1
+sfreq=`getparsetvalue $msn.vds StartFreqs schan` || exit 1
+efreq=`getparsetvalue $msn.vds EndFreqs   echan` || exit 1
+dname=`getparsetvalue $msn.vds Name` || exit 1
+echo "Images.frequency = [$sfreq, $efreq]" >> $psn.part$seqnr
+sed -e "s/^ *dataset * =.*/dataset = $dname/" $psn.part$seqnr > $psn.part$seqnr-tmp
+mv $psn.part$seqnr-tmp $psn.part$seqnr
+
+# Convert parset file from SAS format to cimager format.
+# Normally convertimagerparset is in the same installed directory as the script,
+# but in case of 'make check' it is in the src directory.
+if test -e $pgmpath/convertimagerparset; then
+  $pgmpath/convertimagerparset $psn.part$seqnr $psn.part$seqnr.cvt
+else
+  ../src/convertimagerparset $psn.part$seqnr $psn.part$seqnr.cvt
+fi
+
+if test "$dry" = dry; then
+  cat $psn.part$seqnr.cvt
+  exit 0
+fi
+
+# Run the imager.
+~/askapsoft/Code/Components/Synthesis/synthesis/trunk/apps/cimager.sh -inputs $psn.part$seqnr.cvt
+
+# Convert to FITS.
+## image2fits 
diff --git a/CEP/BB/MWImager/test/Makefile.am b/CEP/BB/MWImager/test/Makefile.am
index 3ad1c1d94ea04c8c1218401bf30387d5ea986254..81bab7681b4e9a3f4392c2fb95a9272856f8d061 100644
--- a/CEP/BB/MWImager/test/Makefile.am
+++ b/CEP/BB/MWImager/test/Makefile.am
@@ -1,8 +1,14 @@
-CHECKTOOLPROGS		= tconvertimagerparset
+CHECKTOOLPROGS	= tconvertimagerparset
 
-TESTS		= tconvertimagerparset.sh
+TESTS		= tconvertimagerparset.sh \
+		  tmwimager.sh
 
-EXTRA_DIST	= tconvertimagerparset.in tconvertimagerparset.stdout
+EXTRA_DIST	= tconvertimagerparset.run \
+		  tconvertimagerparset.in \
+		  tconvertimagerparset.stdout \
+		  tmwimager.run \
+		  tmwimager.in_cd tmwimager.in_vd \
+		  tmwimager.stdout
 
 include $(top_srcdir)/Makefile.common
 
diff --git a/CEP/BB/MWImager/test/tconvertimagerparset.in b/CEP/BB/MWImager/test/tconvertimagerparset.in
index d7bfaa6044524da906059d2037719370d14fe10a..796ad015d649a41dd718423e277af1ac75cdf9c2 100644
--- a/CEP/BB/MWImager/test/tconvertimagerparset.in
+++ b/CEP/BB/MWImager/test/tconvertimagerparset.in
@@ -1,10 +1,10 @@
 Images.stokes = [I,Q,U,V]
-Images.shape = [20,48, 2048]
+Images.shape = [2048, 2048]
 Images.cellSize = [240, 240]
 Images.frequency = [12345678, 12345679]
 Images.nchan = 1
-Images.angle1 = 230.35
-Images.angle2 = -10,345
+Images.ra = 230.35
+Images.dec = -10,345
 Images.directionType = J2000
 
 Solver.type = Dirty
diff --git a/CEP/BB/MWImager/test/tconvertimagerparset.stdout b/CEP/BB/MWImager/test/tconvertimagerparset.stdout
index 59e32a2451f9bbb5ee3b57021d2a0ac503cd84ed..1eb86a233c246c8dfefc0d7ea83fc5e298875246 100644
--- a/CEP/BB/MWImager/test/tconvertimagerparset.stdout
+++ b/CEP/BB/MWImager/test/tconvertimagerparset.stdout
@@ -1,29 +1,24 @@
 Cimager.Images.Names=[image.i.abc/def_Dirty,image.q.abc/def_Dirty,image.u.abc/def_Dirty,image.v.abc/def_Dirty]
-Cimager.Images.image.i.abc/def_Dirty.cellsize=[240arcsec,240arcsec]
+Cimager.Images.cellsize=[240arcsec,240arcsec]
 Cimager.Images.image.i.abc/def_Dirty.direction=[230.35,-10,345,J2000]
 Cimager.Images.image.i.abc/def_Dirty.frequency=[12345678, 12345679]
 Cimager.Images.image.i.abc/def_Dirty.nchan=1
-Cimager.Images.image.i.abc/def_Dirty.shape=[20,48, 2048]
-Cimager.Images.image.q.abc/def_Dirty.cellsize=[240arcsec,240arcsec]
 Cimager.Images.image.q.abc/def_Dirty.direction=[230.35,-10,345,J2000]
 Cimager.Images.image.q.abc/def_Dirty.frequency=[12345678, 12345679]
 Cimager.Images.image.q.abc/def_Dirty.nchan=1
-Cimager.Images.image.q.abc/def_Dirty.shape=[20,48, 2048]
-Cimager.Images.image.u.abc/def_Dirty.cellsize=[240arcsec,240arcsec]
 Cimager.Images.image.u.abc/def_Dirty.direction=[230.35,-10,345,J2000]
 Cimager.Images.image.u.abc/def_Dirty.frequency=[12345678, 12345679]
 Cimager.Images.image.u.abc/def_Dirty.nchan=1
-Cimager.Images.image.u.abc/def_Dirty.shape=[20,48, 2048]
-Cimager.Images.image.v.abc/def_Dirty.cellsize=[240arcsec,240arcsec]
 Cimager.Images.image.v.abc/def_Dirty.direction=[230.35,-10,345,J2000]
 Cimager.Images.image.v.abc/def_Dirty.frequency=[12345678, 12345679]
 Cimager.Images.image.v.abc/def_Dirty.nchan=1
-Cimager.Images.image.v.abc/def_Dirty.shape=[20,48, 2048]
+Cimager.Images.shape=[2048, 2048]
 Cimager.MinUV=1.0
 Cimager.datacolumn=CORRECTED_DATA
 Cimager.dataset=abc/def.MS
 Cimager.gridder=WProject
 Cimager.gridder.WProject.cutoff=0.001
+Cimager.gridder.WProject.limitsupport=0
 Cimager.gridder.WProject.maxsupport=1024
 Cimager.gridder.WProject.nwplanes=201
 Cimager.gridder.WProject.oversample=2
diff --git a/CEP/BB/MWImager/test/tmwimager.in_cd b/CEP/BB/MWImager/test/tmwimager.in_cd
new file mode 100644
index 0000000000000000000000000000000000000000..7ac410e08f56a7da40f82e1cf4fbba8bd3da540c
--- /dev/null
+++ b/CEP/BB/MWImager/test/tmwimager.in_cd
@@ -0,0 +1,6 @@
+ClusterName = cl
+NNodes = 2
+Node0.NodeName = localhost
+Node0.NodeFileSys = [node1:/usr]
+Node1.NodeName = localhost
+Node1.NodeFileSys = [node1:/usr]
diff --git a/CEP/BB/MWImager/test/tmwimager.in_ms0.vds b/CEP/BB/MWImager/test/tmwimager.in_ms0.vds
new file mode 100644
index 0000000000000000000000000000000000000000..b3d231d7a5a09e4ef118b4cc2a211f2989a215e0
--- /dev/null
+++ b/CEP/BB/MWImager/test/tmwimager.in_ms0.vds
@@ -0,0 +1,8 @@
+Name = tmwimager.in_ms0
+FileSys = node1:/usr
+StartTime = 0
+EndTime = 2
+StepTime = 0.5
+NChan = [2]
+StartFreqs = [20,25]
+EndFreqs = [22,30]
diff --git a/CEP/BB/MWImager/test/tmwimager.in_ms1.vds b/CEP/BB/MWImager/test/tmwimager.in_ms1.vds
new file mode 100644
index 0000000000000000000000000000000000000000..e0c9d9bdccba1fe2f9b784f59584a9720c11a58f
--- /dev/null
+++ b/CEP/BB/MWImager/test/tmwimager.in_ms1.vds
@@ -0,0 +1,8 @@
+Name = tmwimager.in_ms1
+FileSys = node1:/usr
+StartTime = 0
+EndTime = 2
+StepTime = 0.5
+NChan = [2]
+StartFreqs = [120,125]
+EndFreqs = [122,130]
diff --git a/CEP/BB/MWImager/test/tmwimager.in_ms2.vds b/CEP/BB/MWImager/test/tmwimager.in_ms2.vds
new file mode 100644
index 0000000000000000000000000000000000000000..2d0e99db1ad0a89273721995e4d61184bb4743b9
--- /dev/null
+++ b/CEP/BB/MWImager/test/tmwimager.in_ms2.vds
@@ -0,0 +1,8 @@
+Name = tmwimager.in_ms2
+FileSys = node1:/usr
+StartTime = 0
+EndTime = 2
+StepTime = 0.5
+NChan = [2]
+StartFreqs = [220,225]
+EndFreqs = [222,230]
diff --git a/CEP/BB/MWImager/test/tmwimager.in_vd b/CEP/BB/MWImager/test/tmwimager.in_vd
new file mode 100644
index 0000000000000000000000000000000000000000..97c819800692783b72449efc2e53c85fce99f1b5
--- /dev/null
+++ b/CEP/BB/MWImager/test/tmwimager.in_vd
@@ -0,0 +1,32 @@
+Name = tmwimager.in_vd
+StartTime = 0
+EndTime = 2
+StepTime = 0.5
+NParts = 3
+
+Part0.Name = tmwimager.in_ms0
+Part0.FileSys = node1:/usr
+Part0.StartTime = 0
+Part0.EndTime = 2
+Part0.StepTime = 0.5
+Part0.NChan = [2]
+Part0.StartFreqs = [20,25]
+Part0.EndFreqs = [22,30]
+
+Part1.Name = tmwimager.in_ms1
+Part1.FileSys = node1:/usr
+Part1.StartTime = 0
+Part1.EndTime = 2
+Part1.StepTime = 0.5
+Part1.NChan = [2]
+Part1.StartFreqs = [120,125]
+Part1.EndFreqs = [122,130]
+
+Part2.Name = tmwimager.in_ms2
+Part2.FileSys = node1:/usr
+Part2.StartTime = 0
+Part2.EndTime = 2
+Part2.StepTime = 0.5
+Part2.NChan = [2]
+Part2.StartFreqs = [220,225]
+Part2.EndFreqs = [222,230]
diff --git a/CEP/BB/MWImager/test/tmwimager.parset b/CEP/BB/MWImager/test/tmwimager.parset
new file mode 100644
index 0000000000000000000000000000000000000000..eb9094ee18cb47e6f686da7bc20a65c7cfe426a4
--- /dev/null
+++ b/CEP/BB/MWImager/test/tmwimager.parset
@@ -0,0 +1,29 @@
+Images.stokes = [I,Q,U,V]
+Images.shape = [2048, 2048]
+Images.cellSize = [240, 240]
+Images.nchan = 1
+Images.ra = 230.35
+Images.dec = -10,345
+Images.directionType = J2000
+
+Solver.type = Dirty
+Solver.algorithm = MultiScale
+Solver.niter = 10
+Solver.gain = 1.0
+Solver.verbose = True
+Solver.scales = [0, 3]
+
+Gridder.type = WProject
+Gridder.wmax = 75
+Gridder.nwplanes = 201
+Gridder.oversample = 2
+Gridder.maxsupport = 1024
+Gridder.cutoff = 0.001
+Gridder.nfacets = 1
+
+dataset = tmwimager.in_vd
+datacolumn = CORRECTED_DATA
+minUV = 1.0
+ncycles = 0
+restore = False
+restore_beam = [1, 1, 0]
diff --git a/CEP/BB/MWImager/test/tmwimager.run b/CEP/BB/MWImager/test/tmwimager.run
new file mode 100755
index 0000000000000000000000000000000000000000..9f75828083ccfdd93543af54c72181d20bec14aa
--- /dev/null
+++ b/CEP/BB/MWImager/test/tmwimager.run
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+# Add . to PATH.
+PATH=.:$PATH
+export PATH
+
+# Set srcdir if undefined (if run outside 'make check')
+if test "$srcdir" = ""; then
+  srcdir=../../../src
+fi
+
+# Enclose output in angle brackets to exclude it from the assay diff.
+echo ">>>"
+$srcdir/../src/mwimager tmwimager.parset tmwimager.in_cd `pwd` tmwimager_tmp.log dry tmwimager_tmp.hfn
+echo "<<<"
+
+# Append the three log files to the output.
+# Wait for the subprocesses to finish.
+sleep 5
+cat tmwimager_tmp.log-0
+cat tmwimager_tmp.log-1
+cat tmwimager_tmp.log-2
+
+# Remove the temporary parset part files.
+rm -f tmwimager.parset.part*
diff --git a/CEP/BB/MWImager/test/tmwimager.sh b/CEP/BB/MWImager/test/tmwimager.sh
new file mode 100755
index 0000000000000000000000000000000000000000..9f3552aeefda227f80b5905003a32500c71b6dbf
--- /dev/null
+++ b/CEP/BB/MWImager/test/tmwimager.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+$lofar_sharedir/runtest.sh tmwimager > tmwimager.log 2>&1
diff --git a/CEP/BB/MWImager/test/tmwimager.stdout b/CEP/BB/MWImager/test/tmwimager.stdout
new file mode 100644
index 0000000000000000000000000000000000000000..cd7c439d19942bef7fd2117a68027d71f65f623c
--- /dev/null
+++ b/CEP/BB/MWImager/test/tmwimager.stdout
@@ -0,0 +1,109 @@
+>>>
+startdistproc -mode 0 -nomasterhost -dsn tmwimager.in_vd -hfn tmwimager_tmp.hfn -cdn tmwimager.in_cd -logfile tmwimager_tmp.log /Users/diepen/sim/LOFAR/CEP/BB/MWImager/src/mwimager-part /Users/diepen/sim/LOFAR/installed/gnu_opt /Users/diepen/sim/LOFAR/CEP/BB/MWImager/build/gnu_opt/test/tmwimager.parset /Users/diepen/sim/LOFAR/CEP/BB/MWImager/build/gnu_opt/test dry
+socketrun 0 tmwimager_tmp.hfn 0 tmwimager_tmp.log /Users/diepen/sim/LOFAR/CEP/BB/MWImager/src/mwimager-part /Users/diepen/sim/LOFAR/installed/gnu_opt /Users/diepen/sim/LOFAR/CEP/BB/MWImager/build/gnu_opt/test/tmwimager.parset /Users/diepen/sim/LOFAR/CEP/BB/MWImager/build/gnu_opt/test dry
+ssh localhost /Users/diepen/sim/LOFAR/CEP/BB/MWImager/src/mwimager-part socket localhost 0 3 0 tmwimager.in_ms0 /Users/diepen/sim/LOFAR/installed/gnu_opt /Users/diepen/sim/LOFAR/CEP/BB/MWImager/build/gnu_opt/test/tmwimager.parset /Users/diepen/sim/LOFAR/CEP/BB/MWImager/build/gnu_opt/test dry
+ssh localhost /Users/diepen/sim/LOFAR/CEP/BB/MWImager/src/mwimager-part socket localhost 0 3 1 tmwimager.in_ms1 /Users/diepen/sim/LOFAR/installed/gnu_opt /Users/diepen/sim/LOFAR/CEP/BB/MWImager/build/gnu_opt/test/tmwimager.parset /Users/diepen/sim/LOFAR/CEP/BB/MWImager/build/gnu_opt/test dry
+ssh localhost /Users/diepen/sim/LOFAR/CEP/BB/MWImager/src/mwimager-part socket localhost 0 3 2 tmwimager.in_ms2 /Users/diepen/sim/LOFAR/installed/gnu_opt /Users/diepen/sim/LOFAR/CEP/BB/MWImager/build/gnu_opt/test/tmwimager.parset /Users/diepen/sim/LOFAR/CEP/BB/MWImager/build/gnu_opt/test dry
+<<<
+Cimager.Images.Names=[image.i.tmwimager.in_ms0_Dirty,image.q.tmwimager.in_ms0_Dirty,image.u.tmwimager.in_ms0_Dirty,image.v.tmwimager.in_ms0_Dirty]
+Cimager.Images.cellsize=[240arcsec,240arcsec]
+Cimager.Images.image.i.tmwimager.in_ms0_Dirty.direction=[230.35,-10,345,J2000]
+Cimager.Images.image.i.tmwimager.in_ms0_Dirty.frequency=[20, 22]
+Cimager.Images.image.i.tmwimager.in_ms0_Dirty.nchan=1
+Cimager.Images.image.q.tmwimager.in_ms0_Dirty.direction=[230.35,-10,345,J2000]
+Cimager.Images.image.q.tmwimager.in_ms0_Dirty.frequency=[20, 22]
+Cimager.Images.image.q.tmwimager.in_ms0_Dirty.nchan=1
+Cimager.Images.image.u.tmwimager.in_ms0_Dirty.direction=[230.35,-10,345,J2000]
+Cimager.Images.image.u.tmwimager.in_ms0_Dirty.frequency=[20, 22]
+Cimager.Images.image.u.tmwimager.in_ms0_Dirty.nchan=1
+Cimager.Images.image.v.tmwimager.in_ms0_Dirty.direction=[230.35,-10,345,J2000]
+Cimager.Images.image.v.tmwimager.in_ms0_Dirty.frequency=[20, 22]
+Cimager.Images.image.v.tmwimager.in_ms0_Dirty.nchan=1
+Cimager.Images.shape=[2048, 2048]
+Cimager.MinUV=1.0
+Cimager.datacolumn=CORRECTED_DATA
+Cimager.dataset=tmwimager.in_ms0
+Cimager.gridder=WProject
+Cimager.gridder.WProject.cutoff=0.001
+Cimager.gridder.WProject.limitsupport=0
+Cimager.gridder.WProject.maxsupport=1024
+Cimager.gridder.WProject.nwplanes=201
+Cimager.gridder.WProject.oversample=2
+Cimager.gridder.WProject.wmax=75
+Cimager.ncycles=0
+Cimager.restore=False
+Cimager.restore.beam=[1deg,1deg,0deg]
+Cimager.solver=Dirty
+Cimager.solver.Clean.algorithm=MultiScale
+Cimager.solver.Clean.gain=1.0
+Cimager.solver.Clean.niter=10
+Cimager.solver.Clean.scales=[0, 3]
+Cimager.solver.Clean.verbose=True
+Cimager.Images.Names=[image.i.tmwimager.in_ms1_Dirty,image.q.tmwimager.in_ms1_Dirty,image.u.tmwimager.in_ms1_Dirty,image.v.tmwimager.in_ms1_Dirty]
+Cimager.Images.cellsize=[240arcsec,240arcsec]
+Cimager.Images.image.i.tmwimager.in_ms1_Dirty.direction=[230.35,-10,345,J2000]
+Cimager.Images.image.i.tmwimager.in_ms1_Dirty.frequency=[120, 122]
+Cimager.Images.image.i.tmwimager.in_ms1_Dirty.nchan=1
+Cimager.Images.image.q.tmwimager.in_ms1_Dirty.direction=[230.35,-10,345,J2000]
+Cimager.Images.image.q.tmwimager.in_ms1_Dirty.frequency=[120, 122]
+Cimager.Images.image.q.tmwimager.in_ms1_Dirty.nchan=1
+Cimager.Images.image.u.tmwimager.in_ms1_Dirty.direction=[230.35,-10,345,J2000]
+Cimager.Images.image.u.tmwimager.in_ms1_Dirty.frequency=[120, 122]
+Cimager.Images.image.u.tmwimager.in_ms1_Dirty.nchan=1
+Cimager.Images.image.v.tmwimager.in_ms1_Dirty.direction=[230.35,-10,345,J2000]
+Cimager.Images.image.v.tmwimager.in_ms1_Dirty.frequency=[120, 122]
+Cimager.Images.image.v.tmwimager.in_ms1_Dirty.nchan=1
+Cimager.Images.shape=[2048, 2048]
+Cimager.MinUV=1.0
+Cimager.datacolumn=CORRECTED_DATA
+Cimager.dataset=tmwimager.in_ms1
+Cimager.gridder=WProject
+Cimager.gridder.WProject.cutoff=0.001
+Cimager.gridder.WProject.limitsupport=0
+Cimager.gridder.WProject.maxsupport=1024
+Cimager.gridder.WProject.nwplanes=201
+Cimager.gridder.WProject.oversample=2
+Cimager.gridder.WProject.wmax=75
+Cimager.ncycles=0
+Cimager.restore=False
+Cimager.restore.beam=[1deg,1deg,0deg]
+Cimager.solver=Dirty
+Cimager.solver.Clean.algorithm=MultiScale
+Cimager.solver.Clean.gain=1.0
+Cimager.solver.Clean.niter=10
+Cimager.solver.Clean.scales=[0, 3]
+Cimager.solver.Clean.verbose=True
+Cimager.Images.Names=[image.i.tmwimager.in_ms2_Dirty,image.q.tmwimager.in_ms2_Dirty,image.u.tmwimager.in_ms2_Dirty,image.v.tmwimager.in_ms2_Dirty]
+Cimager.Images.cellsize=[240arcsec,240arcsec]
+Cimager.Images.image.i.tmwimager.in_ms2_Dirty.direction=[230.35,-10,345,J2000]
+Cimager.Images.image.i.tmwimager.in_ms2_Dirty.frequency=[220, 222]
+Cimager.Images.image.i.tmwimager.in_ms2_Dirty.nchan=1
+Cimager.Images.image.q.tmwimager.in_ms2_Dirty.direction=[230.35,-10,345,J2000]
+Cimager.Images.image.q.tmwimager.in_ms2_Dirty.frequency=[220, 222]
+Cimager.Images.image.q.tmwimager.in_ms2_Dirty.nchan=1
+Cimager.Images.image.u.tmwimager.in_ms2_Dirty.direction=[230.35,-10,345,J2000]
+Cimager.Images.image.u.tmwimager.in_ms2_Dirty.frequency=[220, 222]
+Cimager.Images.image.u.tmwimager.in_ms2_Dirty.nchan=1
+Cimager.Images.image.v.tmwimager.in_ms2_Dirty.direction=[230.35,-10,345,J2000]
+Cimager.Images.image.v.tmwimager.in_ms2_Dirty.frequency=[220, 222]
+Cimager.Images.image.v.tmwimager.in_ms2_Dirty.nchan=1
+Cimager.Images.shape=[2048, 2048]
+Cimager.MinUV=1.0
+Cimager.datacolumn=CORRECTED_DATA
+Cimager.dataset=tmwimager.in_ms2
+Cimager.gridder=WProject
+Cimager.gridder.WProject.cutoff=0.001
+Cimager.gridder.WProject.limitsupport=0
+Cimager.gridder.WProject.maxsupport=1024
+Cimager.gridder.WProject.nwplanes=201
+Cimager.gridder.WProject.oversample=2
+Cimager.gridder.WProject.wmax=75
+Cimager.ncycles=0
+Cimager.restore=False
+Cimager.restore.beam=[1deg,1deg,0deg]
+Cimager.solver=Dirty
+Cimager.solver.Clean.algorithm=MultiScale
+Cimager.solver.Clean.gain=1.0
+Cimager.solver.Clean.niter=10
+Cimager.solver.Clean.scales=[0, 3]
+Cimager.solver.Clean.verbose=True